From: raster Date: Wed, 25 May 2011 11:44:10 +0000 (+0000) Subject: add table test case. X-Git-Tag: REL_F_I9200_20110722_1~8^2~50^2~285 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69f2de89b4aef35ea154e4c9f839760267236396;p=framework%2Fuifw%2Felementary.git add table test case. git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@59664 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/test.c b/src/bin/test.c index 4c96bf7..ebeb2e0 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -70,6 +70,7 @@ void test_genlist9(void *data, Evas_Object *obj, void *event_info); void test_genlist10(void *data, Evas_Object *obj, void *event_info); void test_table(void *data, Evas_Object *obj, void *event_info); void test_table2(void *data, Evas_Object *obj, void *event_info); +void test_table3(void *data, Evas_Object *obj, void *event_info); void test_gengrid(void *data, Evas_Object *obj, void *event_info); void test_gengrid2(void *data, Evas_Object *obj, void *event_info); void test_pager(void *data, Evas_Object *obj, void *event_info); @@ -287,6 +288,7 @@ my_win_main(char *autorun) ADD_TEST("Toggles", test_toggle); ADD_TEST("Table", test_table); ADD_TEST("Table Homogeneous", test_table2); + ADD_TEST("Table 3", test_table3); ADD_TEST("Clock", test_clock); ADD_TEST("Clock 2", test_clock2); ADD_TEST("Layout", test_layout); diff --git a/src/bin/test_table.c b/src/bin/test_table.c index 7f28cd3..6f89a11 100644 --- a/src/bin/test_table.c +++ b/src/bin/test_table.c @@ -131,4 +131,66 @@ test_table2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_show(win); } + +static void +my_tb_ch(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *win = data; + Evas_Object *tb = evas_object_data_get(win, "tb"); + Evas_Object *b2 = evas_object_data_get(win, "b2"); + + elm_table_unpack(tb, b2); + elm_table_pack(tb, b2, 1, 0, 1, 2); +} + +void +test_table3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *win, *bg, *tb, *bt; + + win = elm_win_add(NULL, "table3", ELM_WIN_BASIC); + elm_win_title_set(win, "Table 3"); + elm_win_autodel_set(win, 1); + + 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); + + tb = elm_table_add(win); + elm_win_resize_object_add(win, tb); + evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_data_set(win, "tb", tb); + evas_object_show(tb); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Button 1"); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(tb, bt, 0, 0, 1, 1); + evas_object_data_set(win, "b1", bt); + evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Button 2"); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(tb, bt, 1, 0, 1, 1); + evas_object_data_set(win, "b2", bt); + evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Button 3"); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(tb, bt, 0, 1, 1, 1); + evas_object_data_set(win, "b3", bt); + evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win); + evas_object_show(bt); + + evas_object_show(win); +} + #endif