elementary/flipselector - + disable/enable func
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 20 Feb 2012 12:04:29 +0000 (12:04 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 20 Feb 2012 12:04:29 +0000 (12:04 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68155 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

data/themes/widgets/flipselector.edc
src/lib/Elementary.h.in
src/lib/elm_flipselector.c
src/lib/elm_flipselector.h

index a7c8d94..99d9cf1 100644 (file)
@@ -379,6 +379,7 @@ group { name: "elm/flipselector/base/default";
 
       part { name: "arrow_top";
          mouse_events: 0;
+         clip_to: "disclip";
          scale: 1;
          description { state: "default" 0.0;
             min: 15 15;
@@ -395,6 +396,7 @@ group { name: "elm/flipselector/base/default";
       }
       part { name: "arrow_bottom";
          mouse_events: 0;
+         clip_to: "disclip";
          scale: 1;
          description { state: "default" 0.0;
             min: 15 15;
@@ -414,6 +416,7 @@ group { name: "elm/flipselector/base/default";
          type: RECT;
          mouse_events: 0;
          name: "top_clipper";
+         clip_to: "disclip";
          description {
             state: "default" 0.0;
             rel1.to: "t";
@@ -426,6 +429,7 @@ group { name: "elm/flipselector/base/default";
          type: RECT;
          mouse_events: 0;
          name: "bottom_clipper";
+         clip_to: "disclip";
          description {
             state: "default" 0.0;
             rel1.to: "b";
@@ -433,6 +437,35 @@ group { name: "elm/flipselector/base/default";
             visible: 1;
          }
       }
+
+      part {
+         type: RECT;
+         name: "disclip";
+         description {
+            state: "default" 0.0;
+            color: 255 255 255 255;
+         }
+         description {
+            state: "enabled" 0.0;
+            color: 100 100 100 100;
+         }
+      }
+
+      part {
+         type: RECT;
+         name: "event_blocker";
+         description {
+            state: "default" 0.0;
+            color: 0 0 0 0;
+            visible: 0;
+         }
+         description {
+            state: "enabled" 0.0;
+            inherit: "default" 0.0;
+            visible: 1;
+         }
+      }
+
    }
 
    programs {
@@ -487,5 +520,19 @@ group { name: "elm/flipselector/base/default";
          source: "b";
          action: SIGNAL_EMIT "elm,action,down,stop" "";
       }
+      program { name: "disable";
+         signal: "elm,state,disabled";
+         source: "elm";
+         action: STATE_SET "enabled" 0.0;
+         target: "disclip";
+         target: "event_blocker";
+      }
+       program { name: "enable";
+         signal: "elm,state,enabled";
+         source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "disclip";
+         target: "event_blocker";
+       }
    }
 }
index 5a33259..b4ab7cb 100644 (file)
@@ -197,7 +197,7 @@ EAPI extern Elm_Version *elm_version;
 #include <elm_factory.h>  //Done
 #include <elm_finger.h> //Done
 #include <elm_flip.h> //Done. There are many TODOs in flip.c
-#include <elm_flipselector.h>
+#include <elm_flipselector.h> //Done.
 #include <elm_focus.h>
 #include <elm_fonts.h>
 #include <elm_frame.h>
index db4659e..292b7d6 100644 (file)
@@ -7,7 +7,6 @@
 /* TODO: if one ever wants to extend it to receiving generic widgets
    as items, be my guest. in this case, remember to implement the
    items tooltip infra. */
-/* TODO: implement disabled mode -- disable_hook() and stuff. */
 /* TODO: fix default theme image borders for looong strings as item
    labels. */
 /* TODO: set text elipsis on labels if one enforces mininum size on
@@ -177,6 +176,18 @@ _del_hook(Evas_Object *obj)
 }
 
 static void
+_disable_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   if (elm_widget_disabled_get(obj))
+     edje_object_signal_emit(wd->base, "elm,state,disabled", "elm");
+   else
+     edje_object_signal_emit(wd->base, "elm,state,enabled", "elm");
+}
+
+static void
 _theme_hook(Evas_Object *obj)
 {
    Widget_Data *wd;
@@ -630,6 +641,7 @@ elm_flipselector_add(Evas_Object *parent)
    wd->self = obj;
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
+   elm_widget_disable_hook_set(obj, _disable_hook);
 
    elm_widget_can_focus_set(obj, EINA_TRUE);
    elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
index bd2a40e..15cb2c7 100644 (file)
  * Default text parts of the flipselector items that you can use for are:
  * @li "default" - label of the flipselector item
  *
+ * Supported elm_object common APIs.
+ * @li elm_object_disabled_set
+ * @li elm_object_disabled_get
+ *
  * Supported elm_object_item common APIs.
  * @li elm_object_item_text_set
  * @li elm_object_item_part_text_set