From 5c62d98898e0570ee329fe50a8b9a33d5e7ba384 Mon Sep 17 00:00:00 2001 From: Sergey Semernin Date: Fri, 10 Apr 2009 14:21:36 +0000 Subject: [PATCH] From: Sergey Semernin In E_Dialog space key grabbed before than keydown event reach to entry widget in E_Entry_Dialog. Thus, I forced ungrab space key in e_entry_dialog_show constructor. Moreover, I added escape key handling in _e_entry_cb_key_down callback. I do not delete space key grub in E_Dialog, because, I think, it may be usefull here, when we need selecting controls with space. Or not? SVN revision: 39936 --- src/bin/e_entry_dialog.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bin/e_entry_dialog.c b/src/bin/e_entry_dialog.c index d36a19a02..d285c896f 100644 --- a/src/bin/e_entry_dialog.c +++ b/src/bin/e_entry_dialog.c @@ -18,6 +18,7 @@ e_entry_dialog_show(const char *title, const char *icon, const char *text, E_Entry_Dialog *ed; E_Dialog *dia; Evas_Object *o, *ob; + Evas_Modifier_Mask mask; int w, h; ed = E_OBJECT_ALLOC(E_Entry_Dialog, E_ENTRY_DIALOG_TYPE, _e_entry_dialog_free); @@ -37,6 +38,9 @@ e_entry_dialog_show(const char *title, const char *icon, const char *text, dia->data = ed; ed->dia = dia; + mask = 0; + evas_object_key_ungrab(dia->event_object, "space", mask, ~mask); + e_win_delete_callback_set(dia->win, _e_entry_dialog_delete); if (title) e_dialog_title_set(dia, title); @@ -116,10 +120,10 @@ _e_entry_cb_key_down(void *data, Evas_Object *obj, void *event_info) E_Entry_Dialog *ed; ev = event_info; - if (strcmp(ev->keyname, "Return")) return; if (!(ed = data)) return; - e_object_ref(E_OBJECT(ed)); - if (ed->ok.func) ed->ok.func(ed->text, ed->ok.data); - e_object_del(E_OBJECT(ed)); - e_object_unref(E_OBJECT(ed)); + if (!strcmp(ev->keyname, "Return")) + _e_entry_dialog_ok(data, ed->dia); + else + if (!strcmp(ev->keyname, "Escape")) + _e_entry_dialog_cancel(data, ed->dia); }