summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-08 03:26:48 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-08 03:26:48 +0900
commit8f57cfba6282acbe86febfb1733995e531a1734b (patch)
treec3fe98ceea903a29940adad6cabf9369b9ed5e8a /src/bin
parent00e9c9b5541f9246664d76eb8d173b950c040f72 (diff)
test_list: Added more callbacks for a better testing.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test_list.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/bin/test_list.c b/src/bin/test_list.c
index f70704257..a39ac7842 100644
--- a/src/bin/test_list.c
+++ b/src/bin/test_list.c
@@ -1286,19 +1286,17 @@ test_list8_focus_animate_check_changed(void *data, Evas_Object *obj, void *event
1286} 1286}
1287 1287
1288static void 1288static void
1289_item_focused_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 1289_item_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
1290{ 1290{
1291 Elm_Object_Item *it = event_info; 1291 printf("%s: %p\n", (char *)data, event_info);
1292
1293 printf("item,focused: %p\n", it);
1294} 1292}
1295 1293
1296static void 1294static void
1297_item_unfocused_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 1295_list_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
1296 Evas_Object *obj EINA_UNUSED, void *event_info)
1298{ 1297{
1299 Elm_Object_Item *it = event_info; 1298 Evas_Event_Key_Down *ev = event_info;
1300 1299 printf("\n=== Key Down : %s ===\n", ev->keyname);
1301 printf("item,unfocused: %p\n", it);
1302} 1300}
1303 1301
1304void test_list_focus(const char *name, const char *title, Eina_Bool horiz) 1302void test_list_focus(const char *name, const char *title, Eina_Bool horiz)
@@ -1322,10 +1320,17 @@ void test_list_focus(const char *name, const char *title, Eina_Bool horiz)
1322 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1320 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1323 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); 1321 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1324 elm_list_horizontal_set(li, horiz); 1322 elm_list_horizontal_set(li, horiz);
1323 elm_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_ALWAYS);
1325 elm_box_pack_end(bxx, li); 1324 elm_box_pack_end(bxx, li);
1326 evas_object_show(li); 1325 evas_object_show(li);
1327 evas_object_smart_callback_add(li, "item,focused", _item_focused_cb, NULL); 1326 evas_object_smart_callback_add(li, "item,focused", _item_cb, "item,focused");
1328 evas_object_smart_callback_add(li, "item,unfocused", _item_unfocused_cb, NULL); 1327 evas_object_smart_callback_add(li, "item,unfocused", _item_cb, "item,unfocused");
1328 evas_object_smart_callback_add(li, "selected", _item_cb, "selected");
1329 evas_object_smart_callback_add(li, "unselected", _item_cb, "unselected");
1330 evas_object_smart_callback_add(li, "activated", _item_cb, "activated");
1331 evas_object_smart_callback_add(li, "highlighted", _item_cb, "highlighted");
1332 evas_object_smart_callback_add(li, "unhighlighted", _item_cb, "unhighlighted");
1333 evas_object_event_callback_add(li, EVAS_CALLBACK_KEY_DOWN, _list_key_down_cb, NULL);
1329 1334
1330 bx = elm_box_add(win); 1335 bx = elm_box_add(win);
1331 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0); 1336 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0);