diff options
author | Daniel Juyung Seo <seojuyung2@gmail.com> | 2013-09-04 10:02:03 +0900 |
---|---|---|
committer | Daniel Juyung Seo <seojuyung2@gmail.com> | 2013-09-04 10:02:12 +0900 |
commit | a372a1d438f8227852f285cd2e70ac665eba28f8 (patch) | |
tree | 06a9325988deb92e37556670e257e00e3f0697e4 | |
parent | 4ff5d25c406e7352d316289153d712d60ca44da5 (diff) | |
download | elementary-a372a1d438f8227852f285cd2e70ac665eba28f8.tar.gz |
popup: added comments about the popup focus.
-rw-r--r-- | src/bin/test_popup.c | 24 | ||||
-rw-r--r-- | src/lib/elc_popup.h | 5 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/test_popup.c b/src/bin/test_popup.c index ed5c358f1..814e14e94 100644 --- a/src/bin/test_popup.c +++ b/src/bin/test_popup.c @@ -81,6 +81,9 @@ _popup_center_text_cb(void *data, Evas_Object *obj EINA_UNUSED, "timeout value is 3 seconds"); elm_popup_timeout_set(popup, 3.0); evas_object_smart_callback_add(popup, "timeout", _response_cb, popup); + + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -101,6 +104,8 @@ _popup_center_text_1button_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_part_content_set(popup, "button1", btn); evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -125,6 +130,8 @@ _popup_center_title_text_1button_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_part_content_set(popup, "button1", btn); evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -146,6 +153,8 @@ _popup_center_title_text_block_clicked_event_cb(void *data, // popup title elm_object_part_text_set(popup, "title,text", "Title"); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -192,6 +201,8 @@ _popup_bottom_title_text_3button_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_part_content_set(popup, "button3", btn3); evas_object_smart_callback_add(btn3, "clicked", _popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -234,6 +245,8 @@ _popup_center_title_content_3button_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_part_content_set(popup, "button3", btn3); evas_object_smart_callback_add(btn3, "clicked", _popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -280,6 +293,8 @@ _popup_center_title_item_3button_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_part_content_set(popup, "button3", btn3); evas_object_smart_callback_add(btn3, "clicked", _popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -334,6 +349,8 @@ _popup_center_title_text_2button_restack_cb(void *data, Evas_Object *obj EINA_UN evas_object_smart_callback_add(btn2, "clicked", _restack_popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -363,6 +380,8 @@ _popup_center_text_1button_hide_show_cb(void *data, Evas_Object *obj EINA_UNUSED elm_object_part_content_set(g_popup, "button1", btn); evas_object_smart_callback_add(btn, "clicked", _g_popup_response_cb, g_popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(g_popup); } @@ -382,6 +401,9 @@ _popup_transparent_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_text_set(btn, "Close"); elm_object_part_content_set(popup, "button1", btn); evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup); + + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } @@ -415,6 +437,8 @@ _popup_center_title_list_content_1button_cb(void *data, Evas_Object *obj EINA_UN elm_object_part_content_set(popup, "button1", btn); evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup); + // popup show should be called after adding all the contents and the buttons + // of popup to set the focus into popup's contents correctly. evas_object_show(popup); } diff --git a/src/lib/elc_popup.h b/src/lib/elc_popup.h index 8917a3638..4a403cdb5 100644 --- a/src/lib/elc_popup.h +++ b/src/lib/elc_popup.h @@ -63,6 +63,11 @@ * of the action area which is passed by theme based on the number of * buttons currently set to popup. * + * Popup sets the focus to itself when evas_object_show is called on popup. + * To set the focus into popup's contents and buttons automatically, + * evas_object_show on popup should be called after setting all the contents + * and buttons of popup. + * * This widget inherits from the @ref Layout one, so that all the * functions acting on it also work for popup objects (@since 1.8). * |