summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2013-11-25 14:05:17 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2013-11-25 14:06:47 +0900
commit937a77dfd2c36e5fa0baddd9638eafef1d99ed71 (patch)
tree2d11bf93ac4127a30ce272c1cca1a76b1a4665a7 /src
parent65f37f9ce05676bcbc475153c6e1fde6dab32994 (diff)
test_popup.c: added popup example which has a rectangle as its parent.
This shows how the popup and its block event area size are decided.
Diffstat (limited to 'src')
-rw-r--r--src/bin/test_popup.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/bin/test_popup.c b/src/bin/test_popup.c
index 40a026759..4c5de283f 100644
--- a/src/bin/test_popup.c
+++ b/src/bin/test_popup.c
@@ -48,9 +48,10 @@ _restack_popup_close_cb(void *data, Evas_Object *obj EINA_UNUSED,
48} 48}
49 49
50static void 50static void
51_block_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj, 51_block_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
52 void *event_info EINA_UNUSED)
53{ 52{
53 if (data)
54 evas_object_del(data);
54 evas_object_del(obj); 55 evas_object_del(obj);
55} 56}
56 57
@@ -159,6 +160,36 @@ _popup_center_title_text_block_clicked_event_cb(void *data,
159} 160}
160 161
161static void 162static void
163_popup_center_title_text_block_clicked_event_with_parent_cb(void *data,
164 Evas_Object *obj EINA_UNUSED,
165 void *event_info EINA_UNUSED)
166{
167 Evas_Object *bg, *popup;
168
169 bg = elm_bg_add(data);
170 elm_bg_color_set(bg, 255, 0, 0);
171 evas_object_resize(bg, 350, 200);
172 evas_object_move(bg, 100, 100);
173 evas_object_show(bg);
174
175 popup = elm_popup_add(bg);
176 evas_object_smart_callback_add(popup, "block,clicked",
177 _block_clicked_cb, bg);
178
179 // popup text
180 elm_object_text_set(popup, "This Popup has title area and content area. "
181 "Its blocked event region is a small rectangle. "
182 "When clicked on blocked event region, popup gets "
183 "deleted");
184 // popup title
185 elm_object_part_text_set(popup, "title,text", "Title");
186
187 // popup show should be called after adding all the contents and the buttons
188 // of popup to set the focus into popup's contents correctly.
189 evas_object_show(popup);
190}
191
192static void
162_popup_bottom_title_text_3button_cb(void *data, Evas_Object *obj EINA_UNUSED, 193_popup_bottom_title_text_3button_cb(void *data, Evas_Object *obj EINA_UNUSED,
163 void *event_info EINA_UNUSED) 194 void *event_info EINA_UNUSED)
164{ 195{
@@ -529,6 +560,10 @@ test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
529 "popup-center-title + text (block,clicked handling)", 560 "popup-center-title + text (block,clicked handling)",
530 NULL, NULL, 561 NULL, NULL,
531 _popup_center_title_text_block_clicked_event_cb, win); 562 _popup_center_title_text_block_clicked_event_cb, win);
563 elm_list_item_append(list,
564 "popup-center-title + text (block,clicked handling with parent)",
565 NULL, NULL,
566 _popup_center_title_text_block_clicked_event_with_parent_cb, win);
532 elm_list_item_append(list, "popup-bottom-title + text + 3 buttons", NULL, 567 elm_list_item_append(list, "popup-bottom-title + text + 3 buttons", NULL,
533 NULL, _popup_bottom_title_text_3button_cb, win); 568 NULL, _popup_bottom_title_text_3button_cb, win);
534 elm_list_item_append(list, "popup-center-title + content + 3 buttons", NULL, 569 elm_list_item_append(list, "popup-center-title + content + 3 buttons", NULL,