Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/test


Modified Files:
        ewl_spinner_test.c ewl_test.c 


Log Message:
Minor adjustment to row sizing. Reorganized the test program to be easier to
add and remove tests.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_spinner_test.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_spinner_test.c  4 Jun 2003 01:46:44 -0000       1.12
+++ ewl_spinner_test.c  9 Oct 2003 07:32:57 -0000       1.13
@@ -92,6 +92,7 @@
 {
        Ewl_Widget     *spinner_win;
        Ewl_Widget     *spinner_box;
+       Ewl_Widget     *spinner_row;
        Ewl_Widget     *text[4];
        Ewl_Widget     *separator[3];
        int             xx, yy, ww, hh, mw, mh;
@@ -119,12 +120,19 @@
        ewl_widget_show(tmp_win);
        ewl_window_set_borderless(EWL_WINDOW(tmp_win));
 
+       /*
+        * Grab the current coordinates of the window we will manipulate.
+        */
        ewl_object_get_current_geometry(EWL_OBJECT(tmp_win), &xx, &yy, &ww,
                                        &hh);
        ewl_object_get_minimum_size(EWL_OBJECT(tmp_win), &mw, &mh);
 
+       spinner_row = ewl_row_new();
+       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner_row);
+       ewl_widget_show(spinner_row);
+
        text[0] = ewl_text_new("X");
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), text[0]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), text[0]);
        ewl_widget_show(text[0]);
 
        spinner[0] = ewl_spinner_new();
@@ -133,7 +141,7 @@
        ewl_spinner_set_max_val(EWL_SPINNER(spinner[0]), 1280);
        ewl_spinner_set_value(EWL_SPINNER(spinner[0]), (double) (xx));
        ewl_spinner_set_step(EWL_SPINNER(spinner[0]), 1.0);
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[0]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), spinner[0]);
        ewl_callback_append(spinner[0], EWL_CALLBACK_VALUE_CHANGED,
                            __spinner_value_changed, NULL);
        ewl_widget_show(spinner[0]);
@@ -142,8 +150,12 @@
        ewl_container_append_child(EWL_CONTAINER(spinner_box), separator[0]);
        ewl_widget_show(separator[0]);
 
+       spinner_row = ewl_row_new();
+       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner_row);
+       ewl_widget_show(spinner_row);
+
        text[1] = ewl_text_new("Y");
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), text[1]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), text[1]);
        ewl_widget_show(text[1]);
 
        spinner[1] = ewl_spinner_new();
@@ -152,7 +164,7 @@
        ewl_spinner_set_max_val(EWL_SPINNER(spinner[1]), 1024);
        ewl_spinner_set_value(EWL_SPINNER(spinner[1]), (double) (yy));
        ewl_spinner_set_step(EWL_SPINNER(spinner[1]), 1.0);
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[1]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), spinner[1]);
        ewl_callback_append(spinner[1], EWL_CALLBACK_VALUE_CHANGED,
                            __spinner_value_changed, NULL);
        ewl_widget_show(spinner[1]);
@@ -161,8 +173,12 @@
        ewl_container_append_child(EWL_CONTAINER(spinner_box), separator[1]);
        ewl_widget_show(separator[1]);
 
+       spinner_row = ewl_row_new();
+       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner_row);
+       ewl_widget_show(spinner_row);
+
        text[2] = ewl_text_new("W");
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), text[2]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), text[2]);
        ewl_widget_show(text[2]);
 
        spinner[2] = ewl_spinner_new();
@@ -171,7 +187,7 @@
        ewl_spinner_set_max_val(EWL_SPINNER(spinner[2]), 1280);
        ewl_spinner_set_value(EWL_SPINNER(spinner[2]), (double) (ww));
        ewl_spinner_set_step(EWL_SPINNER(spinner[2]), 1.0);
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[2]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), spinner[2]);
        ewl_callback_append(spinner[2], EWL_CALLBACK_VALUE_CHANGED,
                            __spinner_value_changed, NULL);
        ewl_widget_show(spinner[2]);
@@ -180,8 +196,12 @@
        ewl_container_append_child(EWL_CONTAINER(spinner_box), separator[2]);
        ewl_widget_show(separator[2]);
 
+       spinner_row = ewl_row_new();
+       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner_row);
+       ewl_widget_show(spinner_row);
+
        text[3] = ewl_text_new("H");
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), text[3]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), text[3]);
        ewl_widget_show(text[3]);
 
        spinner[3] = ewl_spinner_new();
@@ -190,7 +210,7 @@
        ewl_spinner_set_max_val(EWL_SPINNER(spinner[3]), 1024);
        ewl_spinner_set_value(EWL_SPINNER(spinner[3]), (double) (hh));
        ewl_spinner_set_step(EWL_SPINNER(spinner[3]), 1.0);
-       ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[3]);
+       ewl_container_append_child(EWL_CONTAINER(spinner_row), spinner[3]);
        ewl_callback_append(spinner[3], EWL_CALLBACK_VALUE_CHANGED,
                            __spinner_value_changed, NULL);
        ewl_widget_show(spinner[3]);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_test.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- ewl_test.c  29 Sep 2003 21:46:51 -0000      1.47
+++ ewl_test.c  9 Oct 2003 07:32:57 -0000       1.48
@@ -3,50 +3,43 @@
 
 #define BUTTONS 18
 
+typedef struct _test_set test_set;
+struct _test_set
+{
+       char *name;
+       Ewl_Callback_Function func;
+};
+
 void            __close_main_widow(Ewl_Widget * w, void *ev_data,
                                   void *user_data);
-
 void            __create_box_test_window(Ewl_Widget * w, void *ev_data,
                                         void *user_data);
-
 void            __create_button_test_window(Ewl_Widget * w, void *ev_data,
                                            void *user_data);
-
 void            __create_fileselector_test_window(Ewl_Widget * w, void *ev_data,
                                                  void *user_data);
-
 void            __create_filedialog_test_window(Ewl_Widget * w, void *ev_data,
                                                  void *user_data);
-
 void            __create_floater_test_window(Ewl_Widget * w, void *ev_data,
                                             void *user_data);
-
 void            __create_entry_test_window(Ewl_Widget * w, void *ev_data,
                                           void *user_data);
-
 void            __create_image_test_window(Ewl_Widget * w, void *ev_data,
                                           void *user_data);
-
 void            __create_imenu_test_window(Ewl_Widget * w, void *ev_data,
                                           void *user_data);
-
 void            __create_menu_test_window(Ewl_Widget * w, void *ev_data,
                                           void *user_data);
-
 void            __create_notebook_test_window(Ewl_Widget * w, void *ev_data,
                                              void *user_data);
-
 void            __create_scrollpane_test_window(Ewl_Widget * w, void *ev_data,
                                                void *user_data);
 void            __create_seeker_test_window(Ewl_Widget * w, void *ev_data,
                                              void *user_data);
-
 void            __create_spinner_test_window(Ewl_Widget * w, void *ev_data,
                                             void *user_data);
-
 void            __create_table_test_window(Ewl_Widget * w, void *ev_data,
                                           void *user_data);
-
 void            __create_textarea_test_window(Ewl_Widget * w, void *ev_data,
                                              void *user_data);
 void            __create_tree_test_window(Ewl_Widget * w, void *ev_data,
@@ -54,7 +47,6 @@
 void            __create_selectionbook_test_window(Ewl_Widget * w,
                                                   void *ev_data,
                                                   void *user_data);
-
 void            __create_selectionbar_test_window(Ewl_Widget * w,
                                                   void *ev_data,
                                                   void *user_data);
@@ -81,19 +73,26 @@
        Ewl_Widget     *main_win;
        Ewl_Widget     *main_box;
        Ewl_Widget     *button[BUTTONS];
+       static test_set       tests[] = {
+               { "Box", __create_box_test_window },
+               { "Button", __create_button_test_window },
+               { "Entry", __create_entry_test_window },
+               { "Floater", __create_floater_test_window },
+               { "Image", __create_image_test_window },
+               { "Spinner", __create_spinner_test_window },
+               { "Textarea", __create_textarea_test_window },
+               { 0, 0 }
+       };
 
        ewl_init(argc, argv);
 
        main_win = ewl_window_new();
-       ewl_object_set_minimum_size(EWL_OBJECT(main_win), 200, 100);
        ewl_window_set_title(EWL_WINDOW(main_win),
-                            "The Enlightenment Widget Library Developer Test 
Program");
+                            "The Enlightenment Widget Library");
        ewl_callback_append(main_win, EWL_CALLBACK_DELETE_WINDOW,
                            __close_main_window, NULL);
        ewl_widget_show(main_win);
 
-       i = 0;
-
        /*
         * Create the main box for holding the button widgets
         */
@@ -102,160 +101,27 @@
        ewl_box_set_spacing(EWL_BOX(main_box), 6);
        ewl_widget_show(main_box);
 
-       /*
-        * Create the button for the box test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Box");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_box_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the button test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Button");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_button_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the text entry test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Entry");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_entry_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the image test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Image");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_image_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the fileselector test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_FileSelector");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_fileselector_test_window, NULL);
-       i++;
-
-
-       /*
-        * Create the button for the fileselector test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_FileDialog");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_filedialog_test_window, NULL);
-       i++;
-
-       
-       /*
-        * Create the button for the floater test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Floater");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_floater_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the imenu test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_IMenu");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_imenu_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the menu test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Menu");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_menu_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the list test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_List");
-       /*
-        * ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-        * __create_list_test_window, NULL);
-        */
-       ewl_widget_disable(button[i]);
-       i++;
-
-       /*
-        * Create the button for the notepad test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Notebook");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_notebook_test_window, NULL);
-       i++;
-
-       button[i] = ewl_button_new("Ewl_Seeker");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                       __create_seeker_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the selectionbook test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Selectionbook");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_selectionbook_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the selectionbook test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Selectionbar");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_selectionbar_test_window, NULL);
-       i++;
-
-       
-       /*
-        * Create the button for the spinner test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Spinner");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_spinner_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the table test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Table");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_table_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the text area test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_TextArea");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_textarea_test_window, NULL);
-       i++;
-
-       /*
-        * Create the button for the text area test and add it to the box.
-        */
-       button[i] = ewl_button_new("Ewl_Tree");
-       ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
-                           __create_tree_test_window, NULL);
-       i++;
+       i = 0;
+       while (tests[i].func) {
 
-       for (i = 0; i < BUTTONS; i++) {
+               /*
+                * Create the widget and it's test start from the array
+                */
+               button[i] = ewl_button_new(tests[i].name);
+               ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
+                                   tests[i].func, NULL);
+
+               /*
+                * Add the button to the box, and setup it's alignment and
+                * fill.
+                */
                ewl_container_append_child(EWL_CONTAINER(main_box), button[i]);
                ewl_object_set_fill_policy(EWL_OBJECT(button[i]),
                                           EWL_FLAG_FILL_NONE);
                ewl_object_set_alignment(EWL_OBJECT(button[i]),
                                         EWL_FLAG_ALIGN_CENTER);
                ewl_widget_show(button[i]);
+               i++;
        }
 
        ewl_main();




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to