Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src Modified Files: ewl_entry.c ewl_entry.h ewl_spinner.c Log Message: - the ewl_spinner was always appending the value no matter where the cursor was. This provides a insert into ewl_entry at the cursor position and makes ewl_spinner call that - did it this way since the ewl_entry_cursor stuff is hidden from the apps - the other option is to just call the key_down_cb of the ewl_entry from the key_down cb of the spinner, but I don't know if thats a good idea or not.... =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -3 -r1.120 -r1.121 --- ewl_entry.c 21 Dec 2004 01:02:19 -0000 1.120 +++ ewl_entry.c 21 Dec 2004 01:18:11 -0000 1.121 @@ -348,6 +348,30 @@ } /** + * @param e: the entry widget to insert the text + * @param text: the text to insert in the entry widget @a e + * @return Returns no value. + * @brief Inserts text at cursor position + * + * Inserts text to the entry widget @a e at the current cursor position. + */ +void +ewl_entry_text_at_cursor_insert(Ewl_Entry * e, char *text) +{ + Ewl_Entry_Op *op; + int pos = 0; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("e", e); + DCHECK_PARAM_PTR("text", text); + + pos = ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor)); + ewl_entry_text_insert(e, text, pos); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** * @param e: then entry to change * @param edit: a boolean value indicating the ability to edit the entry * @return Returns no value. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- ewl_entry.h 26 Oct 2004 14:00:01 -0000 1.45 +++ ewl_entry.h 21 Dec 2004 01:18:11 -0000 1.46 @@ -62,6 +62,7 @@ void ewl_entry_text_prepend(Ewl_Entry * e, char *text); void ewl_entry_text_append(Ewl_Entry * e, char *text); void ewl_entry_text_insert(Ewl_Entry * e, char *text, int index); +void ewl_entry_text_at_cursor_insert(Ewl_Entry * e, char *text); int ewl_entry_length_get(Ewl_Entry *e); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -3 -r1.63 -r1.64 --- ewl_spinner.c 9 Dec 2004 05:26:10 -0000 1.63 +++ ewl_spinner.c 21 Dec 2004 01:18:11 -0000 1.64 @@ -417,7 +417,7 @@ else if (ev->keyname && (isdigit(ev->keyname[0]) || ev->keyname[0] == '.' || ev->keyname[0] == '-')) - ewl_entry_text_append(e, ev->keyname); + ewl_entry_text_at_cursor_insert(e, ev->keyname); DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs