summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorAmitesh Singh <singh.amitesh@gmail.com>2013-11-13 20:32:31 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-11-13 20:39:48 +0900
commitcf61678ea3a4dcc78fc0b86af6f118969dd4ed10 (patch)
tree8dea4ebf26151f1f5012f118a771bb208f549ec1 /src/bin
parent5101cb93f8e83135f9446a7f6047424881db7d5f (diff)
[hoversel] - Added focus support on hoversel items.
Summary: Focus support on hoversel items. Test Plan: elementary_test->hoversel2 Reviewers: seoz, raster, Hermet CC: nirajkr Differential Revision: https://phab.enlightenment.org/D316
Diffstat (limited to 'src/bin')
-rwxr-xr-xsrc/bin/test.c2
-rw-r--r--src/bin/test_hoversel.c62
2 files changed, 64 insertions, 0 deletions
diff --git a/src/bin/test.c b/src/bin/test.c
index 6a54dad8a..174024646 100755
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -71,6 +71,7 @@ void test_toolbar7(void *data, Evas_Object *obj, void *event_info);
71void test_toolbar8(void *data, Evas_Object *obj, void *event_info); 71void test_toolbar8(void *data, Evas_Object *obj, void *event_info);
72void test_toolbar_vertical(void *data, Evas_Object *obj, void *event_info); 72void test_toolbar_vertical(void *data, Evas_Object *obj, void *event_info);
73void test_hoversel(void *data, Evas_Object *obj, void *event_info); 73void test_hoversel(void *data, Evas_Object *obj, void *event_info);
74void test_hoversel_focus(void *data, Evas_Object *obj, void *event_info);
74void test_list(void *data, Evas_Object *obj, void *event_info); 75void test_list(void *data, Evas_Object *obj, void *event_info);
75void test_list_horizontal(void *data, Evas_Object *obj, void *event_info); 76void test_list_horizontal(void *data, Evas_Object *obj, void *event_info);
76void test_list2(void *data, Evas_Object *obj, void *event_info); 77void test_list2(void *data, Evas_Object *obj, void *event_info);
@@ -710,6 +711,7 @@ add_tests:
710 ADD_TEST(NULL, "Selectors", "ColorSelector", test_colorselector); 711 ADD_TEST(NULL, "Selectors", "ColorSelector", test_colorselector);
711 ADD_TEST(NULL, "Selectors", "SegmentControl", test_segment_control); 712 ADD_TEST(NULL, "Selectors", "SegmentControl", test_segment_control);
712 ADD_TEST(NULL, "Selectors", "Hoversel", test_hoversel); 713 ADD_TEST(NULL, "Selectors", "Hoversel", test_hoversel);
714 ADD_TEST(NULL, "Selectors", "Hoversel Focus", test_hoversel_focus);
713 ADD_TEST(NULL, "Selectors", "Radio", test_radio); 715 ADD_TEST(NULL, "Selectors", "Radio", test_radio);
714 ADD_TEST(NULL, "Selectors", "FlipSelector", test_flipselector); 716 ADD_TEST(NULL, "Selectors", "FlipSelector", test_flipselector);
715 ADD_TEST(NULL, "Selectors", "DaySelector", test_dayselector); 717 ADD_TEST(NULL, "Selectors", "DaySelector", test_dayselector);
diff --git a/src/bin/test_hoversel.c b/src/bin/test_hoversel.c
index e0417d348..25b3de094 100644
--- a/src/bin/test_hoversel.c
+++ b/src/bin/test_hoversel.c
@@ -240,3 +240,65 @@ test_hoversel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
240 240
241 evas_object_show(win); 241 evas_object_show(win);
242} 242}
243
244void
245test_hoversel_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
246{
247 Evas_Object *win, *bx, *hoversel;
248
249 win = elm_win_util_standard_add("hoversel focus", "Hoversel Focus");
250 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
251 elm_win_focus_highlight_animate_set(win, EINA_TRUE);
252 elm_win_autodel_set(win, EINA_TRUE);
253
254 bx = elm_box_add(win);
255 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
256 elm_win_resize_object_add(win, bx);
257 evas_object_show(bx);
258
259 hoversel = elm_hoversel_add(win);
260 elm_hoversel_hover_parent_set(hoversel, win);
261 elm_object_text_set(hoversel, "Vertical");
262 elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL);
263 elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL);
264 elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL);
265 elm_hoversel_item_add(hoversel, "Item 4 - Long Label Here", "close", ELM_ICON_STANDARD, NULL, NULL);
266 evas_object_smart_callback_add(hoversel, "clicked",
267 _hoversel_clicked_cb, NULL);
268 evas_object_smart_callback_add(hoversel, "selected",
269 _hoversel_selected_cb, NULL);
270 evas_object_smart_callback_add(hoversel, "dismissed",
271 _hoversel_dismissed_cb, NULL);
272 elm_box_pack_end(bx, hoversel);
273 evas_object_show(hoversel);
274
275 hoversel = elm_hoversel_add(win);
276 elm_hoversel_horizontal_set(hoversel, EINA_TRUE);
277 elm_hoversel_hover_parent_set(hoversel, win);
278 elm_object_text_set(hoversel, "Horizontal");
279 elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL);
280 elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL);
281 elm_hoversel_item_add(hoversel, "Item 3", "home", ELM_ICON_STANDARD, NULL,
282 NULL);
283 elm_hoversel_item_add(hoversel, "Item 4", "close", ELM_ICON_STANDARD, NULL,
284 NULL);
285 elm_box_pack_end(bx, hoversel);
286 evas_object_show(hoversel);
287
288 hoversel = elm_hoversel_add(win);
289 elm_hoversel_hover_parent_set(hoversel, win);
290 elm_object_text_set(hoversel, "Icons");
291 elm_hoversel_item_add(hoversel, "Item 1", "apps", ELM_ICON_STANDARD, NULL,
292 NULL);
293 elm_hoversel_item_add(hoversel, "Item 2", "arrow_down", ELM_ICON_STANDARD,
294 NULL, NULL);
295 elm_hoversel_item_add(hoversel, "Item 3", "home", ELM_ICON_STANDARD, NULL,
296 NULL);
297 elm_hoversel_item_add(hoversel, "Item 4", "close", ELM_ICON_STANDARD, NULL,
298 NULL);
299 elm_box_pack_end(bx, hoversel);
300 evas_object_show(hoversel);
301
302 evas_object_resize(win, 320, 500);
303 evas_object_show(win);
304}