Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests Modified Files: ewl_text_editor.c Log Message: - add tooltips - move styles to other side, add style label =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/ewl_text_editor.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_text_editor.c 11 Sep 2006 04:21:42 -0000 1.14 +++ ewl_text_editor.c 11 Sep 2006 04:36:03 -0000 1.15 @@ -82,15 +82,16 @@ struct { char *icon; + char *tooltip; void (*cb)(Ewl_Widget *w, void *ev, void *data); - } align[] = { - {EWL_ICON_FORMAT_JUSTIFY_LEFT, ete_cb_justify_left}, - {EWL_ICON_FORMAT_JUSTIFY_CENTER, ete_cb_justify_center}, - {EWL_ICON_FORMAT_JUSTIFY_RIGHT, ete_cb_justify_right}, - {EWL_ICON_FORMAT_TEXT_BOLD, ete_cb_bold}, - {EWL_ICON_FORMAT_TEXT_ITALIC, ete_cb_italic}, - {EWL_ICON_FORMAT_TEXT_UNDERLINE, ete_cb_underline}, - {EWL_ICON_FORMAT_TEXT_STRIKETHROUGH, ete_cb_strikethrough}, + } format[] = { + {EWL_ICON_FORMAT_JUSTIFY_LEFT, "Left align", ete_cb_justify_left}, + {EWL_ICON_FORMAT_JUSTIFY_CENTER, "Center", ete_cb_justify_center}, + {EWL_ICON_FORMAT_JUSTIFY_RIGHT, "Right align", ete_cb_justify_right}, + {EWL_ICON_FORMAT_TEXT_BOLD, "Bold", ete_cb_bold}, + {EWL_ICON_FORMAT_TEXT_ITALIC, "Italic", ete_cb_italic}, + {EWL_ICON_FORMAT_TEXT_UNDERLINE, "Underline", ete_cb_underline}, + {EWL_ICON_FORMAT_TEXT_STRIKETHROUGH, "Strikethrough", ete_cb_strikethrough}, {NULL, NULL} }; @@ -102,27 +103,16 @@ ecore_list_append(styles, "Glow"); ecore_list_append(styles, "Outline"); - model = ewl_model_ecore_list_get(); - view = ewl_label_view_get(); - o = ewl_combo_new(); - ewl_combo_model_set(EWL_COMBO(o), model); - ewl_combo_view_set(EWL_COMBO(o), view); - ewl_combo_data_set(EWL_COMBO(o), styles); - ewl_combo_selected_set(EWL_COMBO(o), 0); - ewl_container_child_append(EWL_CONTAINER(hbox), o); - ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, - ete_cb_styles_changed, NULL); - ewl_widget_show(o); - - for (i = 0; align[i].icon != NULL; i++) + for (i = 0; format[i].icon != NULL; i++) { o = ewl_button_new(); ewl_button_image_set(EWL_BUTTON(o), - ewl_icon_theme_icon_path_get(align[i].icon, EWL_ICON_SIZE_SMALL), - align[i].icon); + ewl_icon_theme_icon_path_get(format[i].icon, EWL_ICON_SIZE_SMALL), + format[i].icon); ewl_container_child_append(EWL_CONTAINER(hbox), o); ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK); - ewl_callback_append(o, EWL_CALLBACK_CLICKED, align[i].cb, NULL); + ewl_callback_append(o, EWL_CALLBACK_CLICKED, format[i].cb, NULL); + ewl_attach_tooltip_text_set(o, format[i].tooltip); ewl_widget_show(o); } @@ -134,7 +124,26 @@ ewl_container_child_append(EWL_CONTAINER(hbox), o); ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE); ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT); - ewl_label_text_set(EWL_LABEL(o), "Font size"); + ewl_label_text_set(EWL_LABEL(o), "Font Style"); + ewl_widget_show(o); + + model = ewl_model_ecore_list_get(); + view = ewl_label_view_get(); + o = ewl_combo_new(); + ewl_combo_model_set(EWL_COMBO(o), model); + ewl_combo_view_set(EWL_COMBO(o), view); + ewl_combo_data_set(EWL_COMBO(o), styles); + ewl_combo_selected_set(EWL_COMBO(o), 0); + ewl_container_child_append(EWL_CONTAINER(hbox), o); + ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, + ete_cb_styles_changed, NULL); + ewl_widget_show(o); + + o = ewl_label_new(); + ewl_container_child_append(EWL_CONTAINER(hbox), o); + ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE); + ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT); + ewl_label_text_set(EWL_LABEL(o), "Font Size"); ewl_widget_show(o); o = ewl_spinner_new(); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs