Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_entry.c Log Message: Make selections act a bit better. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_entry.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -3 -r1.89 -r1.90 --- ewl_entry.c 29 Jun 2008 14:01:39 -0000 1.89 +++ ewl_entry.c 6 Jul 2008 04:32:42 -0000 1.90 @@ -389,16 +389,28 @@ DRETURN(DLEVEL_STABLE); if (!strcmp(event->keyname, "Left")) + { + ewl_entry_selection_clear(e); ewl_entry_cursor_move_left(e); + } else if (!strcmp(event->keyname, "Right")) + { + ewl_entry_selection_clear(e); ewl_entry_cursor_move_right(e); + } else if (!strcmp(event->keyname, "Up")) + { + ewl_entry_selection_clear(e); ewl_entry_cursor_move_up(e); + } else if (!strcmp(event->keyname, "Down")) + { + ewl_entry_selection_clear(e); ewl_entry_cursor_move_down(e); + } else if (!strcmp(event->keyname, "BackSpace")) { @@ -550,11 +562,18 @@ ewl_entry_cb_mouse_move(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__) { + Ewl_Event_Mouse *event; + unsigned int idx = 0; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(w); DCHECK_TYPE(w, EWL_WIDGET_TYPE); - /* XXX do we leave the cursor at the start? or move to the end? */ + event = ev; + idx = ewl_text_coord_index_map(EWL_TEXT(w), event->x, event->y); + ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(EWL_ENTRY(w)->cursor), + idx); + ewl_widget_configure(w); DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs