summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-09-03 06:21:53 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-09-03 06:21:53 +0900
commitbb5746ccc3ddcf8f8f6964991fdbe8e14a7fb8b9 (patch)
tree382ad8e36002a32d03d43bf206e907e09e2ea581
parent1372bb5fae18d3a96c799efea9efc46812868cac (diff)
widget_option: added actionslider magnet pos set widget option.
-rw-r--r--src/bin/widget.c15
-rw-r--r--src/bin/widget_option.c44
-rw-r--r--src/bin/widget_option.h5
3 files changed, 62 insertions, 2 deletions
diff --git a/src/bin/widget.c b/src/bin/widget.c
index b9ef61c..20008d9 100644
--- a/src/bin/widget.c
+++ b/src/bin/widget.c
@@ -178,13 +178,24 @@ _widget_actionslider_create(Evas_Object *parent, const char *style)
178 EXPAND(as); ALIGN(as, EVAS_HINT_FILL, 0); 178 EXPAND(as); ALIGN(as, EVAS_HINT_FILL, 0);
179 if (style) elm_object_style_set(as, style); 179 if (style) elm_object_style_set(as, style);
180 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT); 180 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
181 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER|
182 ELM_ACTIONSLIDER_RIGHT);
183 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER | 181 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER |
184 ELM_ACTIONSLIDER_RIGHT); 182 ELM_ACTIONSLIDER_RIGHT);
185 elm_object_part_text_set(as, "left", NULL); 183 elm_object_part_text_set(as, "left", NULL);
186 elm_object_part_text_set(as, "center", "Accept"); 184 elm_object_part_text_set(as, "center", "Accept");
187 elm_object_part_text_set(as, "right", "Reject"); 185 elm_object_part_text_set(as, "right", "Reject");
186 if (wod)
187 {
188 int flag = 0;
189 if (wod->actslider_magnet_pos_left) flag += 1;
190 if (wod->actslider_magnet_pos_center) flag += 2;
191 if (wod->actslider_magnet_pos_right) flag += 4;
192 elm_actionslider_magnet_pos_set(as, flag);
193 }
194 else
195 {
196 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER|
197 ELM_ACTIONSLIDER_RIGHT);
198 }
188 evas_object_show(as); 199 evas_object_show(as);
189 200
190 return as; 201 return as;
diff --git a/src/bin/widget_option.c b/src/bin/widget_option.c
index dea7456..fa41ede 100644
--- a/src/bin/widget_option.c
+++ b/src/bin/widget_option.c
@@ -67,6 +67,49 @@ extern Gui_Data *gd;
67 elm_box_pack_end(box, o); \ 67 elm_box_pack_end(box, o); \
68 evas_object_show(o); 68 evas_object_show(o);
69 69
70// actionslider
71static void
72_actionslider_magnet_pos_left_changed_cb(void *data EINA_UNUSED,
73 Evas_Object *obj,
74 void *event_info EINA_UNUSED)
75{
76 wod->actslider_magnet_pos_left = elm_check_state_get(obj);
77 gui_preview_update();
78}
79
80static void
81_actionslider_magnet_pos_center_changed_cb(void *data EINA_UNUSED,
82 Evas_Object *obj,
83 void *event_info EINA_UNUSED)
84{
85 wod->actslider_magnet_pos_center = elm_check_state_get(obj);
86 gui_preview_update();
87}
88
89static void
90_actionslider_magnet_pos_right_changed_cb(void *data EINA_UNUSED,
91 Evas_Object *obj,
92 void *event_info EINA_UNUSED)
93{
94 wod->actslider_magnet_pos_right = elm_check_state_get(obj);
95 gui_preview_update();
96}
97
98static void
99_widget_option_actionslider_create(Evas_Object *box)
100{
101 Evas_Object *o = NULL;
102
103 // magnet pos
104 WIDGET_OPTION_LABEL_ADD(" &lt; Magnet Position &gt; ");
105 WIDGET_OPTION_CHECK_ADD("Left", wod->actslider_magnet_pos_left,
106 _actionslider_magnet_pos_left_changed_cb);
107 WIDGET_OPTION_CHECK_ADD("Center", wod->actslider_magnet_pos_center,
108 _actionslider_magnet_pos_center_changed_cb);
109 WIDGET_OPTION_CHECK_ADD("Right", wod->actslider_magnet_pos_right,
110 _actionslider_magnet_pos_right_changed_cb);
111}
112
70// button 113// button
71static void 114static void
72_btn_text_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, 115_btn_text_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
@@ -704,6 +747,7 @@ widget_option_content_update(Widget_Type type)
704 if (o) evas_object_del(o); 747 if (o) evas_object_del(o);
705 return; 748 return;
706 } 749 }
750 WIDGET_OPTION(actionslider, ETV_ID_ACTIONSLIDER)
707 WIDGET_OPTION(button, ETV_ID_BUTTON) 751 WIDGET_OPTION(button, ETV_ID_BUTTON)
708 WIDGET_OPTION(check, ETV_ID_CHECK) 752 WIDGET_OPTION(check, ETV_ID_CHECK)
709 WIDGET_OPTION(entry, ETV_ID_ENTRY) 753 WIDGET_OPTION(entry, ETV_ID_ENTRY)
diff --git a/src/bin/widget_option.h b/src/bin/widget_option.h
index 37b4e40..edeb2e2 100644
--- a/src/bin/widget_option.h
+++ b/src/bin/widget_option.h
@@ -6,6 +6,11 @@ void widget_option_content_update(Widget_Type type);
6typedef struct _Widget_Option_Data Widget_Option_Data; 6typedef struct _Widget_Option_Data Widget_Option_Data;
7struct _Widget_Option_Data 7struct _Widget_Option_Data
8{ 8{
9 // actionslider
10 Eina_Bool actslider_magnet_pos_left;
11 Eina_Bool actslider_magnet_pos_center;
12 Eina_Bool actslider_magnet_pos_right;
13
9 // button 14 // button
10 Eina_Bool btn_image : 1; 15 Eina_Bool btn_image : 1;
11 Eina_Bool btn_text : 1; 16 Eina_Bool btn_text : 1;