Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin Modified Files: ewl_text_test.c Log Message: - work on ewl_text selection code. There are a few issues with the highlighting of the selections but I'm waiting for textblock2 before I try to work them out. The selections do seem to work, they just might not cover the correct characters in the block =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_text_test.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_text_test.c 23 Jul 2005 03:11:37 -0000 1.4 +++ ewl_text_test.c 15 Aug 2005 21:55:08 -0000 1.5 @@ -26,12 +26,6 @@ ewl_text_cursor_position_set(EWL_TEXT(t->parent), t->pos); ewl_text_color_apply(EWL_TEXT(t->parent), 255, 0, 0, 255, t->len); - -#if 0 - printf("DUMP\n"); - ewl_text_btree_dump((EWL_TEXT(t->parent))->formatting, ""); - printf("DUMP DONE\n"); -#endif } static void @@ -45,6 +39,25 @@ ewl_text_color_apply(EWL_TEXT(t->parent), 0, 0, 0, 255, t->len); } +static void +__key_press(Ewl_Widget *w __UNUSED__, void *ev, void *data __UNUSED__) +{ + Ewl_Event_Key_Up *event; + + event = ev; + if (!strcmp(event->keyname, "s")) + { + Ewl_Widget *t; + char *c; + + t = ewl_widget_name_find("text"); + c = ewl_text_selection_get(EWL_TEXT(t)); + + printf("Selection: (%s)\n", c); + FREE(c); + } +} + void __create_text_test_window(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__) @@ -73,7 +86,10 @@ __close_main_window, NULL); ewl_widget_show(win); + ewl_callback_append(win, EWL_CALLBACK_KEY_UP, __key_press, NULL); + o = ewl_text_new(NULL); + ewl_widget_name_set(o, "text"); ewl_container_child_append(EWL_CONTAINER(win), o); ewl_text_bg_color_set(EWL_TEXT(o), 50, 50, 50, 255); @@ -126,6 +142,8 @@ ewl_text_text_append(EWL_TEXT(o), "And in red\n"); /* 11 */ ewl_text_color_set(EWL_TEXT(o), 0, 0, 0, 255); + ewl_text_text_append(EWL_TEXT(o), "Once more with feeling. "); + trigger = ewl_text_trigger_new(EWL_TEXT_TRIGGER_TYPE_TRIGGER); ewl_text_trigger_start_pos_set(trigger, ewl_text_length_get(EWL_TEXT(o))); ewl_text_text_append(EWL_TEXT(o), "This is the multi\n\nline link."); /* 28 */ ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs