Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/test


Modified Files:
        ewl_filedialog_test.c ewl_media_test.c 


Log Message:
make the filedialog work.
 - this converts back to a Ewl_Box base type. This maybe changing again in
   the future back to a ewl_dialog, but we need to figure out whats
   happening to the dialog
 - all the callbacks are hooked up and should work correctly (tho the sizing
   maybe a bit off, but this should just be fill policy stuff)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_filedialog_test.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ewl_filedialog_test.c       30 Aug 2004 06:28:34 -0000      1.27
+++ ewl_filedialog_test.c       31 Aug 2004 18:31:37 -0000      1.28
@@ -1,10 +1,8 @@
 #include "ewl_test.h"
 
-static Ewl_Widget *fd_button = NULL;
-
-
 void __start_fd (Ewl_Widget *w, void *ev_data, void *user_data);
 void __destroy_fd_window (Ewl_Widget *w, void *ev, void *data);
+void __create_fd_window_response (Ewl_Widget *w, void *ev, void *data);
 
 void
 __destroy_filedialog_test_window(Ewl_Widget * w, void *ev_data,
@@ -12,9 +10,6 @@
 {
        ewl_widget_destroy(w);
 
-       ewl_callback_append(fd_button, EWL_CALLBACK_CLICKED,
-                           __create_filedialog_test_window, NULL);
-
        return;
        ev_data = NULL;
        user_data = NULL;
@@ -24,20 +19,21 @@
 __create_filedialog_test_window(Ewl_Widget * w, void *ev_data,
                                   void *user_data)
 {
-       Ewl_Widget *fd = NULL;
-
-       ewl_callback_del(w, EWL_CALLBACK_CLICKED,
-                        __create_filedialog_test_window);
-
-       fd_button = w;
+       Ewl_Widget *fd = NULL, *win = NULL;
 
-       fd = ewl_filedialog_new();
-       ewl_window_title_set (EWL_WINDOW (fd), "File Dialog");
-       ewl_window_name_set (EWL_WINDOW (fd), "EWL Test Application");
-       ewl_window_class_set (EWL_WINDOW (fd), "EFL Test Application");
-       ewl_object_size_request (EWL_OBJECT (fd), 500, 450);
-       ewl_callback_append (fd, EWL_CALLBACK_DELETE_WINDOW,
+       win = ewl_window_new();
+       ewl_window_title_set (EWL_WINDOW (win), "File Dialog Foo");
+       ewl_window_name_set (EWL_WINDOW (win), "EWL Test Application");
+       ewl_window_class_set (EWL_WINDOW (win), "EFL Test Application");
+       ewl_object_size_request (EWL_OBJECT (win), 500, 450);
+       ewl_callback_append (win, EWL_CALLBACK_DELETE_WINDOW,
                             __destroy_filedialog_test_window, NULL);
+       ewl_widget_show(win);
+
+       fd = ewl_filedialog_new(EWL_FILEDIALOG_TYPE_OPEN);
+       ewl_callback_append (fd, EWL_CALLBACK_VALUE_CHANGED, 
+                           __create_fd_window_response, NULL);
+       ewl_container_child_append(EWL_CONTAINER(win), fd);
        ewl_widget_show(fd);
 
        return;
@@ -47,32 +43,27 @@
 }
 
 void
-__create_fd_window_response (Ewl_Widget *w, int *id, void *data)
+__create_fd_window_response (Ewl_Widget *w, void *ev, void *data)
 {
-  int                response = (int)*id;
+  int *response = (int *)ev;
 
-  switch (response)
+  switch (*response)
     {
-    case EWL_RESPONSE_OK:
+    case EWL_RESPONSE_OPEN:
       {
        printf("file open from test program: %s\n", 
               ewl_filedialog_file_get (EWL_FILEDIALOG (w)));
-
-       ewl_widget_hide(w);
-
        break;
       }
     case EWL_RESPONSE_CANCEL:
       {
-       ewl_widget_hide(w);
-
-       break;
+       printf("Test program says bugger off.\n");
+        break;
       }
     }
 
   return;
 
   w = NULL;
-  id = NULL;
   data = NULL;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_media_test.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- ewl_media_test.c    20 Aug 2004 16:56:01 -0000      1.16
+++ ewl_media_test.c    31 Aug 2004 18:31:37 -0000      1.17
@@ -107,15 +107,21 @@
 }
 
 void open_file_cb(Ewl_Widget *w, void *event, void *data) {
+    int *response = (int *)event;
     char *file = NULL;
 
     ewl_widget_hide(fd_win);
-    file = (char *)event;
+
+    switch (*response) {
+        case EWL_RESPONSE_OPEN:
+            file = ewl_filedialog_file_get(EWL_FILEDIALOG(w));
+            break;
+    }
+
     if (file) 
-       ewl_media_media_set(EWL_MEDIA(video), file);
+        ewl_media_media_set(EWL_MEDIA(video), file);
     
     return;
-    w = NULL;
     data = NULL;
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to