summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-23 23:32:43 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-24 00:48:11 +0900
commited32e86fd8fba9893fca48ded43ab83c41a16e2e (patch)
tree6ba2ea11a36535efc1ddfb1009b9fb80c15b2098
parent0a9fe5fb4da5e83551df2dfdee2e90f3fda3facc (diff)
test_genlist: Added focus move policy option to genlist focus test.
And removed unnecessary void * casting.
-rw-r--r--src/bin/test_genlist.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index 7b3385bb2..0736b7bf1 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -3695,7 +3695,7 @@ static void
3695test_genlist_focus_focus_highlight_check_changed(void *data, Evas_Object *obj, 3695test_genlist_focus_focus_highlight_check_changed(void *data, Evas_Object *obj,
3696 void *event_info EINA_UNUSED) 3696 void *event_info EINA_UNUSED)
3697{ 3697{
3698 elm_win_focus_highlight_enabled_set((Evas_Object *)data, 3698 elm_win_focus_highlight_enabled_set(data,
3699 elm_check_state_get(obj)); 3699 elm_check_state_get(obj));
3700} 3700}
3701 3701
@@ -3703,11 +3703,24 @@ static void
3703test_genlist_focus_focus_animate_check_changed(void *data, Evas_Object *obj, 3703test_genlist_focus_focus_animate_check_changed(void *data, Evas_Object *obj,
3704 void *event_info EINA_UNUSED) 3704 void *event_info EINA_UNUSED)
3705{ 3705{
3706 elm_win_focus_highlight_animate_set((Evas_Object *)data, 3706 elm_win_focus_highlight_animate_set(data,
3707 elm_check_state_get(obj)); 3707 elm_check_state_get(obj));
3708} 3708}
3709 3709
3710static void 3710static void
3711_gl_focus_move_policy_changed(void *data EINA_UNUSED,
3712 Evas_Object *obj,
3713 void *event_info EINA_UNUSED)
3714{
3715 int val = elm_radio_value_get(obj);
3716
3717 if (val == 0)
3718 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
3719 else if (val == 1)
3720 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_IN);
3721}
3722
3723static void
3711_gl_focus_item_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) 3724_gl_focus_item_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
3712{ 3725{
3713 printf("%s: %p\n", (char *)data, event_info); 3726 printf("%s: %p\n", (char *)data, event_info);
@@ -3779,6 +3792,7 @@ test_genlist_focus(void *data EINA_UNUSED,
3779{ 3792{
3780 Evas_Object *win, *bx, *bx2, *gl, *btn, *fr; 3793 Evas_Object *win, *bx, *bx2, *gl, *btn, *fr;
3781 Evas_Object *bx_opt, *chk, *bx_btn, *btn_focus, *btn_sel; 3794 Evas_Object *bx_opt, *chk, *bx_btn, *btn_focus, *btn_sel;
3795 Evas_Object *bx_mv, *rd, *rdg;
3782 unsigned lhand, rhand; 3796 unsigned lhand, rhand;
3783 Elm_Object_Item *it = NULL, *it_2 = NULL; 3797 Elm_Object_Item *it = NULL, *it_2 = NULL;
3784 3798
@@ -3925,6 +3939,45 @@ test_genlist_focus(void *data EINA_UNUSED,
3925 elm_box_pack_end(bx_opt, chk); 3939 elm_box_pack_end(bx_opt, chk);
3926 evas_object_show(chk); 3940 evas_object_show(chk);
3927 3941
3942 // Focus Movement Policy
3943 fr = elm_frame_add(bx);
3944 elm_object_text_set(fr, "Focus Movement Policy");
3945 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
3946 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
3947 elm_box_pack_end(bx, fr);
3948 evas_object_show(fr);
3949
3950 bx_mv = elm_box_add(fr);
3951 elm_box_horizontal_set(bx_mv, EINA_TRUE);
3952 elm_object_content_set(fr, bx_mv);
3953 evas_object_show(bx_mv);
3954
3955 rdg = rd = elm_radio_add(bx_mv);
3956 elm_object_text_set(rd, "Focus Move by Click");
3957 elm_radio_state_value_set(rd, 0);
3958 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
3959 evas_object_smart_callback_add(rd, "changed",
3960 _gl_focus_move_policy_changed,
3961 NULL);
3962 elm_box_pack_end(bx_mv, rd);
3963 evas_object_show(rd);
3964
3965 rd = elm_radio_add(bx_mv);
3966 elm_object_text_set(rd, "Focus Move by Mouse-In");
3967 elm_radio_group_add(rd, rdg);
3968 elm_radio_state_value_set(rd, 1);
3969 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
3970 evas_object_smart_callback_add(rd, "changed",
3971 _gl_focus_move_policy_changed,
3972 NULL);
3973 elm_box_pack_end(bx_mv, rd);
3974 evas_object_show(rd);
3975
3976 // Focus/Selection
3977 fr = elm_frame_add(bx);
3978 elm_object_text_set(fr, "Focus/Selection");
3979 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
3980 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
3928 // Focus/Selection 3981 // Focus/Selection
3929 fr = elm_frame_add(bx); 3982 fr = elm_frame_add(bx);
3930 elm_object_text_set(fr, "Focus/Selection"); 3983 elm_object_text_set(fr, "Focus/Selection");