summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2014-02-05 08:43:02 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2014-02-05 08:43:02 +0900
commit34de1a4b037f33bb1e350ada8f8724dde0f003d2 (patch)
tree0e19de1b7b154c6438744b74989097f91cb8cf56
parente9da2de218f41ca2644570d21ee5752a4b6729b4 (diff)
widget_option: added 'set focus' widget option to button.
-rw-r--r--src/bin/gui.c7
-rw-r--r--src/bin/gui.h1
-rw-r--r--src/bin/widget_option.c17
3 files changed, 25 insertions, 0 deletions
diff --git a/src/bin/gui.c b/src/bin/gui.c
index 58b194f..5b074c9 100644
--- a/src/bin/gui.c
+++ b/src/bin/gui.c
@@ -199,6 +199,13 @@ gui_preview_create(Evas_Object *parent)
199} 199}
200 200
201void 201void
202gui_preview_focus(void)
203{
204 elm_object_focus_set(gd->preview_obj, EINA_TRUE);
205 printf("%s\n", evas_object_type_get(gd->preview_obj));
206}
207
208void
202gui_panes_clicked_double_cb(void *data EINA_UNUSED, Evas_Object *obj, 209gui_panes_clicked_double_cb(void *data EINA_UNUSED, Evas_Object *obj,
203 void *event_info EINA_UNUSED) 210 void *event_info EINA_UNUSED)
204{ 211{
diff --git a/src/bin/gui.h b/src/bin/gui.h
index e2f7a02..5322f9b 100644
--- a/src/bin/gui.h
+++ b/src/bin/gui.h
@@ -42,6 +42,7 @@ void gui_create(const char *edje_file,
42 42
43void gui_preview_update(void); 43void gui_preview_update(void);
44Evas_Object *gui_preview_create(Evas_Object *parent); 44Evas_Object *gui_preview_create(Evas_Object *parent);
45void gui_preview_focus(void); // Set the focus to the preview object
45Evas_Object *gui_widget_menu_create(Evas_Object *parent); 46Evas_Object *gui_widget_menu_create(Evas_Object *parent);
46 47
47void gui_widget_load(void); 48void gui_widget_load(void);
diff --git a/src/bin/widget_option.c b/src/bin/widget_option.c
index 62cead2..5b08458 100644
--- a/src/bin/widget_option.c
+++ b/src/bin/widget_option.c
@@ -17,6 +17,14 @@ extern Gui_Data *gd;
17 evas_object_show(o); \ 17 evas_object_show(o); \
18 evas_object_smart_callback_add(o, "changed", cb__, NULL); 18 evas_object_smart_callback_add(o, "changed", cb__, NULL);
19 19
20#define WIDGET_OPTION_BUTTON_ADD(text__, cb__) \
21 o = elm_button_add(box); \
22 WEIGHT(o, EVAS_HINT_EXPAND, 0.0); FILL(o); \
23 elm_object_text_set(o, text__); \
24 elm_box_pack_end(box, o); \
25 evas_object_show(o); \
26 evas_object_smart_callback_add(o, "clicked", cb__, NULL);
27
20#define WIDGET_OPTION_RADIO_ADD(text__, value__, cb__) \ 28#define WIDGET_OPTION_RADIO_ADD(text__, value__, cb__) \
21 o = elm_radio_add(box); \ 29 o = elm_radio_add(box); \
22 WEIGHT(o, EVAS_HINT_EXPAND, 0.0); FILL(o); \ 30 WEIGHT(o, EVAS_HINT_EXPAND, 0.0); FILL(o); \
@@ -104,6 +112,13 @@ extern Gui_Data *gd;
104 elm_object_text_set(obj, var__[val__]); \ 112 elm_object_text_set(obj, var__[val__]); \
105 } 113 }
106 114
115#define WIDGET_OPTION_FOCUS_BUTTON_CLICKED_CB(cb__) \
116 static void \
117 cb__(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, \
118 void *event_info EINA_UNUSED) \
119 { \
120 gui_preview_focus(); \
121 }
107 122
108const char *_text_len[] = 123const char *_text_len[] =
109{ 124{
@@ -153,6 +168,7 @@ _widget_option_actionslider_create(Evas_Object *box)
153// button 168// button
154WIDGET_OPTION_CHECK_CHANGED_CB(btn_text, wod->btn_text); 169WIDGET_OPTION_CHECK_CHANGED_CB(btn_text, wod->btn_text);
155WIDGET_OPTION_CHECK_CHANGED_CB(btn_image, wod->btn_image); 170WIDGET_OPTION_CHECK_CHANGED_CB(btn_image, wod->btn_image);
171WIDGET_OPTION_FOCUS_BUTTON_CLICKED_CB(_btn_focus_clicked_cb);
156 172
157static void 173static void
158_widget_option_button_create(Evas_Object *box) 174_widget_option_button_create(Evas_Object *box)
@@ -161,6 +177,7 @@ _widget_option_button_create(Evas_Object *box)
161 177
162 WIDGET_OPTION_CHECK_ADD("Text", wod->btn_text, _btn_text_changed_cb); 178 WIDGET_OPTION_CHECK_ADD("Text", wod->btn_text, _btn_text_changed_cb);
163 WIDGET_OPTION_CHECK_ADD("Image", wod->btn_image, _btn_image_changed_cb); 179 WIDGET_OPTION_CHECK_ADD("Image", wod->btn_image, _btn_image_changed_cb);
180 WIDGET_OPTION_BUTTON_ADD("Set Focus", _btn_focus_clicked_cb);
164} 181}
165 182
166// check 183// check