Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_embed.c ewl_text.c Log Message: - hook in the key up code to handle focus changes - fixup some of the setting of last focused to go through the api so the signals get sent correctly - mark the text widget as ignoring focus change by default =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_embed.c 20 Oct 2005 04:33:47 -0000 1.12 +++ ewl_embed.c 20 Oct 2005 05:03:50 -0000 1.13 @@ -259,9 +259,17 @@ */ if (!embed->last.focused) { if (embed->last.clicked) - embed->last.focused = embed->last.clicked; + ewl_embed_focused_widget_set(embed, + embed->last.clicked); else - embed->last.focused = EWL_WIDGET(embed); + { + ewl_embed_focused_widget_set(embed, + ecore_dlist_goto_first(embed->tab_order)); + + if (!embed->last.focused) + ewl_embed_focused_widget_set(embed, + EWL_WIDGET(embed)); + } } /* @@ -299,6 +307,25 @@ DCHECK_PARAM_PTR("embed", embed); DCHECK_PARAM_PTR("keyname", keyname); + /* handle tab focus change + * XXX this should probably be pulled out to a config variable or + * something instead of tab... */ + if ((!strcmp(keyname, "Tab")) + && (!ewl_widget_ignore_focus_change_get(embed->last.focused))) + { + Ewl_Embed *emb; + unsigned int key_modifiers = 0; + + emb = ewl_embed_widget_find(embed->last.focused); + key_modifiers = ewl_ev_modifiers_get(); + if (key_modifiers & EWL_KEY_MODIFIER_SHIFT) + ewl_embed_tab_order_previous(emb); + else + ewl_embed_tab_order_next(emb); + + DRETURN(DLEVEL_STABLE); + } + ev.modifiers = mods; ev.keyname = strdup(keyname); @@ -354,7 +381,8 @@ * causes the widget to be destroyed. */ deselect = embed->last.clicked; - embed->last.focused = embed->last.clicked = widget; + ewl_embed_focused_widget_set(embed, widget); + embed->last.clicked = widget; ev.modifiers = mods; ev.x = x; @@ -904,11 +932,13 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("e", e); + /* make sure the list is at the last focused widget */ + ecore_dlist_goto(e->tab_order, e->last.focused); if (!(w = ecore_dlist_next(e->tab_order))) ecore_dlist_goto_first(e->tab_order); w = ecore_dlist_current(e->tab_order); - if (w) ewl_widget_focus_send(w); + if (w) ewl_embed_focused_widget_set(e, w); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -925,11 +955,13 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("e", e); + /* make sure the list is at the last focused widget */ + ecore_dlist_goto(e->tab_order, e->last.focused); if (!(w = ecore_dlist_previous(e->tab_order))) ecore_dlist_goto_last(e->tab_order); w = ecore_dlist_current(e->tab_order); - if (w) ewl_widget_focus_send(w); + if (w) ewl_embed_focused_widget_set(e, w); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -981,8 +1013,7 @@ DCHECK_PARAM_PTR("e", e); if ((w == e->last.focused) || (RECURSIVE(w) && ewl_container_parent_of(w, e->last.focused))) - e->last.focused = NULL; - + ewl_embed_focused_widget_set(e, NULL); if ((w == e->last.clicked) || (RECURSIVE(w) && ewl_container_parent_of(w, e->last.clicked))) e->last.clicked = NULL; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_text.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- ewl_text.c 18 Oct 2005 15:15:45 -0000 1.28 +++ ewl_text.c 20 Oct 2005 05:03:50 -0000 1.29 @@ -144,6 +144,9 @@ ewl_text_selection_cb_configure, NULL); ewl_container_child_append(EWL_CONTAINER(t), EWL_WIDGET(t->selection)); + /* text consumes tabs by default */ + ewl_widget_ignore_focus_change_set(EWL_WIDGET(t), TRUE); + DRETURN_INT(TRUE, DLEVEL_STABLE); } ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs