Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/test


Modified Files:
        ewl_imenu_test.c ewl_simple_test.c ewl_textarea_test.c 
        ewl_tree_test.c 


Log Message:
Some further work on the entry and some of the test apps.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_imenu_test.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewl_imenu_test.c    23 Aug 2004 01:17:30 -0000      1.17
+++ ewl_imenu_test.c    26 Oct 2004 14:00:01 -0000      1.18
@@ -78,8 +78,6 @@
        imenu1 = ewl_imenu_new(NULL, "test menu");
        ewl_object_fill_policy_set(EWL_OBJECT(imenu1), EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(imenu_box), imenu1);
-       ewl_callback_append(imenu1, EWL_CALLBACK_CONFIGURE,
-                           __imenu_configure, NULL);
        ewl_widget_show(imenu1);
 
        /*
@@ -88,6 +86,8 @@
        item = ewl_menu_item_new("/usr/share/pixmaps/dia-diagram.png", "dia");
        ewl_container_child_append(EWL_CONTAINER(imenu1), item);
        ewl_callback_append(item, EWL_CALLBACK_SELECT, __imenu_select, NULL);
+       ewl_callback_append(item, EWL_CALLBACK_CONFIGURE,
+                           __imenu_configure, NULL);
        ewl_widget_show(item);
 
        item = ewl_menu_separator_new();
@@ -109,8 +109,6 @@
         */
        imenu2 = ewl_imenu_new(NULL, "Sub menu");
        ewl_container_child_append(EWL_CONTAINER(imenu1), imenu2);
-       ewl_callback_append(imenu2, EWL_CALLBACK_CONFIGURE,
-                           __imenu_configure, NULL);
        ewl_widget_show(imenu2);
 
        item = ewl_menu_item_new(NULL, "button");
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_simple_test.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- ewl_simple_test.c   23 Aug 2004 01:17:30 -0000      1.13
+++ ewl_simple_test.c   26 Oct 2004 14:00:01 -0000      1.14
@@ -119,6 +119,33 @@
     source = NULL;
 }
 
+void
+edje_text(void *data, Evas_Object *obj, const char *emission,
+              const char *source)
+{
+        char *text;
+        Ewl_Widget *label = data;
+
+       printf("In %s, %s\n", emission, source);
+
+       if (strstr(emission, "Present") != emission)
+               return;
+
+       text = (char *)emission + strlen("Present");
+
+        ewl_text_align_set(EWL_TEXT(label), EWL_FLAG_ALIGN_LEFT);
+        ewl_text_font_set(EWL_TEXT(label), "Vera", 12);
+        ewl_text_style_set(EWL_TEXT(label), "soft_shadow");
+        ewl_text_text_set(EWL_TEXT(label), (char *)source);
+
+        ewl_text_style_set(EWL_TEXT(label), "none");
+        ewl_text_font_set(EWL_TEXT(label), "Vera", 7);
+        ewl_text_text_append(EWL_TEXT(label), text);
+    
+       return;
+       obj = NULL;
+}
+
 void start_text(Ewl_Widget *w, void *ev_data, void *user_data)
 {
        Ewl_Widget *label = user_data;
@@ -143,17 +170,11 @@
 
 void realize_logo_cb(Ewl_Widget *w, void *ev_data, void *user_data)
 {
-       edje_object_signal_callback_add(w->theme_object, "elicit", "tour",
-                       elicit_text, user_data);
-       edje_object_signal_callback_add(w->theme_object, "entrance", "tour",
-                       entrance_text, user_data);
-       edje_object_signal_callback_add(w->theme_object, "entice", "tour",
-                       entice_text, user_data);
-       edje_object_signal_callback_add(w->theme_object, "evidence", "tour",
-                       evidence_text, user_data);
+       edje_object_signal_callback_add(w->theme_object, "Present*", "*",
+                       edje_text, user_data);
 
-    return;
-    ev_data = NULL;
+       return;
+       ev_data = NULL;
 }
 
 void test_cb(Ewl_Widget *w, void *ev_data, void *user_data)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_textarea_test.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ewl_textarea_test.c 18 Aug 2004 03:15:22 -0000      1.22
+++ ewl_textarea_test.c 26 Oct 2004 14:00:01 -0000      1.23
@@ -1,5 +1,7 @@
 #include "ewl_test.h"
 
+#define FONTSIZE 12
+
 static char    *long_text =
        "This is a long string to test\n"
        "the effectiveness of\n"
@@ -42,17 +44,53 @@
 }
 
 void
+__font_get(Ewl_Widget *w, void *ev_data, void *user_data)
+{
+       int size;
+       Ewl_Widget *spinner = user_data;
+
+       size = ewl_entry_font_size_get(EWL_ENTRY(w));
+       ewl_spinner_value_set(EWL_SPINNER(spinner), (double)(size));
+
+       return;
+       ev_data = NULL;
+}
+
+void
+__font_set(Ewl_Widget *w, void *ev_data, void *user_data)
+{
+       double size;
+       char *font;
+       Ewl_Widget *textarea = user_data;
+
+       font = ewl_entry_font_get(EWL_ENTRY(textarea));
+       size = ewl_spinner_value_get(EWL_SPINNER(w));
+       ewl_entry_font_set(EWL_ENTRY(textarea), font, (int)(size));
+
+       return;
+       ev_data = NULL;
+}
+
+void
 __create_textarea_test_window(Ewl_Widget * w, void *ev_data, void *user_data)
 {
+       Ewl_Widget     *button_box;
        Ewl_Widget     *scrollpane;
+       Ewl_Widget     *spinner;
        Ewl_Widget     *textarea_win;
        Ewl_Widget     *textarea;
+       Ewl_Widget     *tmp;
+       Ewl_Widget     *vbox;
 
        ewl_callback_del(w, EWL_CALLBACK_CLICKED,
                         __create_textarea_test_window);
 
        textarea_button = w;
 
+       /*
+        * Setup a window displaying title and class information, also sets up
+        * callbacks for closing the window and a sane default size.
+        */
        textarea_win = ewl_window_new();
        ewl_window_title_set(EWL_WINDOW(textarea_win), "Textarea Test");
        ewl_window_name_set(EWL_WINDOW(textarea_win), "EWL Test Application");
@@ -63,26 +101,61 @@
                            __destroy_textarea_test_window, NULL);
        ewl_widget_show(textarea_win);
 
+       vbox = ewl_vbox_new();
+       ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_ALL);
+       ewl_box_homogeneous_set(EWL_BOX(vbox), FALSE);
+       ewl_container_child_append(EWL_CONTAINER(textarea_win), vbox);
+       ewl_widget_show(vbox);
+
+       /*
+        * Setup a series of buttons for changing properties on the text.
+        */
+       button_box = ewl_hbox_new();
+       ewl_object_fill_policy_set(EWL_OBJECT(button_box), EWL_FLAG_FILL_NONE);
+       ewl_box_homogeneous_set(EWL_BOX(button_box), FALSE);
+       ewl_container_child_append(EWL_CONTAINER(vbox), button_box);
+       ewl_widget_show(button_box);
+
+       tmp = ewl_text_new("Font size:");
+       ewl_container_child_append(EWL_CONTAINER(button_box), tmp);
+       ewl_object_alignment_set(EWL_OBJECT(tmp), EWL_FLAG_ALIGN_CENTER);
+       ewl_widget_show(tmp);
+
+       spinner= ewl_spinner_new();
+       ewl_container_child_append(EWL_CONTAINER(button_box), spinner);
+       ewl_spinner_min_val_set(EWL_SPINNER(spinner), 1);
+       ewl_spinner_max_val_set(EWL_SPINNER(spinner), 72);
+       ewl_spinner_value_set(EWL_SPINNER(spinner), 12);
+       ewl_spinner_step_set(EWL_SPINNER(spinner), 1);
+       ewl_spinner_digits_set(EWL_SPINNER(spinner), 0);
+       ewl_widget_show(spinner);
+
+       /*
+       tmp = ewl_button_new("Moo");
+       ewl_container_child_append(EWL_CONTAINER(vbox), tmp);
+       ewl_widget_show(tmp);
+       */
+
        /*
         * Create a scrollpane to hold the text.
         */
        scrollpane = ewl_scrollpane_new();
-       ewl_container_child_append(EWL_CONTAINER(textarea_win), scrollpane);
+       ewl_container_child_append(EWL_CONTAINER(vbox), scrollpane);
        ewl_widget_show(scrollpane);
 
        /*
         * Create the textarea to be displayed.
         */
-       textarea = ewl_text_new(long_text);
-       ewl_text_color_set(EWL_TEXT(textarea), 255, 0, 0, 255);
-       ewl_text_text_append(EWL_TEXT(textarea), long_text);
-       ewl_text_color_set(EWL_TEXT(textarea), 0, 255, 0, 255);
-       ewl_text_text_append(EWL_TEXT(textarea), long_text);
-       ewl_text_color_set(EWL_TEXT(textarea), 0, 0, 255, 255);
-       ewl_text_text_prepend(EWL_TEXT(textarea), long_text);
+       textarea = ewl_entry_new(NULL);
        ewl_container_child_append(EWL_CONTAINER(scrollpane), textarea);
+       ewl_object_fill_policy_set(EWL_OBJECT(textarea), EWL_FLAG_FILL_NONE);
+       ewl_callback_append(textarea, EWL_CALLBACK_REALIZE, __font_get,
+                           spinner);
        ewl_widget_show(textarea);
 
+       ewl_callback_append(spinner, EWL_CALLBACK_VALUE_CHANGED, __font_set,
+                           textarea);
+
        return;
        ev_data = NULL;
        user_data = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_tree_test.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- ewl_tree_test.c     18 Aug 2004 03:15:22 -0000      1.16
+++ ewl_tree_test.c     26 Oct 2004 14:00:01 -0000      1.17
@@ -21,6 +21,21 @@
 }
 
 void
+__get_rows(Ewl_Widget * w, void *ev_data, void *user_data)
+{
+       Ecore_List *selected;
+       Ewl_Tree *tree = user_data;
+
+       selected = ewl_tree_selected_get(tree);
+
+       printf("Selected %d rows\n", ecore_list_nodes(selected));
+       return;
+       w = NULL;
+       ev_data = NULL;
+       user_data = NULL;
+}
+
+void
 __create_tree_test_window(Ewl_Widget * w, void *ev_data,
                                void *user_data)
 {
@@ -31,6 +46,9 @@
        Ewl_Widget *tree_win;
        Ewl_Widget *tree;
        Ewl_Widget *prow = NULL;
+       Ewl_Widget *box;
+       Ewl_Widget *hbox;
+       Ewl_Widget *button;
 
        ewl_callback_del(w, EWL_CALLBACK_CLICKED,
                         __create_tree_test_window);
@@ -38,7 +56,7 @@
        tree_button = w;
 
        tree_win = ewl_window_new();
-       ewl_object_fill_policy_set(EWL_OBJECT(tree_win), EWL_FLAG_FILL_SHRINK);
+       ewl_object_fill_policy_set(EWL_OBJECT(tree_win), EWL_FLAG_FILL_ALL);
        ewl_window_title_set(EWL_WINDOW(tree_win), "Tree Test");
        ewl_window_name_set(EWL_WINDOW(tree_win), "EWL Test Application");
        ewl_window_class_set(EWL_WINDOW(tree_win), "EFL Test Application");
@@ -48,13 +66,44 @@
                            __destroy_tree_test_window, NULL);
        ewl_widget_show(tree_win);
 
+       box = ewl_vbox_new();
+       ewl_container_child_append(EWL_CONTAINER(tree_win), box);
+       ewl_box_homogeneous_set(EWL_BOX(box), FALSE);
+       ewl_object_fill_policy_set(EWL_OBJECT(box), EWL_FLAG_FILL_SHRINK);
+       ewl_widget_show(box);
+
+       hbox = ewl_hbox_new();
+       ewl_container_child_append(EWL_CONTAINER(box), hbox);
+       ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_SHRINK |
+                                                   EWL_FLAG_FILL_HFILL);
+       ewl_widget_show(hbox);
+
+       /*
+        * Create the tree first to allow for attaching to button callbacks
+        */
+       tree = ewl_tree_new(COLS);
+
+       /*
+        * Create buttons for retrieving tree info
+        */
+       button = ewl_button_new("Number of selected rows");
+       ewl_container_child_append(EWL_CONTAINER(hbox), button);
+       ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL);
+       ewl_callback_append(button, EWL_CALLBACK_CLICKED, __get_rows, tree);
+       ewl_widget_show(button);
+
+       button = ewl_button_new("Clear selection");
+       ewl_container_child_append(EWL_CONTAINER(hbox), button);
+       ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL);
+       ewl_callback_append(button, EWL_CALLBACK_CLICKED, __get_rows, tree);
+       ewl_widget_show(button);
+
        for (col = 0; col < COLS; col++) {
                snprintf(buf, PATH_MAX, "Column %d", col);
                headers[col] = strdup(buf);
        }
 
-       tree = ewl_tree_new(COLS);
-       ewl_container_child_append(EWL_CONTAINER(tree_win), tree);
+       ewl_container_child_append(EWL_CONTAINER(box), tree);
        ewl_tree_headers_set(EWL_TREE(tree), headers);
        ewl_widget_show(tree);
 
@@ -78,14 +127,6 @@
                        prow = ewl_tree_text_row_add(EWL_TREE(tree),
                                        EWL_ROW(prow), entries);
 
-               /*
-               prow = ewl_entry_new(entries[0]);
-               ewl_container_child_append(EWL_CONTAINER(tree), prow);
-               ewl_widget_show(prow);
-               */
-
-               /* ewl_tree_row_expanded_set(EWL_ROW(prow), TRUE); */
-
                for (col = 0; col < COLS; col++) {
                        IF_FREE(entries[col]);
                }




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to