summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-17 14:08:41 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-07-19 10:55:05 -0700
commit8399f2698bf7e15895229c20df8ea9bce33409e0 (patch)
tree1cac64d2ece75a37c92fa4d0bf12210f7f5c5d00
parent3ba31a1f5c4a5d63c66b7c9f553d1a09305d5eae (diff)
elm_test: add efl.ui.scroller test with big table
same as the simple efl.ui.scroller test but with a 2 column table Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9347
-rw-r--r--src/bin/elementary/test.c2
-rw-r--r--src/bin/elementary/test_ui_scroller.c42
2 files changed, 44 insertions, 0 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index fa8e6825d3..b751d65321 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -184,6 +184,7 @@ void test_scroller7(void *data, Evas_Object *obj, void *event_info);
184void test_scroller_simple(void *data, Evas_Object *obj, void *event_info); 184void test_scroller_simple(void *data, Evas_Object *obj, void *event_info);
185void test_efl_ui_scroller(void *data, Evas_Object *obj, void *event_info); 185void test_efl_ui_scroller(void *data, Evas_Object *obj, void *event_info);
186void test_efl_ui_scroller_simple(void *data, Evas_Object *obj, void *event_info); 186void test_efl_ui_scroller_simple(void *data, Evas_Object *obj, void *event_info);
187void test_efl_ui_scroller_simple2(void *data, Evas_Object *obj, void *event_info);
187void test_spinner(void *data, Evas_Object *obj, void *event_info); 188void test_spinner(void *data, Evas_Object *obj, void *event_info);
188void test_ui_spin(void *data, Evas_Object *obj, void *event_info); 189void test_ui_spin(void *data, Evas_Object *obj, void *event_info);
189void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info); 190void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info);
@@ -1097,6 +1098,7 @@ add_tests:
1097 ADD_TEST(NULL, "Scroller", "Scroller Simple", test_scroller_simple); 1098 ADD_TEST(NULL, "Scroller", "Scroller Simple", test_scroller_simple);
1098 ADD_TEST_EO(NULL, "Scroller", "Efl.Ui.Scroller", test_efl_ui_scroller); 1099 ADD_TEST_EO(NULL, "Scroller", "Efl.Ui.Scroller", test_efl_ui_scroller);
1099 ADD_TEST_EO(NULL, "Scroller", "Efl.Ui.Scroller Simple", test_efl_ui_scroller_simple); 1100 ADD_TEST_EO(NULL, "Scroller", "Efl.Ui.Scroller Simple", test_efl_ui_scroller_simple);
1101 ADD_TEST_EO(NULL, "Scroller", "Efl.Ui.Scroller Simple2", test_efl_ui_scroller_simple2);
1100 1102
1101 //------------------------------// 1103 //------------------------------//
1102 // FIXME: add frame test 1104 // FIXME: add frame test
diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c
index 5b6d4aadd6..f3b6152b2b 100644
--- a/src/bin/elementary/test_ui_scroller.c
+++ b/src/bin/elementary/test_ui_scroller.c
@@ -165,3 +165,45 @@ test_efl_ui_scroller_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED
165 efl_pack(bx, efl_added)); 165 efl_pack(bx, efl_added));
166 } 166 }
167} 167}
168
169void
170test_efl_ui_scroller_simple2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
171{
172 Eo *win, *sc, *tb;
173 int i;
174
175 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
176 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
177 efl_text_set(efl_added, "Efl Ui Scroller Simple2"),
178 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
179 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
180
181 sc = efl_add(EFL_UI_SCROLLER_CLASS, win,
182 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
183 efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_START, _scroll_start_cb, NULL),
184 efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_STOP, _scroll_stop_cb, NULL),
185 efl_content_set(win, efl_added));
186
187 tb = efl_add(EFL_UI_TABLE_CLASS, sc,
188 efl_pack_table_columns_set(efl_added, 2),
189 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0),
190 efl_gfx_hint_align_set(efl_added, 0.5, 0),
191 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
192 efl_content_set(sc, efl_added));
193
194 for (i = 0; i < 1000; i++)
195 {
196 efl_add(EFL_UI_BUTTON_CLASS, tb,
197 efl_text_set(efl_added, "Vertical"),
198 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0),
199 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
200 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL),
201 efl_pack_table(tb, efl_added, 0, i, 1, 1));
202 efl_add(EFL_UI_BUTTON_CLASS, tb,
203 efl_text_set(efl_added, "Horizontal"),
204 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0),
205 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
206 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL),
207 efl_pack_table(tb, efl_added, 1, i, 1, 1));
208 }
209}