Enlightenment CVS committal

Author  : handyande
Project : e17
Module  : apps/examine

Dir     : e17/apps/examine/src


Modified Files:
        examine.c examine_client.c 


Log Message:
Use checkbuttons for ecore_config booleans
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/examine/src/examine.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- examine.c   26 Sep 2004 12:15:57 -0000      1.25
+++ examine.c   6 Oct 2004 20:34:02 -0000       1.26
@@ -197,6 +197,15 @@
   change->value.ptr = theme;
 }
 
+void
+cb_set_bln(Ewl_Widget * w, void *ev_data, void *user_data)
+{
+  examine_prop   *change;
+
+  change = (examine_prop *) user_data;
+  change->value.val = ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w));
+}
+
 /* UI constructor */
 
 void
@@ -379,6 +388,11 @@
 
       free(search_path);
       ecore_list_destroy(themes);
+    } else if (prop_item->type == PT_BLN) {
+      entries[1] = ewl_checkbutton_new("");
+      ewl_callback_append(entries[1],
+                          EWL_CALLBACK_VALUE_CHANGED, cb_set_bln, prop_item);
+
     } else
       entries[1] = ewl_entry_new("unknown");
     prop_item->w = entries[1];
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/examine/src/examine_client.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- examine_client.c    15 Sep 2004 14:06:18 -0000      1.18
+++ examine_client.c    6 Oct 2004 20:34:02 -0000       1.19
@@ -307,6 +307,8 @@
         } else if (!strcmp(type, "theme")) {
           prop_tmp->type = PT_THM;
           prop_tmp->data = strdup(range);
+        } else if (!strcmp(type, "boolean")) {
+          prop_tmp->type = PT_BLN;
         } else
           prop_tmp->value.ptr = NULL;
 
@@ -340,6 +342,7 @@
 {
   switch (target->type) {
   case PT_INT:
+  case PT_BLN:
     target->value.val = target->oldvalue.val;
     break;
   case PT_FLT:
@@ -368,6 +371,7 @@
 {
   switch (target->type) {
   case PT_INT:
+  case PT_BLN:
     if (target->value.val != target->oldvalue.val) {
       target->oldvalue.val = target->value.val;
       examine_client_set_val(target);
@@ -462,6 +466,12 @@
       ewl_text_text_set(EWL_TEXT(sibling), bugfix);
     }
     break;
+  case PT_BLN:
+    sscanf(ret, "%d", &tmpi);
+    prop->value.val = tmpi ? 1 : 0;
+    prop->oldvalue.val = tmpi;
+    ewl_checkbutton_checked_set(EWL_CHECKBUTTON(prop->w), tmpi);
+    break;
   default:                     /* PT_STR, PT_RGB */
     prop->value.ptr = strdup(ret);
     prop->oldvalue.ptr = strdup(ret);
@@ -479,6 +489,7 @@
 
   switch (target->type) {
   case PT_INT:
+  case PT_BLN:
     valstr = malloc(1000);      /* ### FIXME */
     snprintf(valstr, sizeof(valstr)-1, "%d", target->value.val);
     break;




-------------------------------------------------------
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