Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests/entry Modified Files: ewl_entry_test.c Log Message: - change tabs to spaces (Ewl uses an 8 space indent now instead of a tab) =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/entry/ewl_entry_test.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_entry_test.c 8 Apr 2008 23:26:26 -0000 1.3 +++ ewl_entry_test.c 6 May 2008 20:09:03 -0000 1.4 @@ -1,4 +1,4 @@ -/* vim: set sw=8 ts=8 sts=8 noexpandtab: */ +/* vim: set sw=8 ts=8 sts=8 expandtab: */ #include "Ewl_Test.h" #include "ewl_test_private.h" #include "ewl_button.h" @@ -15,120 +15,120 @@ void test_info(Ewl_Test *test) { - test->name = "Entry"; - test->tip = "Defines the Ewl_Entry class to allow\n" - "for single line editable text."; - test->filename = __FILE__; - test->func = create_test; - test->type = EWL_TEST_TYPE_SIMPLE; + test->name = "Entry"; + test->tip = "Defines the Ewl_Entry class to allow\n" + "for single line editable text."; + test->filename = __FILE__; + test->func = create_test; + test->type = EWL_TEST_TYPE_SIMPLE; } static void fetch_entry_text(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__, - void *user_data __UNUSED__) + void *user_data __UNUSED__) { - char *s; + char *s; - s = ewl_text_text_get(EWL_TEXT(entry[0])); - if (s) { - printf("First entry covers: %s\n", s); - free(s); - } - - s = ewl_text_text_get(EWL_TEXT(entry[1])); - if (s) { - printf("Second entry covers: %s\n", s); - free(s); - } - - s = ewl_text_text_get(EWL_TEXT(entry[2])); - if (s) { - printf("Third entry covers: %s\n", s); - free(s); - } + s = ewl_text_text_get(EWL_TEXT(entry[0])); + if (s) { + printf("First entry covers: %s\n", s); + free(s); + } + + s = ewl_text_text_get(EWL_TEXT(entry[1])); + if (s) { + printf("Second entry covers: %s\n", s); + free(s); + } + + s = ewl_text_text_get(EWL_TEXT(entry[2])); + if (s) { + printf("Third entry covers: %s\n", s); + free(s); + } } static void set_entry_text(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__, - void *user_data __UNUSED__) + void *user_data __UNUSED__) { - ewl_text_text_set(EWL_TEXT(entry[0]), "Play with me ?"); - ewl_text_clear(EWL_TEXT(entry[1])); - ewl_text_text_set(EWL_TEXT(entry[2]), "Not more than 30 characters"); + ewl_text_text_set(EWL_TEXT(entry[0]), "Play with me ?"); + ewl_text_clear(EWL_TEXT(entry[1])); + ewl_text_text_set(EWL_TEXT(entry[2]), "Not more than 30 characters"); } static int create_test(Ewl_Container *box) { - Ewl_Widget *entry_box; - Ewl_Widget *button_hbox, *o; - Ewl_Widget *button[2]; - - /* - * Create the main box for holding the widgets - */ - entry_box = ewl_vbox_new(); - ewl_container_child_append(EWL_CONTAINER(box), entry_box); - ewl_box_spacing_set(EWL_BOX(entry_box), 10); - ewl_widget_show(entry_box); - - entry[0] = ewl_entry_new(); - ewl_text_text_set(EWL_TEXT(entry[0]), "Play with me ?"); - ewl_entry_multiline_set(EWL_ENTRY(entry[0]), 1); - ewl_object_padding_set(EWL_OBJECT(entry[0]), 5, 5, 5, 0); - ewl_container_child_append(EWL_CONTAINER(entry_box), entry[0]); - ewl_widget_show(entry[0]); - - entry[1] = ewl_entry_new(); - ewl_object_padding_set(EWL_OBJECT(entry[1]), 5, 5, 0, 0); - ewl_container_child_append(EWL_CONTAINER(entry_box), entry[1]); - ewl_widget_show(entry[1]); - - entry[2] = ewl_entry_new(); - ewl_text_text_set(EWL_TEXT(entry[2]), "Not more than 30 characters"); - ewl_text_length_maximum_set(EWL_TEXT(entry[2]), 30); - ewl_object_padding_set(EWL_OBJECT(entry[2]), 5, 5, 0, 0); - ewl_container_child_append(EWL_CONTAINER(entry_box), entry[2]); - ewl_widget_show(entry[2]); - - o = ewl_entry_new(); - ewl_text_text_set(EWL_TEXT(o), "disabled"); - ewl_object_padding_set(EWL_OBJECT(o), 5, 5, 0, 0); - ewl_container_child_append(EWL_CONTAINER(entry_box), o); - ewl_widget_disable(o); - ewl_widget_show(o); - - button_hbox = ewl_hbox_new(); - ewl_object_alignment_set(EWL_OBJECT(button_hbox), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(entry_box), button_hbox); - ewl_box_spacing_set(EWL_BOX(button_hbox), 5); - ewl_widget_show(button_hbox); - - button[0] = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(button[0]), "Fetch text"); - ewl_container_child_append(EWL_CONTAINER(button_hbox), button[0]); - ewl_callback_append(button[0], EWL_CALLBACK_CLICKED, - fetch_entry_text, NULL); - ewl_widget_show(button[0]); - - button[1] = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(button[1]), "Set Text"); - ewl_container_child_append(EWL_CONTAINER(button_hbox), button[1]); - ewl_callback_append(button[1], EWL_CALLBACK_CLICKED, - set_entry_text, NULL); - ewl_widget_show(button[1]); - - o = ewl_label_new(); - ewl_label_text_set(EWL_LABEL(o), "Text insert \"\""); - ewl_container_child_append(EWL_CONTAINER(button_hbox), o); - ewl_widget_show(o); - - o = ewl_text_new(); - ewl_text_text_set(EWL_TEXT(o), ""); - ewl_container_child_append(EWL_CONTAINER(button_hbox), o); - ewl_widget_show(o); + Ewl_Widget *entry_box; + Ewl_Widget *button_hbox, *o; + Ewl_Widget *button[2]; + + /* + * Create the main box for holding the widgets + */ + entry_box = ewl_vbox_new(); + ewl_container_child_append(EWL_CONTAINER(box), entry_box); + ewl_box_spacing_set(EWL_BOX(entry_box), 10); + ewl_widget_show(entry_box); + + entry[0] = ewl_entry_new(); + ewl_text_text_set(EWL_TEXT(entry[0]), "Play with me ?"); + ewl_entry_multiline_set(EWL_ENTRY(entry[0]), 1); + ewl_object_padding_set(EWL_OBJECT(entry[0]), 5, 5, 5, 0); + ewl_container_child_append(EWL_CONTAINER(entry_box), entry[0]); + ewl_widget_show(entry[0]); + + entry[1] = ewl_entry_new(); + ewl_object_padding_set(EWL_OBJECT(entry[1]), 5, 5, 0, 0); + ewl_container_child_append(EWL_CONTAINER(entry_box), entry[1]); + ewl_widget_show(entry[1]); + + entry[2] = ewl_entry_new(); + ewl_text_text_set(EWL_TEXT(entry[2]), "Not more than 30 characters"); + ewl_text_length_maximum_set(EWL_TEXT(entry[2]), 30); + ewl_object_padding_set(EWL_OBJECT(entry[2]), 5, 5, 0, 0); + ewl_container_child_append(EWL_CONTAINER(entry_box), entry[2]); + ewl_widget_show(entry[2]); + + o = ewl_entry_new(); + ewl_text_text_set(EWL_TEXT(o), "disabled"); + ewl_object_padding_set(EWL_OBJECT(o), 5, 5, 0, 0); + ewl_container_child_append(EWL_CONTAINER(entry_box), o); + ewl_widget_disable(o); + ewl_widget_show(o); + + button_hbox = ewl_hbox_new(); + ewl_object_alignment_set(EWL_OBJECT(button_hbox), EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER(entry_box), button_hbox); + ewl_box_spacing_set(EWL_BOX(button_hbox), 5); + ewl_widget_show(button_hbox); + + button[0] = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(button[0]), "Fetch text"); + ewl_container_child_append(EWL_CONTAINER(button_hbox), button[0]); + ewl_callback_append(button[0], EWL_CALLBACK_CLICKED, + fetch_entry_text, NULL); + ewl_widget_show(button[0]); + + button[1] = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(button[1]), "Set Text"); + ewl_container_child_append(EWL_CONTAINER(button_hbox), button[1]); + ewl_callback_append(button[1], EWL_CALLBACK_CLICKED, + set_entry_text, NULL); + ewl_widget_show(button[1]); + + o = ewl_label_new(); + ewl_label_text_set(EWL_LABEL(o), "Text insert \"\""); + ewl_container_child_append(EWL_CONTAINER(button_hbox), o); + ewl_widget_show(o); + + o = ewl_text_new(); + ewl_text_text_set(EWL_TEXT(o), ""); + ewl_container_child_append(EWL_CONTAINER(button_hbox), o); + ewl_widget_show(o); - return 1; + return 1; } ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs