Merge branch 'intefl/svn_merge' of ssh://165.213.149.219:21922/slp/pkgs/e/elementary...
[framework/uifw/elementary.git] / src / bin / test_conform.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6
7 void
8 test_conformant(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
9 {
10    Evas_Object *win, *bg, *conform, *btn, *bx, *en;
11
12    win = elm_win_add(NULL, "conformant", ELM_WIN_BASIC);
13    elm_win_title_set(win, "Conformant");
14    elm_win_autodel_set(win, EINA_TRUE);
15 <<<<<<< HEAD
16    elm_win_conformant_set(win, 1);
17 =======
18    elm_win_conformant_set(win, EINA_TRUE);
19 >>>>>>> remotes/origin/upstream
20
21    bg = elm_bg_add(win);
22    elm_win_resize_object_add(win, bg);
23    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
24    evas_object_show(bg);
25
26    conform = elm_conformant_add(win);
27    elm_win_resize_object_add(win, conform);
28    evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29    evas_object_show(conform);
30
31    bx = elm_box_add(win);
32    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
34
35    en = elm_entry_add(win);
36    elm_entry_scrollable_set(en, EINA_TRUE);
37 <<<<<<< HEAD
38    elm_entry_single_line_set(en, 1);
39    elm_entry_bounce_set(en, 1, 0);
40 =======
41    elm_entry_single_line_set(en, EINA_TRUE);
42    elm_entry_bounce_set(en, EINA_TRUE, EINA_FALSE);
43 >>>>>>> remotes/origin/upstream
44    elm_object_text_set(en, "This is the top entry here");
45    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
46    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
47    evas_object_show(en);
48    elm_box_pack_end(bx, en);
49
50    btn = elm_button_add(win);
51    elm_object_text_set(btn, "Test Conformant");
52    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
53    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
54    elm_box_pack_end(bx, btn);
55    evas_object_show(btn);
56
57    en = elm_entry_add(win);
58    elm_entry_scrollable_set(en, EINA_TRUE);
59 <<<<<<< HEAD
60    elm_entry_single_line_set(en, 1);
61    elm_entry_bounce_set(en, 1, 0);
62 =======
63    elm_entry_single_line_set(en, EINA_TRUE);
64    elm_entry_bounce_set(en, EINA_TRUE, EINA_FALSE);
65 >>>>>>> remotes/origin/upstream
66    elm_object_text_set(en, "This is the middle entry here");
67    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
68    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
69    evas_object_show(en);
70    elm_box_pack_end(bx, en);
71
72    btn = elm_button_add(win);
73    elm_object_text_set(btn, "Test Conformant");
74    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
75    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
76    elm_box_pack_end(bx, btn);
77    evas_object_show(btn);
78
79    en = elm_entry_add(win);
80    elm_entry_scrollable_set(en, EINA_TRUE);
81 <<<<<<< HEAD
82    elm_entry_bounce_set(en, 0, 1);
83 =======
84    elm_entry_bounce_set(en, EINA_FALSE, EINA_TRUE);
85 >>>>>>> remotes/origin/upstream
86    elm_object_text_set(en,
87                        "This is a multi-line entry at the bottom<br/>"
88                        "This can contain more than 1 line of text and be "
89                        "scrolled around to allow for entering of lots of "
90                        "content. It is also to test to see that autoscroll "
91                        "moves to the right part of a larger multi-line "
92                        "text entry that is inside of a scroller than can be "
93                        "scrolled around, thus changing the expected position "
94                        "as well as cursor changes updating auto-scroll when "
95                        "it is enabled.");
96    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
97    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
98    evas_object_show(en);
99    elm_box_pack_end(bx, en);
100
101    elm_object_content_set(conform, bx);
102    evas_object_show(bx);
103
104    evas_object_resize(win, 240, 240);
105    evas_object_show(win);
106 }
107
108 static void
109 popobj(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
110 {
111 <<<<<<< HEAD
112   elm_pager_content_pop(data);
113 =======
114    elm_naviframe_item_pop(data);
115 >>>>>>> remotes/origin/upstream
116 }
117
118 void
119 test_conformant2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
120 {
121    Evas_Object *win, *bg, *conform, *btn, *bx, *en, *pg;
122
123    win = elm_win_add(NULL, "conformant2", ELM_WIN_BASIC);
124    elm_win_title_set(win, "Conformant 2");
125    elm_win_autodel_set(win, EINA_TRUE);
126 <<<<<<< HEAD
127    elm_win_conformant_set(win, 1);
128 =======
129    elm_win_conformant_set(win, EINA_TRUE);
130 >>>>>>> remotes/origin/upstream
131
132    bg = elm_bg_add(win);
133    elm_win_resize_object_add(win, bg);
134    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
135    evas_object_show(bg);
136
137    bx = elm_box_add(win);
138    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
139    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
140    elm_win_resize_object_add(win, bx);
141    evas_object_show(bx);
142
143    en = elm_entry_add(win);
144    elm_entry_scrollable_set(en, EINA_TRUE);
145 <<<<<<< HEAD
146    elm_entry_single_line_set(en, 1);
147    elm_entry_bounce_set(en, 1, 0);
148 =======
149    elm_entry_single_line_set(en, EINA_TRUE);
150    elm_entry_bounce_set(en, EINA_TRUE, EINA_FALSE);
151 >>>>>>> remotes/origin/upstream
152    elm_object_text_set(en, "This is the top entry here");
153    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
154    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
155    elm_box_pack_end(bx, en);
156    evas_object_show(en);
157
158    btn = elm_button_add(win);
159 <<<<<<< HEAD
160    elm_object_focus_allow_set(btn, 0);
161 =======
162    elm_object_focus_allow_set(btn, EINA_FALSE);
163 >>>>>>> remotes/origin/upstream
164    elm_object_text_set(btn, "Delete Below");
165    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
166    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
167    elm_box_pack_end(bx, btn);
168    evas_object_show(btn);
169
170 <<<<<<< HEAD
171    pg = elm_pager_add(win);
172 =======
173    pg = elm_naviframe_add(win);
174 >>>>>>> remotes/origin/upstream
175    evas_object_size_hint_weight_set(pg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
176    evas_object_size_hint_align_set(pg, EVAS_HINT_FILL, EVAS_HINT_FILL);
177    elm_box_pack_end(bx, pg);
178    evas_object_show(pg);
179
180    evas_object_smart_callback_add(btn, "clicked", popobj, pg);
181
182    conform = elm_conformant_add(win);
183    evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
184    evas_object_size_hint_align_set(conform, EVAS_HINT_FILL, EVAS_HINT_FILL);
185 <<<<<<< HEAD
186    elm_pager_content_push(pg, conform);
187 =======
188    elm_naviframe_item_simple_push(pg, conform);
189 >>>>>>> remotes/origin/upstream
190    evas_object_show(conform);
191
192    bx = elm_box_add(win);
193    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
194    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
195
196    en = elm_entry_add(win);
197    elm_entry_scrollable_set(en, EINA_TRUE);
198 <<<<<<< HEAD
199    elm_entry_bounce_set(en, 0, 1);
200 =======
201    elm_entry_bounce_set(en, EINA_FALSE, EINA_TRUE);
202 >>>>>>> remotes/origin/upstream
203    elm_object_text_set(en, "This entry and button below get deleted.");
204    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
205    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
206    evas_object_show(en);
207    elm_box_pack_end(bx, en);
208
209    btn = elm_button_add(win);
210 <<<<<<< HEAD
211    elm_object_focus_allow_set(btn, 0);
212 =======
213    elm_object_focus_allow_set(btn, EINA_FALSE);
214 >>>>>>> remotes/origin/upstream
215    elm_object_text_set(btn, "Delete this bottom bit 1");
216    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
217    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
218    elm_box_pack_end(bx, btn);
219    evas_object_show(btn);
220
221    evas_object_smart_callback_add(btn, "clicked", popobj, pg);
222
223    elm_object_content_set(conform, bx);
224    evas_object_show(bx);
225
226    conform = elm_conformant_add(win);
227    evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
228    evas_object_size_hint_align_set(conform, EVAS_HINT_FILL, EVAS_HINT_FILL);
229 <<<<<<< HEAD
230    elm_pager_content_push(pg, conform);
231 =======
232    elm_naviframe_item_simple_push(pg, conform);
233 >>>>>>> remotes/origin/upstream
234    evas_object_show(conform);
235
236    bx = elm_box_add(win);
237    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
238    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
239
240    en = elm_entry_add(win);
241    elm_entry_scrollable_set(en, EINA_TRUE);
242 <<<<<<< HEAD
243    elm_entry_bounce_set(en, 0, 1);
244 =======
245    elm_entry_bounce_set(en, EINA_FALSE, EINA_TRUE);
246 >>>>>>> remotes/origin/upstream
247    elm_object_text_set(en, "This entry and button below get deleted.");
248    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
249    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
250    evas_object_show(en);
251    elm_box_pack_end(bx, en);
252
253    btn = elm_button_add(win);
254 <<<<<<< HEAD
255    elm_object_focus_allow_set(btn, 0);
256 =======
257    elm_object_focus_allow_set(btn, EINA_FALSE);
258 >>>>>>> remotes/origin/upstream
259    elm_object_text_set(btn, "Delete this bottom bit 2");
260    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
261    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
262    elm_box_pack_end(bx, btn);
263    evas_object_show(btn);
264
265    evas_object_smart_callback_add(btn, "clicked", popobj, pg);
266
267    elm_object_content_set(conform, bx);
268    evas_object_show(bx);
269
270    evas_object_resize(win, 240, 480);
271    evas_object_show(win);
272 }
273
274 #endif