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);
88 elm_toolbar_homogeneous_set(tb, 0);
89 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
90 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
91 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
93 ph1 = elm_photo_add(win);
94 ph2 = elm_photo_add(win);
95 ph3 = elm_photo_add(win);
96 ph4 = elm_photo_add(win);
98 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
99 elm_object_item_disabled_set(tb_it, EINA_TRUE);
100 elm_toolbar_item_priority_set(tb_it, 100);
102 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
103 elm_toolbar_item_priority_set(tb_it, -100);
105 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
106 elm_toolbar_item_priority_set(tb_it, 150);
108 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
109 elm_toolbar_item_priority_set(tb_it, 0);
111 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
112 elm_toolbar_item_priority_set(tb_it, -200);
114 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
115 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
116 elm_toolbar_item_priority_set(tb_it, -999999);
117 elm_toolbar_menu_parent_set(tb, win);
118 menu = elm_toolbar_item_menu_get(tb_it);
120 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
121 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
122 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
123 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
125 elm_box_pack_end(bx, tb);
126 evas_object_show(tb);
128 tb = elm_table_add(win);
129 //elm_table_homogeneous_set(tb, 1);
130 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
131 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
134 elm_photo_size_set(ph, 40);
135 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
136 elm_photo_file_set(ph, buf);
137 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
138 evas_object_size_hint_align_set(ph, 0.5, 0.5);
139 elm_table_pack(tb, ph, 0, 0, 1, 1);
140 evas_object_show(ph);
143 elm_photo_size_set(ph, 80);
144 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
145 evas_object_size_hint_align_set(ph, 0.5, 0.5);
146 elm_table_pack(tb, ph, 1, 0, 1, 1);
147 evas_object_show(ph);
150 elm_photo_size_set(ph, 20);
151 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
152 elm_photo_file_set(ph, buf);
153 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
154 evas_object_size_hint_align_set(ph, 0.5, 0.5);
155 elm_table_pack(tb, ph, 0, 1, 1, 1);
156 evas_object_show(ph);
159 elm_photo_size_set(ph, 60);
160 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
161 elm_photo_file_set(ph, buf);
162 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
163 evas_object_size_hint_align_set(ph, 0.5, 0.5);
164 elm_table_pack(tb, ph, 1, 1, 1, 1);
165 evas_object_show(ph);
167 elm_box_pack_end(bx, tb);
168 evas_object_show(tb);
170 evas_object_resize(win, 320, 300);
171 evas_object_show(win);
175 test_toolbar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
177 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
178 Evas_Object *ph1, *ph2, *ph3, *ph4;
179 Elm_Object_Item *item;
180 Elm_Object_Item *menu_it;
183 win = elm_win_add(NULL, "toolbar2", ELM_WIN_BASIC);
184 elm_win_title_set(win, "Toolbar 2");
185 elm_win_autodel_set(win, EINA_TRUE);
187 bg = elm_bg_add(win);
188 elm_win_resize_object_add(win, bg);
189 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
190 evas_object_show(bg);
192 bx = elm_box_add(win);
193 elm_win_resize_object_add(win, bx);
194 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
195 evas_object_show(bx);
197 tb = elm_toolbar_add(win);
198 elm_toolbar_homogeneous_set(tb, 0);
199 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_SCROLL);
200 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
201 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
203 ph1 = elm_photo_add(win);
204 ph2 = elm_photo_add(win);
205 ph3 = elm_photo_add(win);
206 ph4 = elm_photo_add(win);
208 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
209 elm_object_item_disabled_set(item, EINA_TRUE);
210 elm_toolbar_item_priority_set(item, -100);
212 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
213 elm_toolbar_item_priority_set(item, 100);
215 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
216 elm_toolbar_item_priority_set(item, -150);
218 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
219 elm_toolbar_item_priority_set(item, -200);
221 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
222 elm_toolbar_item_priority_set(item, 0);
224 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
225 elm_toolbar_item_menu_set(item, EINA_TRUE);
226 elm_toolbar_item_priority_set(item, -999999);
227 elm_toolbar_menu_parent_set(tb, win);
228 menu = elm_toolbar_item_menu_get(item);
230 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
231 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
232 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
233 elm_menu_item_add(menu, NULL, "edit-delete", "Scroll", tb_5, ph4);
235 elm_box_pack_end(bx, tb);
236 evas_object_show(tb);
238 tb = elm_table_add(win);
239 //elm_table_homogeneous_set(tb, 1);
240 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
241 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
244 elm_photo_size_set(ph, 40);
245 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
246 elm_photo_file_set(ph, buf);
247 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
248 evas_object_size_hint_align_set(ph, 0.5, 0.5);
249 elm_table_pack(tb, ph, 0, 0, 1, 1);
250 evas_object_show(ph);
253 elm_photo_size_set(ph, 80);
254 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
255 evas_object_size_hint_align_set(ph, 0.5, 0.5);
256 elm_table_pack(tb, ph, 1, 0, 1, 1);
257 evas_object_show(ph);
260 elm_photo_size_set(ph, 20);
261 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
262 elm_photo_file_set(ph, buf);
263 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
264 evas_object_size_hint_align_set(ph, 0.5, 0.5);
265 elm_table_pack(tb, ph, 0, 1, 1, 1);
266 evas_object_show(ph);
269 elm_photo_size_set(ph, 60);
270 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
271 elm_photo_file_set(ph, buf);
272 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
273 evas_object_size_hint_align_set(ph, 0.5, 0.5);
274 elm_table_pack(tb, ph, 1, 1, 1, 1);
275 evas_object_show(ph);
277 elm_box_pack_end(bx, tb);
278 evas_object_show(tb);
280 evas_object_resize(win, 320, 300);
281 evas_object_show(win);
285 test_toolbar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
287 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
288 Evas_Object *ph1, *ph2, *ph3, *ph4;
289 Elm_Object_Item *tb_it;
290 Elm_Object_Item *menu_it;
293 win = elm_win_add(NULL, "toolbar3", ELM_WIN_BASIC);
294 elm_win_title_set(win, "Toolbar 3");
295 elm_win_autodel_set(win, EINA_TRUE);
297 bg = elm_bg_add(win);
298 elm_win_resize_object_add(win, bg);
299 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
300 evas_object_show(bg);
302 bx = elm_box_add(win);
303 elm_win_resize_object_add(win, bx);
304 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
305 evas_object_show(bx);
307 tb = elm_toolbar_add(win);
308 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
309 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_NONE);
310 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
311 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
313 ph1 = elm_photo_add(win);
314 ph2 = elm_photo_add(win);
315 ph3 = elm_photo_add(win);
316 ph4 = elm_photo_add(win);
318 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
319 elm_object_item_disabled_set(tb_it, EINA_TRUE);
320 elm_toolbar_item_priority_set(tb_it, EINA_FALSE);
322 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
323 elm_toolbar_item_priority_set(tb_it, -200);
325 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
326 elm_toolbar_item_priority_set(tb_it, EINA_TRUE);
328 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
329 elm_toolbar_item_priority_set(tb_it, -10);
331 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
332 elm_toolbar_item_priority_set(tb_it, 50);
334 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
335 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
336 elm_toolbar_item_priority_set(tb_it, 999999);
337 elm_toolbar_menu_parent_set(tb, win);
338 menu = elm_toolbar_item_menu_get(tb_it);
340 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
341 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
342 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
343 elm_menu_item_add(menu, NULL, "edit-delete", "None", tb_5, ph4);
345 elm_box_pack_end(bx, tb);
346 evas_object_show(tb);
348 tb = elm_table_add(win);
349 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
350 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
353 elm_photo_size_set(ph, 40);
354 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
355 elm_photo_file_set(ph, buf);
356 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
357 evas_object_size_hint_align_set(ph, 0.5, 0.5);
358 elm_table_pack(tb, ph, 0, 0, 1, 1);
359 evas_object_show(ph);
362 elm_photo_size_set(ph, 80);
363 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
364 evas_object_size_hint_align_set(ph, 0.5, 0.5);
365 elm_table_pack(tb, ph, 1, 0, 1, 1);
366 evas_object_show(ph);
369 elm_photo_size_set(ph, 20);
370 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
371 elm_photo_file_set(ph, buf);
372 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
373 evas_object_size_hint_align_set(ph, 0.5, 0.5);
374 elm_table_pack(tb, ph, 0, 1, 1, 1);
375 evas_object_show(ph);
378 elm_photo_size_set(ph, 60);
379 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
380 elm_photo_file_set(ph, buf);
381 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
382 evas_object_size_hint_align_set(ph, 0.5, 0.5);
383 elm_table_pack(tb, ph, 1, 1, 1, 1);
384 evas_object_show(ph);
386 elm_box_pack_end(bx, tb);
387 evas_object_show(tb);
389 evas_object_resize(win, 320, 300);
390 evas_object_show(win);
393 /* The same test of toolbar, but using hide shrink mode instead of menu */
395 test_toolbar4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
397 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
398 Evas_Object *ph1, *ph2, *ph3, *ph4;
399 Elm_Object_Item *tb_it;
400 Elm_Object_Item *menu_it;
403 win = elm_win_add(NULL, "toolbar4", ELM_WIN_BASIC);
404 elm_win_title_set(win, "Toolbar 4");
405 elm_win_autodel_set(win, EINA_TRUE);
407 bg = elm_bg_add(win);
408 elm_win_resize_object_add(win, bg);
409 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
410 evas_object_show(bg);
412 bx = elm_box_add(win);
413 elm_win_resize_object_add(win, bx);
414 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
415 evas_object_show(bx);
417 tb = elm_toolbar_add(win);
418 elm_toolbar_homogeneous_set(tb, 0);
419 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_HIDE);
420 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
421 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
423 ph1 = elm_photo_add(win);
424 ph2 = elm_photo_add(win);
425 ph3 = elm_photo_add(win);
426 ph4 = elm_photo_add(win);
428 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
429 elm_object_item_disabled_set(tb_it, EINA_TRUE);
430 elm_toolbar_item_priority_set(tb_it, 100);
432 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
433 elm_toolbar_item_priority_set(tb_it, -100);
435 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
436 elm_toolbar_item_priority_set(tb_it, 150);
438 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
439 elm_toolbar_item_priority_set(tb_it, 0);
441 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
442 elm_toolbar_item_priority_set(tb_it, -200);
444 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
445 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
446 elm_toolbar_item_priority_set(tb_it, -999999);
447 elm_toolbar_menu_parent_set(tb, win);
448 menu = elm_toolbar_item_menu_get(tb_it);
450 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
451 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
452 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
453 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
455 elm_box_pack_end(bx, tb);
456 evas_object_show(tb);
458 tb = elm_table_add(win);
459 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
460 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
463 elm_photo_size_set(ph, 40);
464 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
465 elm_photo_file_set(ph, buf);
466 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
467 evas_object_size_hint_align_set(ph, 0.5, 0.5);
468 elm_table_pack(tb, ph, 0, 0, 1, 1);
469 evas_object_show(ph);
472 elm_photo_size_set(ph, 80);
473 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
474 evas_object_size_hint_align_set(ph, 0.5, 0.5);
475 elm_table_pack(tb, ph, 1, 0, 1, 1);
476 evas_object_show(ph);
479 elm_photo_size_set(ph, 20);
480 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
481 elm_photo_file_set(ph, buf);
482 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
483 evas_object_size_hint_align_set(ph, 0.5, 0.5);
484 elm_table_pack(tb, ph, 0, 1, 1, 1);
485 evas_object_show(ph);
488 elm_photo_size_set(ph, 60);
489 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
490 elm_photo_file_set(ph, buf);
491 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
492 evas_object_size_hint_align_set(ph, 0.5, 0.5);
493 elm_table_pack(tb, ph, 1, 1, 1, 1);
494 evas_object_show(ph);
496 elm_box_pack_end(bx, tb);
497 evas_object_show(tb);
499 evas_object_resize(win, 320, 300);
500 evas_object_show(win);
503 /* Toolbar with multiple state buttons */
505 test_toolbar5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
507 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
508 Evas_Object *ph1, *ph2, *ph3, *ph4;
509 Elm_Object_Item *tb_it;
510 Elm_Object_Item *menu_it;
513 win = elm_win_add(NULL, "toolbar5", ELM_WIN_BASIC);
514 elm_win_title_set(win, "Toolbar 5");
515 elm_win_autodel_set(win, EINA_TRUE);
517 bg = elm_bg_add(win);
518 elm_win_resize_object_add(win, bg);
519 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
520 evas_object_show(bg);
522 bx = elm_box_add(win);
523 elm_win_resize_object_add(win, bx);
524 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
525 evas_object_show(bx);
527 tb = elm_toolbar_add(win);
528 elm_toolbar_homogeneous_set(tb, 0);
529 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
530 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
531 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
532 elm_toolbar_no_select_mode_set(tb, EINA_TRUE);
534 ph1 = elm_photo_add(win);
535 ph2 = elm_photo_add(win);
536 ph3 = elm_photo_add(win);
537 ph4 = elm_photo_add(win);
539 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
540 elm_object_item_disabled_set(tb_it, EINA_TRUE);
541 elm_toolbar_item_priority_set(tb_it, 100);
543 snprintf(buf, sizeof(buf), "%s/images/icon_04.pngj", elm_app_data_dir_get());
544 tb_it = elm_toolbar_item_append(tb, buf, "World", tb_2, ph1);
545 elm_toolbar_item_priority_set(tb_it, -100);
547 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3a, ph4);
548 elm_toolbar_item_state_add(tb_it, "object-rotate-left", "H2", tb_3b, ph4);
549 elm_toolbar_item_priority_set(tb_it, 150);
551 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4a, ph4);
552 elm_toolbar_item_state_add(tb_it, "emptytrash", "Comes2", tb_4a, ph4);
553 elm_toolbar_item_state_add(tb_it, "trashcan_full", "Comes3", tb_4a, ph4);
554 elm_toolbar_item_priority_set(tb_it, 0);
556 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
557 elm_toolbar_item_priority_set(tb_it, -200);
559 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
560 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
561 elm_toolbar_item_priority_set(tb_it, -999999);
562 elm_toolbar_menu_parent_set(tb, win);
563 menu = elm_toolbar_item_menu_get(tb_it);
565 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
566 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
567 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
568 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
570 elm_box_pack_end(bx, tb);
571 evas_object_show(tb);
573 tb = elm_table_add(win);
574 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
575 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
578 elm_photo_size_set(ph, 40);
579 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
580 elm_photo_file_set(ph, buf);
581 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
582 evas_object_size_hint_align_set(ph, 0.5, 0.5);
583 elm_table_pack(tb, ph, 0, 0, 1, 1);
584 evas_object_show(ph);
587 elm_photo_size_set(ph, 80);
588 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
589 evas_object_size_hint_align_set(ph, 0.5, 0.5);
590 elm_table_pack(tb, ph, 1, 0, 1, 1);
591 evas_object_show(ph);
594 elm_photo_size_set(ph, 20);
595 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
596 elm_photo_file_set(ph, buf);
597 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
598 evas_object_size_hint_align_set(ph, 0.5, 0.5);
599 elm_table_pack(tb, ph, 0, 1, 1, 1);
600 evas_object_show(ph);
603 elm_photo_size_set(ph, 60);
604 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
605 elm_photo_file_set(ph, buf);
606 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
607 evas_object_size_hint_align_set(ph, 0.5, 0.5);
608 elm_table_pack(tb, ph, 1, 1, 1, 1);
609 evas_object_show(ph);
611 elm_box_pack_end(bx, tb);
612 evas_object_show(tb);
614 evas_object_resize(win, 320, 300);
615 evas_object_show(win);
619 test_toolbar6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
621 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
622 Evas_Object *ph1, *ph2, *ph3, *ph4;
623 Elm_Object_Item *tb_it;
624 Elm_Object_Item *menu_it;
627 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
628 elm_win_title_set(win, "Toolbar");
629 elm_win_autodel_set(win, EINA_TRUE);
631 bg = elm_bg_add(win);
632 elm_win_resize_object_add(win, bg);
633 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
634 evas_object_show(bg);
636 bx = elm_box_add(win);
637 elm_win_resize_object_add(win, bx);
638 elm_box_horizontal_set(bx, EINA_TRUE);
639 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
640 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
641 evas_object_show(bx);
643 tb = elm_toolbar_add(win);
644 elm_toolbar_horizontal_set(tb, EINA_FALSE);
645 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
646 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
647 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
649 ph1 = elm_photo_add(win);
650 ph2 = elm_photo_add(win);
651 ph3 = elm_photo_add(win);
652 ph4 = elm_photo_add(win);
654 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
655 elm_object_item_disabled_set(tb_it, EINA_TRUE);
656 elm_toolbar_item_priority_set(tb_it, 100);
658 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
659 elm_toolbar_item_priority_set(tb_it, -100);
661 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
662 elm_toolbar_item_priority_set(tb_it, 150);
664 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
665 elm_toolbar_item_priority_set(tb_it, 0);
667 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
668 elm_toolbar_item_priority_set(tb_it, -200);
670 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
671 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
672 elm_toolbar_item_priority_set(tb_it, -999999);
673 elm_toolbar_menu_parent_set(tb, win);
674 menu = elm_toolbar_item_menu_get(tb_it);
676 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
677 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
678 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
679 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
681 elm_box_pack_end(bx, tb);
682 evas_object_show(tb);
684 tb = elm_table_add(win);
685 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
686 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
689 elm_photo_size_set(ph, 40);
690 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
691 elm_photo_file_set(ph, buf);
692 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
693 evas_object_size_hint_align_set(ph, 0.5, 0.5);
694 elm_table_pack(tb, ph, 0, 0, 1, 1);
695 evas_object_show(ph);
698 elm_photo_size_set(ph, 80);
699 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
700 evas_object_size_hint_align_set(ph, 0.5, 0.5);
701 elm_table_pack(tb, ph, 1, 0, 1, 1);
702 evas_object_show(ph);
705 elm_photo_size_set(ph, 20);
706 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
707 elm_photo_file_set(ph, buf);
708 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
709 evas_object_size_hint_align_set(ph, 0.5, 0.5);
710 elm_table_pack(tb, ph, 0, 1, 1, 1);
711 evas_object_show(ph);
714 elm_photo_size_set(ph, 60);
715 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
716 elm_photo_file_set(ph, buf);
717 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
718 evas_object_size_hint_align_set(ph, 0.5, 0.5);
719 elm_table_pack(tb, ph, 1, 1, 1, 1);
720 evas_object_show(ph);
722 elm_box_pack_end(bx, tb);
723 evas_object_show(tb);
725 evas_object_resize(win, 320, 300);
726 evas_object_show(win);