1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 tb_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
10 snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", elm_app_data_dir_get());
11 elm_photo_file_set(data, buf);
15 tb_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
18 snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", elm_app_data_dir_get());
19 elm_photo_file_set(data, buf);
23 tb_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
26 snprintf(buf, sizeof(buf), "%s/images/wood_01.jpg", elm_app_data_dir_get());
27 elm_photo_file_set(data, buf);
31 tb_3a(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
33 tb_3(data, obj, event_info);
34 elm_toolbar_item_state_set(event_info, elm_toolbar_item_state_next(event_info));
38 tb_3b(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
40 tb_3(data, obj, event_info);
41 elm_toolbar_item_state_unset(event_info);
45 tb_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
48 snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", elm_app_data_dir_get());
49 elm_photo_file_set(data, buf);
53 tb_4a(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
55 elm_toolbar_item_state_set(event_info, elm_toolbar_item_state_prev(event_info));
59 tb_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
61 elm_photo_file_set(data, NULL);
65 test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
67 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
68 Evas_Object *ph1, *ph2, *ph3, *ph4;
69 Elm_Object_Item *tb_it;
70 Elm_Object_Item *menu_it;
73 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
74 elm_win_title_set(win, "Toolbar");
75 elm_win_autodel_set(win, EINA_TRUE);
78 elm_win_resize_object_add(win, bg);
79 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
82 bx = elm_box_add(win);
83 elm_win_resize_object_add(win, bx);
84 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
87 tb = elm_toolbar_add(win);
89 elm_toolbar_homogeneous_set(tb, 0);
90 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
91 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
92 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
94 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
95 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
96 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
97 elm_object_scale_set(tb, 0.9);
98 >>>>>>> remotes/origin/upstream
100 ph1 = elm_photo_add(win);
101 ph2 = elm_photo_add(win);
102 ph3 = elm_photo_add(win);
103 ph4 = elm_photo_add(win);
105 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
106 elm_object_item_disabled_set(tb_it, EINA_TRUE);
107 elm_toolbar_item_priority_set(tb_it, 100);
109 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
110 elm_toolbar_item_priority_set(tb_it, -100);
112 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
113 elm_toolbar_item_priority_set(tb_it, 150);
115 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
116 elm_toolbar_item_priority_set(tb_it, 0);
118 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
119 elm_toolbar_item_priority_set(tb_it, -200);
121 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
123 elm_toolbar_item_menu_set(tb_it, 1);
125 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
126 >>>>>>> remotes/origin/upstream
127 elm_toolbar_item_priority_set(tb_it, -999999);
128 elm_toolbar_menu_parent_set(tb, win);
129 menu = elm_toolbar_item_menu_get(tb_it);
131 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
132 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
133 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
134 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
136 elm_box_pack_end(bx, tb);
137 evas_object_show(tb);
139 tb = elm_table_add(win);
140 //elm_table_homogeneous_set(tb, 1);
141 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
142 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
145 elm_photo_size_set(ph, 40);
146 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
147 elm_photo_file_set(ph, buf);
148 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
149 evas_object_size_hint_align_set(ph, 0.5, 0.5);
150 elm_table_pack(tb, ph, 0, 0, 1, 1);
151 evas_object_show(ph);
154 elm_photo_size_set(ph, 80);
155 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
156 evas_object_size_hint_align_set(ph, 0.5, 0.5);
157 elm_table_pack(tb, ph, 1, 0, 1, 1);
158 evas_object_show(ph);
161 elm_photo_size_set(ph, 20);
162 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
163 elm_photo_file_set(ph, buf);
164 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
165 evas_object_size_hint_align_set(ph, 0.5, 0.5);
166 elm_table_pack(tb, ph, 0, 1, 1, 1);
167 evas_object_show(ph);
170 elm_photo_size_set(ph, 60);
171 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
172 elm_photo_file_set(ph, buf);
173 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
174 evas_object_size_hint_align_set(ph, 0.5, 0.5);
175 elm_table_pack(tb, ph, 1, 1, 1, 1);
176 evas_object_show(ph);
178 elm_box_pack_end(bx, tb);
179 evas_object_show(tb);
181 evas_object_resize(win, 320, 300);
182 evas_object_show(win);
186 test_toolbar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
188 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
189 Evas_Object *ph1, *ph2, *ph3, *ph4;
190 Elm_Object_Item *item;
191 Elm_Object_Item *menu_it;
194 win = elm_win_add(NULL, "toolbar2", ELM_WIN_BASIC);
195 elm_win_title_set(win, "Toolbar 2");
196 elm_win_autodel_set(win, EINA_TRUE);
198 bg = elm_bg_add(win);
199 elm_win_resize_object_add(win, bg);
200 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
201 evas_object_show(bg);
203 bx = elm_box_add(win);
204 elm_win_resize_object_add(win, bx);
205 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
206 evas_object_show(bx);
208 tb = elm_toolbar_add(win);
209 elm_toolbar_homogeneous_set(tb, 0);
210 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_SCROLL);
211 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
212 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
214 ph1 = elm_photo_add(win);
215 ph2 = elm_photo_add(win);
216 ph3 = elm_photo_add(win);
217 ph4 = elm_photo_add(win);
219 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
220 elm_object_item_disabled_set(item, EINA_TRUE);
221 elm_toolbar_item_priority_set(item, -100);
223 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
224 elm_toolbar_item_priority_set(item, 100);
226 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
227 elm_toolbar_item_priority_set(item, -150);
229 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
230 elm_toolbar_item_priority_set(item, -200);
232 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
233 elm_toolbar_item_priority_set(item, 0);
235 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
237 elm_toolbar_item_menu_set(item, 1);
239 elm_toolbar_item_menu_set(item, EINA_TRUE);
240 >>>>>>> remotes/origin/upstream
241 elm_toolbar_item_priority_set(item, -999999);
242 elm_toolbar_menu_parent_set(tb, win);
243 menu = elm_toolbar_item_menu_get(item);
245 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
246 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
247 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
248 elm_menu_item_add(menu, NULL, "edit-delete", "Scroll", tb_5, ph4);
250 elm_box_pack_end(bx, tb);
251 evas_object_show(tb);
253 tb = elm_table_add(win);
254 //elm_table_homogeneous_set(tb, 1);
255 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
256 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
259 elm_photo_size_set(ph, 40);
260 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
261 elm_photo_file_set(ph, buf);
262 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
263 evas_object_size_hint_align_set(ph, 0.5, 0.5);
264 elm_table_pack(tb, ph, 0, 0, 1, 1);
265 evas_object_show(ph);
268 elm_photo_size_set(ph, 80);
269 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
270 evas_object_size_hint_align_set(ph, 0.5, 0.5);
271 elm_table_pack(tb, ph, 1, 0, 1, 1);
272 evas_object_show(ph);
275 elm_photo_size_set(ph, 20);
276 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
277 elm_photo_file_set(ph, buf);
278 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
279 evas_object_size_hint_align_set(ph, 0.5, 0.5);
280 elm_table_pack(tb, ph, 0, 1, 1, 1);
281 evas_object_show(ph);
284 elm_photo_size_set(ph, 60);
285 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
286 elm_photo_file_set(ph, buf);
287 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
288 evas_object_size_hint_align_set(ph, 0.5, 0.5);
289 elm_table_pack(tb, ph, 1, 1, 1, 1);
290 evas_object_show(ph);
292 elm_box_pack_end(bx, tb);
293 evas_object_show(tb);
295 evas_object_resize(win, 320, 300);
296 evas_object_show(win);
300 test_toolbar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
302 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
303 Evas_Object *ph1, *ph2, *ph3, *ph4;
304 Elm_Object_Item *tb_it;
305 Elm_Object_Item *menu_it;
308 win = elm_win_add(NULL, "toolbar3", ELM_WIN_BASIC);
309 elm_win_title_set(win, "Toolbar 3");
310 elm_win_autodel_set(win, EINA_TRUE);
312 bg = elm_bg_add(win);
313 elm_win_resize_object_add(win, bg);
314 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
315 evas_object_show(bg);
317 bx = elm_box_add(win);
318 elm_win_resize_object_add(win, bx);
319 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
320 evas_object_show(bx);
322 tb = elm_toolbar_add(win);
324 elm_toolbar_homogeneous_set(tb, 0);
326 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
327 >>>>>>> remotes/origin/upstream
328 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_NONE);
329 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
330 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
332 ph1 = elm_photo_add(win);
333 ph2 = elm_photo_add(win);
334 ph3 = elm_photo_add(win);
335 ph4 = elm_photo_add(win);
337 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
338 elm_object_item_disabled_set(tb_it, EINA_TRUE);
340 elm_toolbar_item_priority_set(tb_it, 0);
342 elm_toolbar_item_priority_set(tb_it, EINA_FALSE);
343 >>>>>>> remotes/origin/upstream
345 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
346 elm_toolbar_item_priority_set(tb_it, -200);
348 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
350 elm_toolbar_item_priority_set(tb_it, 1);
352 elm_toolbar_item_priority_set(tb_it, EINA_TRUE);
353 >>>>>>> remotes/origin/upstream
355 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
356 elm_toolbar_item_priority_set(tb_it, -10);
358 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
359 elm_toolbar_item_priority_set(tb_it, 50);
361 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
363 elm_toolbar_item_menu_set(tb_it, 1);
365 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
366 >>>>>>> remotes/origin/upstream
367 elm_toolbar_item_priority_set(tb_it, 999999);
368 elm_toolbar_menu_parent_set(tb, win);
369 menu = elm_toolbar_item_menu_get(tb_it);
371 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
372 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
373 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
374 elm_menu_item_add(menu, NULL, "edit-delete", "None", tb_5, ph4);
376 elm_box_pack_end(bx, tb);
377 evas_object_show(tb);
379 tb = elm_table_add(win);
380 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
381 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
384 elm_photo_size_set(ph, 40);
385 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
386 elm_photo_file_set(ph, buf);
387 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
388 evas_object_size_hint_align_set(ph, 0.5, 0.5);
389 elm_table_pack(tb, ph, 0, 0, 1, 1);
390 evas_object_show(ph);
393 elm_photo_size_set(ph, 80);
394 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
395 evas_object_size_hint_align_set(ph, 0.5, 0.5);
396 elm_table_pack(tb, ph, 1, 0, 1, 1);
397 evas_object_show(ph);
400 elm_photo_size_set(ph, 20);
401 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
402 elm_photo_file_set(ph, buf);
403 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
404 evas_object_size_hint_align_set(ph, 0.5, 0.5);
405 elm_table_pack(tb, ph, 0, 1, 1, 1);
406 evas_object_show(ph);
409 elm_photo_size_set(ph, 60);
410 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
411 elm_photo_file_set(ph, buf);
412 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
413 evas_object_size_hint_align_set(ph, 0.5, 0.5);
414 elm_table_pack(tb, ph, 1, 1, 1, 1);
415 evas_object_show(ph);
417 elm_box_pack_end(bx, tb);
418 evas_object_show(tb);
420 evas_object_resize(win, 320, 300);
421 evas_object_show(win);
424 /* The same test of toolbar, but using hide shrink mode instead of menu */
426 test_toolbar4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
428 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
429 Evas_Object *ph1, *ph2, *ph3, *ph4;
430 Elm_Object_Item *tb_it;
431 Elm_Object_Item *menu_it;
434 win = elm_win_add(NULL, "toolbar4", ELM_WIN_BASIC);
435 elm_win_title_set(win, "Toolbar 4");
436 elm_win_autodel_set(win, EINA_TRUE);
438 bg = elm_bg_add(win);
439 elm_win_resize_object_add(win, bg);
440 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
441 evas_object_show(bg);
443 bx = elm_box_add(win);
444 elm_win_resize_object_add(win, bx);
445 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
446 evas_object_show(bx);
448 tb = elm_toolbar_add(win);
449 elm_toolbar_homogeneous_set(tb, 0);
450 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_HIDE);
451 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
452 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
454 ph1 = elm_photo_add(win);
455 ph2 = elm_photo_add(win);
456 ph3 = elm_photo_add(win);
457 ph4 = elm_photo_add(win);
459 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
460 elm_object_item_disabled_set(tb_it, EINA_TRUE);
461 elm_toolbar_item_priority_set(tb_it, 100);
463 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
464 elm_toolbar_item_priority_set(tb_it, -100);
466 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
467 elm_toolbar_item_priority_set(tb_it, 150);
469 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
470 elm_toolbar_item_priority_set(tb_it, 0);
472 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
473 elm_toolbar_item_priority_set(tb_it, -200);
475 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
477 elm_toolbar_item_menu_set(tb_it, 1);
479 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
480 >>>>>>> remotes/origin/upstream
481 elm_toolbar_item_priority_set(tb_it, -999999);
482 elm_toolbar_menu_parent_set(tb, win);
483 menu = elm_toolbar_item_menu_get(tb_it);
485 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
486 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
487 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
488 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
490 elm_box_pack_end(bx, tb);
491 evas_object_show(tb);
493 tb = elm_table_add(win);
494 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
495 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
498 elm_photo_size_set(ph, 40);
499 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
500 elm_photo_file_set(ph, buf);
501 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
502 evas_object_size_hint_align_set(ph, 0.5, 0.5);
503 elm_table_pack(tb, ph, 0, 0, 1, 1);
504 evas_object_show(ph);
507 elm_photo_size_set(ph, 80);
508 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
509 evas_object_size_hint_align_set(ph, 0.5, 0.5);
510 elm_table_pack(tb, ph, 1, 0, 1, 1);
511 evas_object_show(ph);
514 elm_photo_size_set(ph, 20);
515 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
516 elm_photo_file_set(ph, buf);
517 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
518 evas_object_size_hint_align_set(ph, 0.5, 0.5);
519 elm_table_pack(tb, ph, 0, 1, 1, 1);
520 evas_object_show(ph);
523 elm_photo_size_set(ph, 60);
524 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
525 elm_photo_file_set(ph, buf);
526 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
527 evas_object_size_hint_align_set(ph, 0.5, 0.5);
528 elm_table_pack(tb, ph, 1, 1, 1, 1);
529 evas_object_show(ph);
531 elm_box_pack_end(bx, tb);
532 evas_object_show(tb);
534 evas_object_resize(win, 320, 300);
535 evas_object_show(win);
538 /* Toolbar with multiple state buttons */
540 test_toolbar5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
542 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
543 Evas_Object *ph1, *ph2, *ph3, *ph4;
544 Elm_Object_Item *tb_it;
545 Elm_Object_Item *menu_it;
548 win = elm_win_add(NULL, "toolbar5", ELM_WIN_BASIC);
549 elm_win_title_set(win, "Toolbar 5");
550 elm_win_autodel_set(win, EINA_TRUE);
552 bg = elm_bg_add(win);
553 elm_win_resize_object_add(win, bg);
554 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
555 evas_object_show(bg);
557 bx = elm_box_add(win);
558 elm_win_resize_object_add(win, bx);
559 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
560 evas_object_show(bx);
562 tb = elm_toolbar_add(win);
563 elm_toolbar_homogeneous_set(tb, 0);
564 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
565 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
566 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
568 elm_toolbar_no_select_mode_set(tb, EINA_TRUE);
570 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_NONE);
571 >>>>>>> remotes/origin/upstream
573 ph1 = elm_photo_add(win);
574 ph2 = elm_photo_add(win);
575 ph3 = elm_photo_add(win);
576 ph4 = elm_photo_add(win);
578 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
579 elm_object_item_disabled_set(tb_it, EINA_TRUE);
580 elm_toolbar_item_priority_set(tb_it, 100);
582 snprintf(buf, sizeof(buf), "%s/images/icon_04.pngj", elm_app_data_dir_get());
583 tb_it = elm_toolbar_item_append(tb, buf, "World", tb_2, ph1);
584 elm_toolbar_item_priority_set(tb_it, -100);
586 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3a, ph4);
587 elm_toolbar_item_state_add(tb_it, "object-rotate-left", "H2", tb_3b, ph4);
588 elm_toolbar_item_priority_set(tb_it, 150);
590 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4a, ph4);
591 elm_toolbar_item_state_add(tb_it, "emptytrash", "Comes2", tb_4a, ph4);
592 elm_toolbar_item_state_add(tb_it, "trashcan_full", "Comes3", tb_4a, ph4);
593 elm_toolbar_item_priority_set(tb_it, 0);
595 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
596 elm_toolbar_item_priority_set(tb_it, -200);
598 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
600 elm_toolbar_item_menu_set(tb_it, 1);
602 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
603 >>>>>>> remotes/origin/upstream
604 elm_toolbar_item_priority_set(tb_it, -999999);
605 elm_toolbar_menu_parent_set(tb, win);
606 menu = elm_toolbar_item_menu_get(tb_it);
608 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
609 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
610 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
611 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
613 elm_box_pack_end(bx, tb);
614 evas_object_show(tb);
616 tb = elm_table_add(win);
617 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
618 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
621 elm_photo_size_set(ph, 40);
622 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
623 elm_photo_file_set(ph, buf);
624 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
625 evas_object_size_hint_align_set(ph, 0.5, 0.5);
626 elm_table_pack(tb, ph, 0, 0, 1, 1);
627 evas_object_show(ph);
630 elm_photo_size_set(ph, 80);
631 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
632 evas_object_size_hint_align_set(ph, 0.5, 0.5);
633 elm_table_pack(tb, ph, 1, 0, 1, 1);
634 evas_object_show(ph);
637 elm_photo_size_set(ph, 20);
638 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
639 elm_photo_file_set(ph, buf);
640 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
641 evas_object_size_hint_align_set(ph, 0.5, 0.5);
642 elm_table_pack(tb, ph, 0, 1, 1, 1);
643 evas_object_show(ph);
646 elm_photo_size_set(ph, 60);
647 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
648 elm_photo_file_set(ph, buf);
649 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
650 evas_object_size_hint_align_set(ph, 0.5, 0.5);
651 elm_table_pack(tb, ph, 1, 1, 1, 1);
652 evas_object_show(ph);
654 elm_box_pack_end(bx, tb);
655 evas_object_show(tb);
657 evas_object_resize(win, 320, 300);
658 evas_object_show(win);
662 test_toolbar6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
664 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
665 Evas_Object *ph1, *ph2, *ph3, *ph4;
666 Elm_Object_Item *tb_it;
667 Elm_Object_Item *menu_it;
670 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
671 elm_win_title_set(win, "Toolbar");
672 elm_win_autodel_set(win, EINA_TRUE);
674 bg = elm_bg_add(win);
675 elm_win_resize_object_add(win, bg);
676 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
677 evas_object_show(bg);
679 bx = elm_box_add(win);
680 elm_win_resize_object_add(win, bx);
681 elm_box_horizontal_set(bx, EINA_TRUE);
682 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
683 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
684 evas_object_show(bx);
686 tb = elm_toolbar_add(win);
687 elm_toolbar_horizontal_set(tb, EINA_FALSE);
688 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
689 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
690 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
692 ph1 = elm_photo_add(win);
693 ph2 = elm_photo_add(win);
694 ph3 = elm_photo_add(win);
695 ph4 = elm_photo_add(win);
697 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
698 elm_object_item_disabled_set(tb_it, EINA_TRUE);
699 elm_toolbar_item_priority_set(tb_it, 100);
701 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
702 elm_toolbar_item_priority_set(tb_it, -100);
704 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
705 elm_toolbar_item_priority_set(tb_it, 150);
707 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
708 elm_toolbar_item_priority_set(tb_it, 0);
710 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
711 elm_toolbar_item_priority_set(tb_it, -200);
713 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
715 elm_toolbar_item_menu_set(tb_it, 1);
717 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
718 >>>>>>> remotes/origin/upstream
719 elm_toolbar_item_priority_set(tb_it, -999999);
720 elm_toolbar_menu_parent_set(tb, win);
721 menu = elm_toolbar_item_menu_get(tb_it);
723 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
724 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
725 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
726 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
728 elm_box_pack_end(bx, tb);
729 evas_object_show(tb);
731 tb = elm_table_add(win);
732 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
733 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
736 elm_photo_size_set(ph, 40);
737 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
738 elm_photo_file_set(ph, buf);
739 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
740 evas_object_size_hint_align_set(ph, 0.5, 0.5);
741 elm_table_pack(tb, ph, 0, 0, 1, 1);
742 evas_object_show(ph);
745 elm_photo_size_set(ph, 80);
746 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
747 evas_object_size_hint_align_set(ph, 0.5, 0.5);
748 elm_table_pack(tb, ph, 1, 0, 1, 1);
749 evas_object_show(ph);
752 elm_photo_size_set(ph, 20);
753 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
754 elm_photo_file_set(ph, buf);
755 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
756 evas_object_size_hint_align_set(ph, 0.5, 0.5);
757 elm_table_pack(tb, ph, 0, 1, 1, 1);
758 evas_object_show(ph);
761 elm_photo_size_set(ph, 60);
762 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
763 elm_photo_file_set(ph, buf);
764 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
765 evas_object_size_hint_align_set(ph, 0.5, 0.5);
766 elm_table_pack(tb, ph, 1, 1, 1, 1);
767 evas_object_show(ph);
769 elm_box_pack_end(bx, tb);
770 evas_object_show(tb);
772 evas_object_resize(win, 320, 300);
773 evas_object_show(win);
777 test_toolbar7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
779 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
780 Evas_Object *ph1, *ph2, *ph3, *ph4;
781 Elm_Object_Item *tb_it;
782 Elm_Object_Item *menu_it;
785 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
786 elm_win_title_set(win, "Toolbar");
787 elm_win_autodel_set(win, EINA_TRUE);
789 bg = elm_bg_add(win);
790 elm_win_resize_object_add(win, bg);
791 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
792 evas_object_show(bg);
794 bx = elm_box_add(win);
795 elm_win_resize_object_add(win, bx);
796 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
797 evas_object_show(bx);
799 tb = elm_toolbar_add(win);
800 elm_object_style_set(tb, "item_horizontal");
801 elm_toolbar_homogeneous_set(tb, 0);
802 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
803 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
804 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
806 ph1 = elm_photo_add(win);
807 ph2 = elm_photo_add(win);
808 ph3 = elm_photo_add(win);
809 ph4 = elm_photo_add(win);
811 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
812 elm_object_item_disabled_set(tb_it, EINA_TRUE);
813 elm_toolbar_item_priority_set(tb_it, 100);
815 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
816 elm_toolbar_item_priority_set(tb_it, -100);
818 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
819 elm_toolbar_item_priority_set(tb_it, 150);
821 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
822 elm_toolbar_item_priority_set(tb_it, 0);
824 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
825 elm_toolbar_item_priority_set(tb_it, -200);
827 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
828 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
829 elm_toolbar_item_priority_set(tb_it, -999999);
830 elm_toolbar_menu_parent_set(tb, win);
831 menu = elm_toolbar_item_menu_get(tb_it);
833 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
834 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
835 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
836 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
838 elm_box_pack_end(bx, tb);
839 evas_object_show(tb);
841 tb = elm_table_add(win);
842 //elm_table_homogeneous_set(tb, 1);
843 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
844 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
847 elm_photo_size_set(ph, 40);
848 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
849 elm_photo_file_set(ph, buf);
850 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
851 evas_object_size_hint_align_set(ph, 0.5, 0.5);
852 elm_table_pack(tb, ph, 0, 0, 1, 1);
853 evas_object_show(ph);
856 elm_photo_size_set(ph, 80);
857 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
858 evas_object_size_hint_align_set(ph, 0.5, 0.5);
859 elm_table_pack(tb, ph, 1, 0, 1, 1);
860 evas_object_show(ph);
863 elm_photo_size_set(ph, 20);
864 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
865 elm_photo_file_set(ph, buf);
866 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
867 evas_object_size_hint_align_set(ph, 0.5, 0.5);
868 elm_table_pack(tb, ph, 0, 1, 1, 1);
869 evas_object_show(ph);
872 elm_photo_size_set(ph, 60);
873 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
874 elm_photo_file_set(ph, buf);
875 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
876 evas_object_size_hint_align_set(ph, 0.5, 0.5);
877 elm_table_pack(tb, ph, 1, 1, 1, 1);
878 evas_object_show(ph);
880 elm_box_pack_end(bx, tb);
881 evas_object_show(tb);
883 evas_object_resize(win, 320, 300);
884 evas_object_show(win);
888 test_toolbar8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
890 Evas_Object *win, *bg, *bx, *tb, *ph, *sl, *menu;
891 Evas_Object *ph1, *ph2, *ph3, *ph4;
892 Elm_Object_Item *item;
893 Elm_Object_Item *menu_it;
896 win = elm_win_add(NULL, "toolbar8", ELM_WIN_BASIC);
897 elm_win_title_set(win, "Toolbar 8");
898 elm_win_autodel_set(win, EINA_TRUE);
900 bg = elm_bg_add(win);
901 elm_win_resize_object_add(win, bg);
902 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
903 evas_object_show(bg);
905 bx = elm_box_add(win);
906 elm_win_resize_object_add(win, bx);
907 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
908 evas_object_show(bx);
910 tb = elm_toolbar_add(win);
911 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
912 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_EXPAND);
913 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
914 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
916 ph1 = elm_photo_add(win);
917 ph2 = elm_photo_add(win);
918 ph3 = elm_photo_add(win);
919 ph4 = elm_photo_add(win);
921 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
922 elm_object_item_disabled_set(item, EINA_TRUE);
923 elm_toolbar_item_priority_set(item, -100);
925 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
926 elm_toolbar_item_priority_set(item, 100);
928 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
929 elm_toolbar_item_priority_set(item, -150);
931 sl = elm_slider_add(win);
932 evas_object_size_hint_min_set(sl, 100, 50);
933 item = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
934 elm_object_item_part_content_set(item, "object", sl);
936 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
937 elm_toolbar_item_priority_set(item, -200);
939 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
940 elm_toolbar_item_priority_set(item, 0);
942 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
943 elm_toolbar_item_menu_set(item, EINA_TRUE);
944 elm_toolbar_item_priority_set(item, -999999);
945 elm_toolbar_menu_parent_set(tb, win);
946 menu = elm_toolbar_item_menu_get(item);
948 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
949 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
950 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
951 elm_menu_item_add(menu, NULL, "edit-delete", "Scroll", tb_5, ph4);
953 elm_box_pack_end(bx, tb);
954 evas_object_show(tb);
956 tb = elm_table_add(win);
957 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
958 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
961 elm_photo_size_set(ph, 40);
962 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
963 elm_photo_file_set(ph, buf);
964 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
965 evas_object_size_hint_align_set(ph, 0.5, 0.5);
966 elm_table_pack(tb, ph, 0, 0, 1, 1);
967 evas_object_show(ph);
970 elm_photo_size_set(ph, 80);
971 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
972 evas_object_size_hint_align_set(ph, 0.5, 0.5);
973 elm_table_pack(tb, ph, 1, 0, 1, 1);
974 evas_object_show(ph);
977 elm_photo_size_set(ph, 20);
978 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
979 elm_photo_file_set(ph, buf);
980 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
981 evas_object_size_hint_align_set(ph, 0.5, 0.5);
982 elm_table_pack(tb, ph, 0, 1, 1, 1);
983 evas_object_show(ph);
986 elm_photo_size_set(ph, 60);
987 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
988 elm_photo_file_set(ph, buf);
989 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
990 evas_object_size_hint_align_set(ph, 0.5, 0.5);
991 elm_table_pack(tb, ph, 1, 1, 1, 1);
992 evas_object_show(ph);
994 elm_box_pack_end(bx, tb);
995 evas_object_show(tb);
997 evas_object_resize(win, 420, 250);
998 evas_object_show(win);