aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-23 16:53:08 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-23 16:53:08 +0900
commit0306188ecc72d8c9eed241cf50ac660c1b13e87b (patch)
treee4dd088449ca3d4227aea5bd4395da66013abfb2 /legacy/elementary/src/bin/test_gengrid.c
parentlist/genlist/gengrid: Handle on_focus event on focus set only for key (diff)
downloadefl-0306188ecc72d8c9eed241cf50ac660c1b13e87b.tar.gz
test_genlist, test_gengrid: Added more callbacks to genlist/gengrid for a
better testing.
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index f232a52f4c..d939165f5a 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -1308,6 +1308,21 @@ test_gengrid_speed(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
evas_object_show(win);
}
+static void
+_gengrid_focus_item_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ printf("%s: %p\n", (char *)data, event_info);
+}
+
+static void
+_gengrid_focus_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ Evas_Event_Key_Down *ev = event_info;
+ printf("\n=== Key Down : %s ===\n", ev->keyname);
+}
+
void
test_gengrid_focus(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
@@ -1365,6 +1380,14 @@ test_gengrid_focus(void *data EINA_UNUSED,
evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, gengrid);
evas_object_show(gengrid);
+ evas_object_smart_callback_add(gengrid, "item,focused", _gengrid_focus_item_cb, "item,focused");
+ evas_object_smart_callback_add(gengrid, "item,unfocused", _gengrid_focus_item_cb, "item,unfocused");
+ evas_object_smart_callback_add(gengrid, "selected", _gengrid_focus_item_cb, "selected");
+ evas_object_smart_callback_add(gengrid, "unselected", _gengrid_focus_item_cb, "unselected");
+ evas_object_smart_callback_add(gengrid, "activated", _gengrid_focus_item_cb, "activated");
+ evas_object_smart_callback_add(gengrid, "highlighted", _gengrid_focus_item_cb, "highlighted");
+ evas_object_smart_callback_add(gengrid, "unhighlighted", _gengrid_focus_item_cb, "unhighlighted");
+ evas_object_event_callback_add(gengrid, EVAS_CALLBACK_KEY_DOWN, _gengrid_focus_key_down_cb, NULL);
btn = elm_button_add(bx);
elm_object_text_set(btn, "Down");