2 # include "elementary_config.h"
4 #include <Elementary.h>
5 #ifndef ELM_LIB_QUICKLAUNCH
7 test_table(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *win, *tb, *bt;
11 win = elm_win_util_standard_add("table", "Table");
12 elm_win_autodel_set(win, EINA_TRUE);
14 tb = elm_table_add(win);
15 elm_win_resize_object_add(win, tb);
16 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
19 bt = elm_button_add(win);
20 elm_object_text_set(bt, "Button 1");
21 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
22 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
23 elm_table_pack(tb, bt, 0, 0, 1, 1);
26 bt = elm_button_add(win);
27 elm_object_text_set(bt, "Button 2");
28 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
30 elm_table_pack(tb, bt, 1, 0, 1, 1);
33 bt = elm_button_add(win);
34 elm_object_text_set(bt, "Button 3");
35 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
36 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
37 elm_table_pack(tb, bt, 2, 0, 1, 1);
40 bt = elm_button_add(win);
41 elm_object_text_set(bt, "Button 4");
42 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
43 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
44 elm_table_pack(tb, bt, 0, 1, 2, 1);
47 bt = elm_button_add(win);
48 elm_object_text_set(bt, "Button 5");
49 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
51 elm_table_pack(tb, bt, 2, 1, 1, 2);
54 bt = elm_button_add(win);
55 elm_object_text_set(bt, "Button a");
56 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
57 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
58 elm_table_pack(tb, bt, 0, 2, 2, 1);
61 evas_object_show(win);
65 test_table2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
67 Evas_Object *win, *tb, *bt;
69 win = elm_win_util_standard_add("table2", "Table Homogeneous");
70 elm_win_autodel_set(win, EINA_TRUE);
72 tb = elm_table_add(win);
73 elm_table_homogeneous_set(tb, EINA_TRUE);
74 elm_win_resize_object_add(win, tb);
75 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
78 bt = elm_button_add(win);
79 elm_object_text_set(bt, "A");
80 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
81 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
82 elm_table_pack(tb, bt, 1, 1, 2, 2);
85 bt = elm_button_add(win);
86 elm_object_text_set(bt, "Blah blah blah");
87 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
88 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
89 elm_table_pack(tb, bt, 3, 0, 2, 3);
92 bt = elm_button_add(win);
93 elm_object_text_set(bt, "Hallow");
94 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
95 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
96 elm_table_pack(tb, bt, 0, 3, 10, 1);
99 bt = elm_button_add(win);
100 elm_object_text_set(bt, "B");
101 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
102 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
103 elm_table_pack(tb, bt, 2, 5, 2, 1);
104 evas_object_show(bt);
106 bt = elm_button_add(win);
107 elm_object_text_set(bt, "C");
108 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
109 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
110 elm_table_pack(tb, bt, 8, 8, 1, 1);
111 evas_object_show(bt);
113 bt = elm_button_add(win);
114 elm_object_text_set(bt, "Wide");
115 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
116 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
117 elm_table_pack(tb, bt, 1, 7, 7, 2);
118 evas_object_show(bt);
120 evas_object_show(win);
124 my_tb_ch(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
126 Evas_Object *win = data;
127 Evas_Object *tb = evas_object_data_get(win, "tb");
128 Evas_Object *b2 = evas_object_data_get(win, "b2");
130 elm_table_unpack(tb, b2);
131 elm_table_pack(tb, b2, 1, 0, 1, 2);
135 test_table3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
137 Evas_Object *win, *tb, *bt;
139 win = elm_win_util_standard_add("table3", "Table 3");
140 elm_win_autodel_set(win, EINA_TRUE);
142 tb = elm_table_add(win);
143 elm_win_resize_object_add(win, tb);
144 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
145 evas_object_data_set(win, "tb", tb);
146 evas_object_show(tb);
148 bt = elm_button_add(win);
149 elm_object_text_set(bt, "Button 1");
150 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
151 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
152 elm_table_pack(tb, bt, 0, 0, 1, 1);
153 evas_object_data_set(win, "b1", bt);
154 evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win);
155 evas_object_show(bt);
157 bt = elm_button_add(win);
158 elm_object_text_set(bt, "Button 2");
159 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
160 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
161 elm_table_pack(tb, bt, 1, 0, 1, 1);
162 evas_object_data_set(win, "b2", bt);
163 evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win);
164 evas_object_show(bt);
166 bt = elm_button_add(win);
167 elm_object_text_set(bt, "Button 3");
168 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
169 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
170 elm_table_pack(tb, bt, 0, 1, 1, 1);
171 evas_object_data_set(win, "b3", bt);
172 evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win);
173 evas_object_show(bt);
175 evas_object_show(win);
179 test_table4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
181 Evas_Object *win, *tb, *bt;
183 win = elm_win_util_standard_add("table4", "Table 4");
184 elm_win_autodel_set(win, EINA_TRUE);
186 tb = elm_table_add(win);
187 elm_win_resize_object_add(win, tb);
188 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
189 evas_object_data_set(win, "tb", tb);
190 evas_object_show(tb);
192 bt = elm_button_add(win);
193 elm_object_text_set(bt, "Button 1");
194 evas_object_size_hint_weight_set(bt, 0.25, 0.25);
195 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
196 elm_table_pack(tb, bt, 0, 0, 1, 1);
197 evas_object_data_set(win, "b1", bt);
198 evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win);
199 evas_object_show(bt);
201 bt = elm_button_add(win);
202 elm_object_text_set(bt, "Button 2");
203 evas_object_size_hint_weight_set(bt, 0.75, 0.25);
204 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
205 elm_table_pack(tb, bt, 1, 0, 1, 1);
206 evas_object_data_set(win, "b2", bt);
207 evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win);
208 evas_object_show(bt);
210 bt = elm_button_add(win);
211 elm_object_text_set(bt, "Button 3");
212 evas_object_size_hint_weight_set(bt, 0.25, 0.75);
213 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
214 elm_table_pack(tb, bt, 0, 1, 1, 1);
215 evas_object_data_set(win, "b3", bt);
216 evas_object_smart_callback_add(bt, "clicked", my_tb_ch, win);
217 evas_object_show(bt);
219 evas_object_show(win);
223 test_table5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
225 Evas_Object *win, *tb, *bt;
227 win = elm_win_util_standard_add("table5", "Table 5");
228 elm_win_autodel_set(win, EINA_TRUE);
230 tb = elm_table_add(win);
231 elm_table_homogeneous_set(tb, EINA_TRUE);
232 elm_win_resize_object_add(win, tb);
233 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
234 evas_object_show(tb);
236 bt = elm_button_add(win);
237 elm_object_text_set(bt, "A");
238 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
239 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
240 elm_table_pack(tb, bt, 33, 0, 34, 33);
241 evas_object_show(bt);
243 bt = elm_button_add(win);
244 elm_object_text_set(bt, "B");
245 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
246 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
247 elm_table_pack(tb, bt, 67, 33, 33, 34);
248 evas_object_show(bt);
250 bt = elm_button_add(win);
251 elm_object_text_set(bt, "C");
252 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
253 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
254 elm_table_pack(tb, bt, 33, 67, 34, 33);
255 evas_object_show(bt);
257 bt = elm_button_add(win);
258 elm_object_text_set(bt, "D");
259 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
260 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
261 elm_table_pack(tb, bt, 0, 33, 33, 34);
262 evas_object_show(bt);
264 bt = elm_button_add(win);
265 elm_object_text_set(bt, "X");
266 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
267 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
268 elm_table_pack(tb, bt, 33, 33, 34, 34);
269 evas_object_show(bt);
271 evas_object_show(win);
275 test_table6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
277 Evas_Object *win, *tb, *bt;
279 win = elm_win_util_standard_add("table6", "Table 6");
280 elm_win_autodel_set(win, EINA_TRUE);
282 tb = elm_table_add(win);
283 elm_table_homogeneous_set(tb, EINA_TRUE);
284 elm_win_resize_object_add(win, tb);
285 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
286 evas_object_show(tb);
288 bt = elm_button_add(win);
289 elm_object_text_set(bt, "C");
290 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
291 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
292 elm_table_pack(tb, bt, 1, 1, 2, 2);
293 evas_object_show(bt);
295 bt = elm_button_add(win);
296 elm_object_text_set(bt, "A");
297 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
298 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
299 elm_table_pack(tb, bt, 1, 1, 2, 2);
300 evas_object_show(bt);
302 bt = elm_button_add(win);
303 elm_object_text_set(bt, "Blah blah blah");
304 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
305 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
306 elm_table_pack(tb, bt, 3, 0, 2, 3);
307 evas_object_show(bt);
309 bt = elm_button_add(win);
310 elm_object_text_set(bt, "Hallow");
311 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
312 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
313 elm_table_pack(tb, bt, 0, 3, 10, 1);
314 evas_object_show(bt);
316 bt = elm_button_add(win);
317 elm_object_text_set(bt, "B");
318 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
319 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
320 elm_table_pack(tb, bt, 1, 1, 1, 1);
321 evas_object_show(bt);
323 bt = elm_button_add(win);
324 elm_object_text_set(bt, "Wide");
325 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
326 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
327 elm_table_pack(tb, bt, 1, 7, 7, 2);
328 evas_object_show(bt);
330 evas_object_show(win);
334 test_table7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
336 Evas_Object *win, *tb, *bt;
338 win = elm_win_util_standard_add("table7", "Table 7");
339 elm_win_autodel_set(win, EINA_TRUE);
341 tb = elm_table_add(win);
342 elm_table_padding_set(tb, 10, 20);
343 elm_win_resize_object_add(win, tb);
344 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
345 evas_object_show(tb);
347 bt = elm_button_add(win);
348 elm_object_text_set(bt, "C");
349 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
350 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
351 elm_table_pack(tb, bt, 1, 1, 2, 2);
352 evas_object_show(bt);
354 bt = elm_button_add(win);
355 elm_object_text_set(bt, "A");
356 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
357 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
358 elm_table_pack(tb, bt, 1, 1, 2, 2);
359 evas_object_show(bt);
361 bt = elm_button_add(win);
362 elm_object_text_set(bt, "Blah blah blah");
363 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
364 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
365 elm_table_pack(tb, bt, 3, 0, 2, 3);
366 evas_object_show(bt);
368 bt = elm_button_add(win);
369 elm_object_text_set(bt, "Hallow");
370 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
371 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
372 elm_table_pack(tb, bt, 0, 3, 10, 1);
373 evas_object_show(bt);
375 bt = elm_button_add(win);
376 elm_object_text_set(bt, "B");
377 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
378 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
379 elm_table_pack(tb, bt, 1, 1, 1, 1);
380 evas_object_show(bt);
382 bt = elm_button_add(win);
383 elm_object_text_set(bt, "Wide");
384 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
385 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
386 elm_table_pack(tb, bt, 1, 7, 7, 2);
387 evas_object_show(bt);
389 evas_object_show(win);