From: <enl...@li...> - 2003-03-03 22:53:35
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_entry.c Log Message: Behavior somewhat more sanely when starting a selection past the end of the text. This could use a little tweaking still. Still need to add horizontal scrolling of the text based on cursor movement. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -3 -r1.48 -r1.49 --- ewl_entry.c 3 Mar 2003 18:14:22 -0000 1.48 +++ ewl_entry.c 3 Mar 2003 22:53:32 -0000 1.49 @@ -182,7 +182,8 @@ str = EWL_TEXT(e->text)->text; c_spos = ewl_cursor_get_start_position(EWL_CURSOR(e->cursor)); - if (str && (l = strlen(str)) && c_spos > l) { + l = ewl_text_get_length(EWL_TEXT(e->text)); + if (str && l && c_spos > l) { xx += ewl_object_get_current_w(EWL_OBJECT(e->text)); ww = 5; } else { @@ -252,15 +253,11 @@ ev = ev_data; e = EWL_ENTRY(w); + len = ewl_text_get_length(EWL_TEXT(e->text)); if (ev->x < CURRENT_X(e->text)) index = 0; else if (ev->x > CURRENT_X(e->text) + CURRENT_W(e->text)) { - char *str; - - str = ewl_entry_get_text(EWL_ENTRY(w)); - - if (str) - len = index = strlen(str); + index = len; } else index = ewl_text_get_index_at(EWL_TEXT(e->text), ev->x, CURRENT_Y(e->text) + @@ -268,7 +265,11 @@ index++; ewl_cursor_set_position(EWL_CURSOR(e->cursor), index, index); - e->base_click = index; + + if (index > len) + e->base_click = len; + else + e->base_click = index; ewl_widget_configure(w); |