2 # include "elementary_config.h"
4 #include <Elementary.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 toolbar_clicked_cb(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
67 Elm_Object_Item *it = elm_toolbar_more_item_get(obj);
69 if (!strcmp(elm_object_item_text_get(it), "Open") && (it == elm_toolbar_selected_item_get(obj)))
71 elm_toolbar_item_icon_set(it, "arrow_up");
72 elm_object_item_text_set(it, "Close");
74 else if (!strcmp(elm_object_item_text_get(it), "Close"))
76 elm_toolbar_item_icon_set(it, "arrow_down");
77 elm_object_item_text_set(it, "Open");
82 test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
84 Evas_Object *win, *bx, *tb, *ph, *menu;
85 Evas_Object *ph1, *ph2, *ph3, *ph4;
86 Elm_Object_Item *tb_it;
87 Elm_Object_Item *menu_it;
90 win = elm_win_util_standard_add("toolbar", "Toolbar");
91 elm_win_autodel_set(win, EINA_TRUE);
93 bx = elm_box_add(win);
94 elm_win_resize_object_add(win, bx);
95 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
98 tb = elm_toolbar_add(win);
99 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
100 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
101 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
102 elm_object_scale_set(tb, 0.9);
104 ph1 = elm_photo_add(win);
105 ph2 = elm_photo_add(win);
106 ph3 = elm_photo_add(win);
107 ph4 = elm_photo_add(win);
109 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
110 elm_object_item_disabled_set(tb_it, EINA_TRUE);
111 elm_toolbar_item_priority_set(tb_it, 100);
113 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
114 elm_toolbar_item_priority_set(tb_it, -100);
116 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
117 elm_toolbar_item_priority_set(tb_it, 150);
119 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
120 elm_toolbar_item_priority_set(tb_it, 0);
122 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
123 elm_toolbar_item_priority_set(tb_it, -200);
125 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
126 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
127 elm_toolbar_item_priority_set(tb_it, -9999);
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, *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_util_standard_add("toolbar2", "Toolbar 2");
195 elm_win_autodel_set(win, EINA_TRUE);
197 bx = elm_box_add(win);
198 elm_win_resize_object_add(win, bx);
199 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
200 evas_object_show(bx);
202 tb = elm_toolbar_add(win);
203 elm_toolbar_homogeneous_set(tb, 0);
204 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_SCROLL);
205 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
206 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
208 ph1 = elm_photo_add(win);
209 ph2 = elm_photo_add(win);
210 ph3 = elm_photo_add(win);
211 ph4 = elm_photo_add(win);
213 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
214 elm_object_item_disabled_set(item, EINA_TRUE);
215 elm_toolbar_item_priority_set(item, -100);
217 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
218 elm_toolbar_item_priority_set(item, 100);
220 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
221 elm_toolbar_item_priority_set(item, -150);
223 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
224 elm_toolbar_item_priority_set(item, -200);
226 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
227 elm_toolbar_item_priority_set(item, 0);
229 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
230 elm_toolbar_item_menu_set(item, EINA_TRUE);
231 elm_toolbar_item_priority_set(item, -9999);
232 elm_toolbar_menu_parent_set(tb, win);
233 menu = elm_toolbar_item_menu_get(item);
235 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
236 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
237 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
238 elm_menu_item_add(menu, NULL, "edit-delete", "Scroll", tb_5, ph4);
240 elm_box_pack_end(bx, tb);
241 evas_object_show(tb);
243 tb = elm_table_add(win);
244 //elm_table_homogeneous_set(tb, 1);
245 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
246 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
249 elm_photo_size_set(ph, 40);
250 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
251 elm_photo_file_set(ph, buf);
252 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
253 evas_object_size_hint_align_set(ph, 0.5, 0.5);
254 elm_table_pack(tb, ph, 0, 0, 1, 1);
255 evas_object_show(ph);
258 elm_photo_size_set(ph, 80);
259 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
260 evas_object_size_hint_align_set(ph, 0.5, 0.5);
261 elm_table_pack(tb, ph, 1, 0, 1, 1);
262 evas_object_show(ph);
265 elm_photo_size_set(ph, 20);
266 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
267 elm_photo_file_set(ph, buf);
268 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
269 evas_object_size_hint_align_set(ph, 0.5, 0.5);
270 elm_table_pack(tb, ph, 0, 1, 1, 1);
271 evas_object_show(ph);
274 elm_photo_size_set(ph, 60);
275 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
276 elm_photo_file_set(ph, buf);
277 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
278 evas_object_size_hint_align_set(ph, 0.5, 0.5);
279 elm_table_pack(tb, ph, 1, 1, 1, 1);
280 evas_object_show(ph);
282 elm_box_pack_end(bx, tb);
283 evas_object_show(tb);
285 evas_object_resize(win, 320, 300);
286 evas_object_show(win);
290 test_toolbar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
292 Evas_Object *win, *bx, *tb, *ph, *menu;
293 Evas_Object *ph1, *ph2, *ph3, *ph4;
294 Elm_Object_Item *tb_it;
295 Elm_Object_Item *menu_it;
298 win = elm_win_util_standard_add("toolbar3", "Toolbar 3");
299 elm_win_autodel_set(win, EINA_TRUE);
301 bx = elm_box_add(win);
302 elm_win_resize_object_add(win, bx);
303 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
304 evas_object_show(bx);
306 tb = elm_toolbar_add(win);
307 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
308 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_NONE);
309 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
310 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
312 ph1 = elm_photo_add(win);
313 ph2 = elm_photo_add(win);
314 ph3 = elm_photo_add(win);
315 ph4 = elm_photo_add(win);
317 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
318 elm_object_item_disabled_set(tb_it, EINA_TRUE);
319 elm_toolbar_item_priority_set(tb_it, EINA_FALSE);
321 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
322 elm_toolbar_item_priority_set(tb_it, -200);
324 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
325 elm_toolbar_item_priority_set(tb_it, EINA_TRUE);
327 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
328 elm_toolbar_item_priority_set(tb_it, -10);
330 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
331 elm_toolbar_item_priority_set(tb_it, 50);
333 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
334 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
335 elm_toolbar_item_priority_set(tb_it, 9999);
336 elm_toolbar_menu_parent_set(tb, win);
337 menu = elm_toolbar_item_menu_get(tb_it);
339 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
340 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
341 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
342 elm_menu_item_add(menu, NULL, "edit-delete", "None", tb_5, ph4);
344 elm_box_pack_end(bx, tb);
345 evas_object_show(tb);
347 tb = elm_table_add(win);
348 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
349 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
352 elm_photo_size_set(ph, 40);
353 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
354 elm_photo_file_set(ph, buf);
355 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
356 evas_object_size_hint_align_set(ph, 0.5, 0.5);
357 elm_table_pack(tb, ph, 0, 0, 1, 1);
358 evas_object_show(ph);
361 elm_photo_size_set(ph, 80);
362 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
363 evas_object_size_hint_align_set(ph, 0.5, 0.5);
364 elm_table_pack(tb, ph, 1, 0, 1, 1);
365 evas_object_show(ph);
368 elm_photo_size_set(ph, 20);
369 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
370 elm_photo_file_set(ph, buf);
371 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
372 evas_object_size_hint_align_set(ph, 0.5, 0.5);
373 elm_table_pack(tb, ph, 0, 1, 1, 1);
374 evas_object_show(ph);
377 elm_photo_size_set(ph, 60);
378 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
379 elm_photo_file_set(ph, buf);
380 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
381 evas_object_size_hint_align_set(ph, 0.5, 0.5);
382 elm_table_pack(tb, ph, 1, 1, 1, 1);
383 evas_object_show(ph);
385 elm_box_pack_end(bx, tb);
386 evas_object_show(tb);
388 evas_object_resize(win, 320, 300);
389 evas_object_show(win);
392 /* The same test of toolbar, but using hide shrink mode instead of menu */
394 test_toolbar4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
396 Evas_Object *win, *bx, *tb, *ph, *menu;
397 Evas_Object *ph1, *ph2, *ph3, *ph4;
398 Elm_Object_Item *tb_it;
399 Elm_Object_Item *menu_it;
402 win = elm_win_util_standard_add("toolbar4", "Toolbar 4");
403 elm_win_autodel_set(win, EINA_TRUE);
405 bx = elm_box_add(win);
406 elm_win_resize_object_add(win, bx);
407 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
408 evas_object_show(bx);
410 tb = elm_toolbar_add(win);
411 elm_toolbar_homogeneous_set(tb, 0);
412 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_HIDE);
413 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
414 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
416 ph1 = elm_photo_add(win);
417 ph2 = elm_photo_add(win);
418 ph3 = elm_photo_add(win);
419 ph4 = elm_photo_add(win);
421 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
422 elm_object_item_disabled_set(tb_it, EINA_TRUE);
423 elm_toolbar_item_priority_set(tb_it, 100);
425 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
426 elm_toolbar_item_priority_set(tb_it, -100);
428 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
429 elm_toolbar_item_priority_set(tb_it, 150);
431 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
432 elm_toolbar_item_priority_set(tb_it, 0);
434 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
435 elm_toolbar_item_priority_set(tb_it, -200);
437 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
438 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
439 elm_toolbar_item_priority_set(tb_it, -9999);
440 elm_toolbar_menu_parent_set(tb, win);
441 menu = elm_toolbar_item_menu_get(tb_it);
443 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
444 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
445 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
446 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
448 elm_box_pack_end(bx, tb);
449 evas_object_show(tb);
451 tb = elm_table_add(win);
452 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
453 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
456 elm_photo_size_set(ph, 40);
457 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
458 elm_photo_file_set(ph, buf);
459 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
460 evas_object_size_hint_align_set(ph, 0.5, 0.5);
461 elm_table_pack(tb, ph, 0, 0, 1, 1);
462 evas_object_show(ph);
465 elm_photo_size_set(ph, 80);
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, 1, 0, 1, 1);
469 evas_object_show(ph);
472 elm_photo_size_set(ph, 20);
473 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
474 elm_photo_file_set(ph, buf);
475 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
476 evas_object_size_hint_align_set(ph, 0.5, 0.5);
477 elm_table_pack(tb, ph, 0, 1, 1, 1);
478 evas_object_show(ph);
481 elm_photo_size_set(ph, 60);
482 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
483 elm_photo_file_set(ph, buf);
484 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
485 evas_object_size_hint_align_set(ph, 0.5, 0.5);
486 elm_table_pack(tb, ph, 1, 1, 1, 1);
487 evas_object_show(ph);
489 elm_box_pack_end(bx, tb);
490 evas_object_show(tb);
492 evas_object_resize(win, 320, 300);
493 evas_object_show(win);
496 /* Toolbar with multiple state buttons */
498 test_toolbar5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
500 Evas_Object *win, *bx, *tb, *ph, *menu;
501 Evas_Object *ph1, *ph2, *ph3, *ph4;
502 Elm_Object_Item *tb_it;
503 Elm_Object_Item *menu_it;
506 win = elm_win_util_standard_add("toolbar5", "Toolbar 5");
507 elm_win_autodel_set(win, EINA_TRUE);
509 bx = elm_box_add(win);
510 elm_win_resize_object_add(win, bx);
511 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
512 evas_object_show(bx);
514 tb = elm_toolbar_add(win);
515 elm_toolbar_homogeneous_set(tb, 0);
516 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
517 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
518 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
519 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_NONE);
521 ph1 = elm_photo_add(win);
522 ph2 = elm_photo_add(win);
523 ph3 = elm_photo_add(win);
524 ph4 = elm_photo_add(win);
526 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
527 elm_object_item_disabled_set(tb_it, EINA_TRUE);
528 elm_toolbar_item_priority_set(tb_it, 100);
530 snprintf(buf, sizeof(buf), "%s/images/icon_04.pngj", elm_app_data_dir_get());
531 tb_it = elm_toolbar_item_append(tb, buf, "World", tb_2, ph1);
532 elm_toolbar_item_priority_set(tb_it, -100);
534 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3a, ph4);
535 elm_toolbar_item_state_add(tb_it, "object-rotate-left", "H2", tb_3b, ph4);
536 elm_toolbar_item_priority_set(tb_it, 150);
538 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4a, ph4);
539 elm_toolbar_item_state_add(tb_it, "emptytrash", "Comes2", tb_4a, ph4);
540 elm_toolbar_item_state_add(tb_it, "trashcan_full", "Comes3", tb_4a, ph4);
541 elm_toolbar_item_priority_set(tb_it, 0);
543 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
544 elm_toolbar_item_priority_set(tb_it, -200);
546 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
547 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
548 elm_toolbar_item_priority_set(tb_it, -9999);
549 elm_toolbar_menu_parent_set(tb, win);
550 menu = elm_toolbar_item_menu_get(tb_it);
552 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
553 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
554 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
555 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
557 elm_box_pack_end(bx, tb);
558 evas_object_show(tb);
560 tb = elm_table_add(win);
561 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
562 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
565 elm_photo_size_set(ph, 40);
566 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
567 elm_photo_file_set(ph, buf);
568 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
569 evas_object_size_hint_align_set(ph, 0.5, 0.5);
570 elm_table_pack(tb, ph, 0, 0, 1, 1);
571 evas_object_show(ph);
574 elm_photo_size_set(ph, 80);
575 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
576 evas_object_size_hint_align_set(ph, 0.5, 0.5);
577 elm_table_pack(tb, ph, 1, 0, 1, 1);
578 evas_object_show(ph);
581 elm_photo_size_set(ph, 20);
582 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
583 elm_photo_file_set(ph, buf);
584 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
585 evas_object_size_hint_align_set(ph, 0.5, 0.5);
586 elm_table_pack(tb, ph, 0, 1, 1, 1);
587 evas_object_show(ph);
590 elm_photo_size_set(ph, 60);
591 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
592 elm_photo_file_set(ph, buf);
593 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
594 evas_object_size_hint_align_set(ph, 0.5, 0.5);
595 elm_table_pack(tb, ph, 1, 1, 1, 1);
596 evas_object_show(ph);
598 elm_box_pack_end(bx, tb);
599 evas_object_show(tb);
601 evas_object_resize(win, 320, 300);
602 evas_object_show(win);
606 test_toolbar6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
608 Evas_Object *win, *bx, *tb, *ph, *menu;
609 Evas_Object *ph1, *ph2, *ph3, *ph4;
610 Elm_Object_Item *tb_it;
611 Elm_Object_Item *menu_it;
614 win = elm_win_util_standard_add("toolbar6", "Toolbar 6");
615 elm_win_autodel_set(win, EINA_TRUE);
617 bx = elm_box_add(win);
618 elm_win_resize_object_add(win, bx);
619 elm_box_horizontal_set(bx, EINA_TRUE);
620 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
621 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
622 evas_object_show(bx);
624 tb = elm_toolbar_add(win);
625 elm_toolbar_horizontal_set(tb, EINA_FALSE);
626 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
627 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
628 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
630 ph1 = elm_photo_add(win);
631 ph2 = elm_photo_add(win);
632 ph3 = elm_photo_add(win);
633 ph4 = elm_photo_add(win);
635 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
636 elm_object_item_disabled_set(tb_it, EINA_TRUE);
637 elm_toolbar_item_priority_set(tb_it, 100);
639 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
640 elm_toolbar_item_priority_set(tb_it, -100);
642 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
643 elm_toolbar_item_priority_set(tb_it, 150);
645 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
646 elm_toolbar_item_priority_set(tb_it, 0);
648 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
649 elm_toolbar_item_priority_set(tb_it, -200);
651 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
652 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
653 elm_toolbar_item_priority_set(tb_it, -9999);
654 elm_toolbar_menu_parent_set(tb, win);
655 menu = elm_toolbar_item_menu_get(tb_it);
657 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
658 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
659 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
660 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
662 elm_box_pack_end(bx, tb);
663 evas_object_show(tb);
665 tb = elm_table_add(win);
666 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
667 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
670 elm_photo_size_set(ph, 40);
671 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
672 elm_photo_file_set(ph, buf);
673 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
674 evas_object_size_hint_align_set(ph, 0.5, 0.5);
675 elm_table_pack(tb, ph, 0, 0, 1, 1);
676 evas_object_show(ph);
679 elm_photo_size_set(ph, 80);
680 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
681 evas_object_size_hint_align_set(ph, 0.5, 0.5);
682 elm_table_pack(tb, ph, 1, 0, 1, 1);
683 evas_object_show(ph);
686 elm_photo_size_set(ph, 20);
687 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
688 elm_photo_file_set(ph, buf);
689 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
690 evas_object_size_hint_align_set(ph, 0.5, 0.5);
691 elm_table_pack(tb, ph, 0, 1, 1, 1);
692 evas_object_show(ph);
695 elm_photo_size_set(ph, 60);
696 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
697 elm_photo_file_set(ph, buf);
698 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
699 evas_object_size_hint_align_set(ph, 0.5, 0.5);
700 elm_table_pack(tb, ph, 1, 1, 1, 1);
701 evas_object_show(ph);
703 elm_box_pack_end(bx, tb);
704 evas_object_show(tb);
706 evas_object_resize(win, 320, 300);
707 evas_object_show(win);
711 test_toolbar7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
713 Evas_Object *win, *bx, *tb, *ph, *menu;
714 Evas_Object *ph1, *ph2, *ph3, *ph4;
715 Elm_Object_Item *tb_it;
716 Elm_Object_Item *menu_it;
719 win = elm_win_util_standard_add("toolbar7", "Toolbar 7");
720 elm_win_autodel_set(win, EINA_TRUE);
722 bx = elm_box_add(win);
723 elm_win_resize_object_add(win, bx);
724 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
725 evas_object_show(bx);
727 tb = elm_toolbar_add(win);
728 elm_object_style_set(tb, "item_horizontal");
729 elm_toolbar_homogeneous_set(tb, 0);
730 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
731 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
732 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
734 ph1 = elm_photo_add(win);
735 ph2 = elm_photo_add(win);
736 ph3 = elm_photo_add(win);
737 ph4 = elm_photo_add(win);
739 tb_it = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
740 elm_object_item_disabled_set(tb_it, EINA_TRUE);
741 elm_toolbar_item_priority_set(tb_it, 100);
743 tb_it = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
744 elm_toolbar_item_priority_set(tb_it, -100);
746 tb_it = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
747 elm_toolbar_item_priority_set(tb_it, 150);
749 tb_it = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
750 elm_toolbar_item_priority_set(tb_it, 0);
752 tb_it = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
753 elm_toolbar_item_priority_set(tb_it, -200);
755 tb_it = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
756 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
757 elm_toolbar_item_priority_set(tb_it, -9999);
758 elm_toolbar_menu_parent_set(tb, win);
759 menu = elm_toolbar_item_menu_get(tb_it);
761 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
762 menu_it = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
763 elm_menu_item_add(menu, menu_it, "edit-paste", "is set to", tb_4, ph4);
764 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
766 elm_box_pack_end(bx, tb);
767 evas_object_show(tb);
769 tb = elm_table_add(win);
770 //elm_table_homogeneous_set(tb, 1);
771 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
772 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
775 elm_photo_size_set(ph, 40);
776 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
777 elm_photo_file_set(ph, buf);
778 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
779 evas_object_size_hint_align_set(ph, 0.5, 0.5);
780 elm_table_pack(tb, ph, 0, 0, 1, 1);
781 evas_object_show(ph);
784 elm_photo_size_set(ph, 80);
785 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
786 evas_object_size_hint_align_set(ph, 0.5, 0.5);
787 elm_table_pack(tb, ph, 1, 0, 1, 1);
788 evas_object_show(ph);
791 elm_photo_size_set(ph, 20);
792 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
793 elm_photo_file_set(ph, buf);
794 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
795 evas_object_size_hint_align_set(ph, 0.5, 0.5);
796 elm_table_pack(tb, ph, 0, 1, 1, 1);
797 evas_object_show(ph);
800 elm_photo_size_set(ph, 60);
801 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
802 elm_photo_file_set(ph, buf);
803 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
804 evas_object_size_hint_align_set(ph, 0.5, 0.5);
805 elm_table_pack(tb, ph, 1, 1, 1, 1);
806 evas_object_show(ph);
808 elm_box_pack_end(bx, tb);
809 evas_object_show(tb);
811 evas_object_resize(win, 320, 300);
812 evas_object_show(win);
816 test_toolbar8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
818 Evas_Object *win, *bx, *tb, *ph, *sl;
819 Evas_Object *ph1, *ph2, *ph3, *ph4;
820 Elm_Object_Item *item;
823 win = elm_win_util_standard_add("toolbar8", "Toolbar 8");
824 elm_win_autodel_set(win, EINA_TRUE);
826 bx = elm_box_add(win);
827 elm_win_resize_object_add(win, bx);
828 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
829 evas_object_show(bx);
831 tb = elm_toolbar_add(win);
832 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
833 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_EXPAND);
834 elm_toolbar_standard_priority_set(tb, 0);
835 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
836 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
838 ph1 = elm_photo_add(win);
839 ph2 = elm_photo_add(win);
840 ph3 = elm_photo_add(win);
841 ph4 = elm_photo_add(win);
843 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
844 elm_object_item_disabled_set(item, EINA_TRUE);
845 elm_toolbar_item_priority_set(item, -100);
847 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
849 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
850 elm_toolbar_item_priority_set(item, 100);
852 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
854 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
855 elm_toolbar_item_priority_set(item, -150);
857 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
859 sl = elm_slider_add(win);
860 evas_object_size_hint_min_set(sl, 100, 50);
861 item = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
862 elm_object_item_part_content_set(item, "object", sl);
864 elm_toolbar_item_priority_set(item, 500);
866 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
868 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
869 elm_toolbar_item_priority_set(item, -200);
871 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
873 item = elm_toolbar_item_append(tb, "edit-cut", "Shrink", tb_4, ph4);
874 elm_toolbar_item_priority_set(item, -200);
876 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
878 item = elm_toolbar_item_append(tb, "edit-copy", "Mode", tb_4, ph4);
879 elm_toolbar_item_priority_set(item, -200);
881 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
883 item = elm_toolbar_item_append(tb, "edit-paste", "is set to", tb_4, ph4);
884 elm_toolbar_item_priority_set(item, -200);
886 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
888 item = elm_toolbar_item_append(tb, "edit-delete", "Menu", tb_4, ph4);
889 elm_toolbar_item_priority_set(item, 200);
891 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
893 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
894 elm_toolbar_item_priority_set(item, 200);
896 elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_TRUE);
898 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
899 elm_toolbar_item_priority_set(item, -300);
901 elm_object_item_text_set(elm_toolbar_more_item_get(tb), "Open");
903 evas_object_smart_callback_add(tb, "clicked", toolbar_clicked_cb, NULL);
905 elm_box_pack_end(bx, tb);
906 evas_object_show(tb);
908 tb = elm_table_add(win);
909 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
910 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
913 elm_photo_size_set(ph, 80);
914 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
915 elm_photo_file_set(ph, buf);
916 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
917 evas_object_size_hint_align_set(ph, 0.5, 0.5);
918 elm_table_pack(tb, ph, 0, 0, 1, 1);
919 evas_object_show(ph);
922 elm_photo_size_set(ph, 160);
923 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
924 evas_object_size_hint_align_set(ph, 0.5, 0.5);
925 elm_table_pack(tb, ph, 1, 0, 1, 1);
926 evas_object_show(ph);
929 elm_photo_size_set(ph, 40);
930 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
931 elm_photo_file_set(ph, buf);
932 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
933 evas_object_size_hint_align_set(ph, 0.5, 0.5);
934 elm_table_pack(tb, ph, 0, 1, 1, 1);
935 evas_object_show(ph);
938 elm_photo_size_set(ph, 120);
939 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
940 elm_photo_file_set(ph, buf);
941 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
942 evas_object_size_hint_align_set(ph, 0.5, 0.5);
943 elm_table_pack(tb, ph, 1, 1, 1, 1);
944 evas_object_show(ph);
946 elm_box_pack_end(bx, tb);
947 evas_object_show(tb);
949 evas_object_resize(win, 420, 250);
950 evas_object_show(win);