Elementary: Changed homogenous to homogeneous.
[framework/uifw/elementary.git] / src / bin / test_table.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6 void
7 test_table(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *win, *bg, *tb, *bt;
10
11    win = elm_win_add(NULL, "table", ELM_WIN_BASIC);
12    elm_win_title_set(win, "Table");
13    elm_win_autodel_set(win, 1);
14
15    bg = elm_bg_add(win);
16    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
17    elm_win_resize_object_add(win, bg);
18    evas_object_show(bg);
19
20    tb = elm_table_add(win);
21    elm_win_resize_object_add(win, tb);
22    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
23    evas_object_show(tb);
24
25    bt = elm_button_add(win);
26    elm_button_label_set(bt, "Button 1");
27    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
29    elm_table_pack(tb, bt, 0, 0, 1, 1);
30    evas_object_show(bt);
31
32    bt = elm_button_add(win);
33    elm_button_label_set(bt, "Button 2");
34    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
36    elm_table_pack(tb, bt, 1, 0, 1, 1);
37    evas_object_show(bt);
38
39    bt = elm_button_add(win);
40    elm_button_label_set(bt, "Button 3");
41    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
42    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
43    elm_table_pack(tb, bt, 2, 0, 1, 1);
44    evas_object_show(bt);
45
46    bt = elm_button_add(win);
47    elm_button_label_set(bt, "Button 4");
48    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
49    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
50    elm_table_pack(tb, bt, 0, 1, 2, 1);
51    evas_object_show(bt);
52
53    bt = elm_button_add(win);
54    elm_button_label_set(bt, "Button 5");
55    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
56    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
57    elm_table_pack(tb, bt, 2, 1, 1, 3);
58    evas_object_show(bt);
59
60    bt = elm_button_add(win);
61    elm_button_label_set(bt, "Button 6");
62    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
64    elm_table_pack(tb, bt, 0, 2, 2, 2);
65    evas_object_show(bt);
66
67    evas_object_show(win);
68 }
69
70 void
71 test_table2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
72 {
73    Evas_Object *win, *bg, *tb, *bt;
74
75    win = elm_win_add(NULL, "table2", ELM_WIN_BASIC);
76    elm_win_title_set(win, "Table Homogeneous");
77    elm_win_autodel_set(win, 1);
78
79    bg = elm_bg_add(win);
80    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
81    elm_win_resize_object_add(win, bg);
82    evas_object_show(bg);
83
84    tb = elm_table_add(win);
85    elm_table_homogeneous_set(tb, EINA_TRUE);
86    elm_win_resize_object_add(win, tb);
87    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
88    evas_object_show(tb);
89
90    bt = elm_button_add(win);
91    elm_button_label_set(bt, "A");
92    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
93    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
94    elm_table_pack(tb, bt, 1, 1, 2, 2);
95    evas_object_show(bt);
96
97    bt = elm_button_add(win);
98    elm_button_label_set(bt, "Blah blah blah");
99    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
100    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
101    elm_table_pack(tb, bt, 3, 0, 2, 3);
102    evas_object_show(bt);
103
104    bt = elm_button_add(win);
105    elm_button_label_set(bt, "Hallow");
106    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
107    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
108    elm_table_pack(tb, bt, 0, 3, 10, 1);
109    evas_object_show(bt);
110
111    bt = elm_button_add(win);
112    elm_button_label_set(bt, "B");
113    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
114    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
115    elm_table_pack(tb, bt, 2, 5, 2, 1);
116    evas_object_show(bt);
117
118    bt = elm_button_add(win);
119    elm_button_label_set(bt, "C");
120    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
121    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
122    elm_table_pack(tb, bt, 8, 8, 1, 1);
123    evas_object_show(bt);
124
125    bt = elm_button_add(win);
126    elm_button_label_set(bt, "Wide");
127    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
128    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
129    elm_table_pack(tb, bt, 1, 7, 7, 2);
130    evas_object_show(bt);
131
132    evas_object_show(win);
133    evas_object_resize(win, 120, 120);
134 }
135 #endif