elementary/flipselector - + disable/enable func

SVN revision: 68155
This commit is contained in:
ChunEon Park 2012-02-20 12:04:29 +00:00
parent df26dee932
commit c0d05b3525
4 changed files with 65 additions and 2 deletions

View File

@ -379,6 +379,7 @@ group { name: "elm/flipselector/base/default";
part { name: "arrow_top"; part { name: "arrow_top";
mouse_events: 0; mouse_events: 0;
clip_to: "disclip";
scale: 1; scale: 1;
description { state: "default" 0.0; description { state: "default" 0.0;
min: 15 15; min: 15 15;
@ -395,6 +396,7 @@ group { name: "elm/flipselector/base/default";
} }
part { name: "arrow_bottom"; part { name: "arrow_bottom";
mouse_events: 0; mouse_events: 0;
clip_to: "disclip";
scale: 1; scale: 1;
description { state: "default" 0.0; description { state: "default" 0.0;
min: 15 15; min: 15 15;
@ -414,6 +416,7 @@ group { name: "elm/flipselector/base/default";
type: RECT; type: RECT;
mouse_events: 0; mouse_events: 0;
name: "top_clipper"; name: "top_clipper";
clip_to: "disclip";
description { description {
state: "default" 0.0; state: "default" 0.0;
rel1.to: "t"; rel1.to: "t";
@ -426,6 +429,7 @@ group { name: "elm/flipselector/base/default";
type: RECT; type: RECT;
mouse_events: 0; mouse_events: 0;
name: "bottom_clipper"; name: "bottom_clipper";
clip_to: "disclip";
description { description {
state: "default" 0.0; state: "default" 0.0;
rel1.to: "b"; rel1.to: "b";
@ -433,6 +437,35 @@ group { name: "elm/flipselector/base/default";
visible: 1; 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 { programs {
@ -487,5 +520,19 @@ group { name: "elm/flipselector/base/default";
source: "b"; source: "b";
action: SIGNAL_EMIT "elm,action,down,stop" ""; 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";
}
} }
} }

View File

@ -197,7 +197,7 @@ EAPI extern Elm_Version *elm_version;
#include <elm_factory.h> //Done #include <elm_factory.h> //Done
#include <elm_finger.h> //Done #include <elm_finger.h> //Done
#include <elm_flip.h> //Done. There are many TODOs in flip.c #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_focus.h>
#include <elm_fonts.h> #include <elm_fonts.h>
#include <elm_frame.h> #include <elm_frame.h>

View File

@ -7,7 +7,6 @@
/* TODO: if one ever wants to extend it to receiving generic widgets /* TODO: if one ever wants to extend it to receiving generic widgets
as items, be my guest. in this case, remember to implement the as items, be my guest. in this case, remember to implement the
items tooltip infra. */ items tooltip infra. */
/* TODO: implement disabled mode -- disable_hook() and stuff. */
/* TODO: fix default theme image borders for looong strings as item /* TODO: fix default theme image borders for looong strings as item
labels. */ labels. */
/* TODO: set text elipsis on labels if one enforces mininum size on /* TODO: set text elipsis on labels if one enforces mininum size on
@ -176,6 +175,18 @@ _del_hook(Evas_Object *obj)
free(wd); free(wd);
} }
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 static void
_theme_hook(Evas_Object *obj) _theme_hook(Evas_Object *obj)
{ {
@ -630,6 +641,7 @@ elm_flipselector_add(Evas_Object *parent)
wd->self = obj; wd->self = obj;
elm_widget_del_hook_set(obj, _del_hook); elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_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_can_focus_set(obj, EINA_TRUE);
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);

View File

@ -28,6 +28,10 @@
* Default text parts of the flipselector items that you can use for are: * Default text parts of the flipselector items that you can use for are:
* @li "default" - label of the flipselector item * @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. * Supported elm_object_item common APIs.
* @li elm_object_item_text_set * @li elm_object_item_text_set
* @li elm_object_item_part_text_set * @li elm_object_item_part_text_set