summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjaortega <jaortega>2001-03-13 00:32:06 +0000
committerjaortega <jaortega>2001-03-13 00:32:06 +0000
commitde46b4f1ddd7ed43bf8988e65234c9e33ef1e51d (patch)
tree7722a5d7fa6f3473ec6811a16411632854827c30
parente6c615a67ef73267fc8b7a600d531d8ccc67908f (diff)
downloadmdk-de46b4f1ddd7ed43bf8988e65234c9e33ef1e51d.tar.gz
mdk-de46b4f1ddd7ed43bf8988e65234c9e33ef1e51d.tar.bz2
minor changes
-rw-r--r--mixgtk/mixgtk_input.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/mixgtk/mixgtk_input.c b/mixgtk/mixgtk_input.c
index 95e22bb..8f4a777 100644
--- a/mixgtk/mixgtk_input.c
+++ b/mixgtk/mixgtk_input.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_input.c :
* Implementation of the functions declared in mixgtk_input.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/03/13 01:04:13 jose"
+ * Last change: Time-stamp: "01/03/13 01:27:32 jose"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -152,12 +152,33 @@ on_word_byte_key_press (GtkWidget *widget, GdkEvent *event, gpointer *data)
{
gint k = 0;
while (widget != childs_[k]) ++k;
- gtk_window_set_focus (GTK_WINDOW (dialog_),
- childs_[(k + 1) & (SIZE_ - 1)]);
+ gtk_window_set_focus (GTK_WINDOW (dialog_), childs_[(k + 1)%SIZE_]);
}
}
void
+on_word_sign_key_press (GtkWidget *widget, GdkEvent *event, gpointer *data)
+{
+ GdkEventKey *key = (GdkEventKey *)event;
+ if (key->string && strlen (key->string) > 0)
+ {
+ gchar s = key->string[0];
+ gchar *txt = gtk_entry_get_text (GTK_ENTRY (childs_[SIGN_]));
+ gchar c = txt ? txt[0] : '+';
+ if ( (s == '+' || s == '-') && s != c)
+ {
+ mix_word_t w =
+ mix_word_new (atoi
+ (gtk_entry_get_text (GTK_ENTRY (childs_[DEC_]))));
+ set_word_ (mix_word_negative (w));
+ }
+ }
+ if (key->keyval == GDK_KP_Tab || key->keyval == GDK_Tab ||
+ key->keyval == GDK_ISO_Left_Tab)
+ gtk_window_set_focus (GTK_WINDOW (dialog_), childs_[B1_]);
+}
+
+void
on_word_ok_clicked (GtkWidget *widget, gpointer *data)
{
const gchar *text = gtk_entry_get_text (GTK_ENTRY (childs_[DEC_]));