aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c74
1 files changed, 73 insertions, 1 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index 0eaefc4788..461cf11ab4 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -24,7 +24,7 @@ static const char *img[9] =
"wood_01.jpg",
};
-static Elm_Gengrid_Item_Class gic;
+static Elm_Gengrid_Item_Class gic, ggic;
static void
_horizontal_grid(void *data, Evas_Object *obj, void *event_info __UNUSED__)
@@ -362,4 +362,76 @@ test_gengrid2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
evas_object_resize(win, 600, 600);
evas_object_show(win);
}
+
+void
+test_gengrid3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *win, *bg, *grid;
+ static Testitem ti[144];
+ int i, n;
+ char buf[PATH_MAX];
+
+ win = elm_win_add(NULL, "gengrid_group", ELM_WIN_BASIC);
+ elm_win_title_set(win, "GenGrid Group");
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ bg = elm_bg_add(win);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bg);
+ evas_object_show(bg);
+
+ grid = elm_gengrid_add(win);
+ elm_gengrid_item_size_set(grid, 150, 150);
+ elm_gengrid_group_item_size_set(grid, 31, 31);
+ //elm_gengrid_horizontal_set(grid, EINA_TRUE);
+ elm_gengrid_horizontal_set(grid, EINA_FALSE);
+ elm_gengrid_multi_select_set(grid, EINA_TRUE);
+ elm_gengrid_reorder_mode_set(grid, EINA_TRUE);
+ evas_object_smart_callback_add(grid, "selected", grid_selected, NULL);
+ evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL);
+ evas_object_smart_callback_add(grid, "longpressed", grid_longpress, NULL);
+ evas_object_smart_callback_add(grid, "moved", grid_moved, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,up", grid_drag_up, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,right", grid_drag_right, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,down", grid_drag_down, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,left", grid_drag_left, NULL);
+ evas_object_smart_callback_add(grid, "drag,stop", grid_drag_stop, NULL);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ gic.item_style = "default";
+ gic.func.label_get = grid_label_get;
+ gic.func.icon_get = grid_icon_get;
+ gic.func.state_get = grid_state_get;
+ gic.func.del = grid_del;
+
+ ggic.item_style = "group_index";
+ ggic.func.label_get = grid_label_get;
+ ggic.func.icon_get = NULL;
+ ggic.func.state_get = NULL;
+ ggic.func.del = NULL;
+
+
+ n = 0;
+ for (i = 0; i < 12 * 12; i++)
+ {
+ snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[n]);
+ n = (n + 1) % 9;
+ ti[i].mode = i;
+ ti[i].path = eina_stringshare_add(buf);
+ if (i == 0 || i == 18 || i == 53 || i == 100)
+ //if (i == 0 || i == 18)
+ ti[i].item = elm_gengrid_item_append(grid, &ggic, &(ti[i]), grid_sel, NULL);
+ else
+ ti[i].item = elm_gengrid_item_append(grid, &gic, &(ti[i]), grid_sel, NULL);
+ if (!(i % 5))
+ elm_gengrid_item_selected_set(ti[i].item, EINA_TRUE);
+ }
+
+ evas_object_show(grid);
+ elm_win_resize_object_add(win, grid);
+
+ evas_object_resize(win, 600, 600);
+ evas_object_show(win);
+}
+
#endif