summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Kumar Nahak <ak.nahak@samsung.com>2014-05-10 01:09:27 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-10 01:09:27 +0900
commit112584b3822782c4140538f808d129ec7ad2fca2 (patch)
tree3a021c596b2c9d08a2ab2cd03471d05b33516a7a
parent61eb33f25f68e4012b7fdfe496d6ac4740fe1786 (diff)
test_gengrid: Added a checkbox for enable/disable of reorder_mode feature
Summary: reorder mode can be enable/disable by clicking "'Reorder mode enable" checkbox Test Plan: elementary_test->"GenGrid" Reviewers: raster, seoz, nirajkr, singh.amitesh Reviewed By: seoz Differential Revision: https://phab.enlightenment.org/D829
-rw-r--r--src/bin/test_gengrid.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c
index 3beb6dc15..784bfa965 100644
--- a/src/bin/test_gengrid.c
+++ b/src/bin/test_gengrid.c
@@ -283,6 +283,12 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
283} 283}
284 284
285static void 285static void
286reorder_mode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
287{
288 elm_gengrid_reorder_mode_set(data, elm_check_state_get(obj));
289}
290
291static void
286always_select_mode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 292always_select_mode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
287{ 293{
288 if (elm_check_state_get(obj)) 294 if (elm_check_state_get(obj))
@@ -322,7 +328,6 @@ create_gengrid(Evas_Object *obj, int items)
322 elm_gengrid_item_size_set(grid, 328 elm_gengrid_item_size_set(grid,
323 elm_config_scale_get() * 200, 329 elm_config_scale_get() * 200,
324 elm_config_scale_get() * 150); 330 elm_config_scale_get() * 150);
325 elm_gengrid_reorder_mode_set(grid, EINA_TRUE);
326 evas_object_smart_callback_add(grid, "selected", grid_selected, NULL); 331 evas_object_smart_callback_add(grid, "selected", grid_selected, NULL);
327 evas_object_smart_callback_add(grid, "unselected", grid_unselected, NULL); 332 evas_object_smart_callback_add(grid, "unselected", grid_unselected, NULL);
328 evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL); 333 evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL);
@@ -530,6 +535,15 @@ test_gengrid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
530 ck = elm_check_add(win); 535 ck = elm_check_add(win);
531 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); 536 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
532 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL); 537 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
538 elm_object_text_set(ck, "Reorder mode enable");
539 evas_object_smart_callback_add(ck, "changed", reorder_mode_cb,
540 api->grid);
541 elm_box_pack_end(bx, ck);
542 evas_object_show(ck);
543
544 ck = elm_check_add(win);
545 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
546 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
533 elm_object_text_set(ck, "Always Select Mode"); 547 elm_object_text_set(ck, "Always Select Mode");
534 evas_object_smart_callback_add(ck, "changed", always_select_mode_cb, 548 evas_object_smart_callback_add(ck, "changed", always_select_mode_cb,
535 api->grid); 549 api->grid);
@@ -839,7 +853,6 @@ test_gengrid3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
839 elm_config_scale_get() * 31, 853 elm_config_scale_get() * 31,
840 elm_config_scale_get() * 31); 854 elm_config_scale_get() * 31);
841 elm_gengrid_multi_select_set(grid, EINA_TRUE); 855 elm_gengrid_multi_select_set(grid, EINA_TRUE);
842 elm_gengrid_reorder_mode_set(grid, EINA_TRUE);
843 evas_object_smart_callback_add(grid, "selected", grid_selected, NULL); 856 evas_object_smart_callback_add(grid, "selected", grid_selected, NULL);
844 evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL); 857 evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL);
845 evas_object_smart_callback_add(grid, "longpressed", grid_longpress, NULL); 858 evas_object_smart_callback_add(grid, "longpressed", grid_longpress, NULL);