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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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_Toolbar_Item *item;
70 Elm_Menu_Item *menu_item;
73 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
74 elm_win_title_set(win, "Toolbar");
75 elm_win_autodel_set(win, 1);
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_homogenous_set(tb, 0);
89 elm_toolbar_mode_shrink_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 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
99 elm_toolbar_item_disabled_set(item, EINA_TRUE);
100 elm_toolbar_item_priority_set(item, 100);
102 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
103 elm_toolbar_item_priority_set(item, -100);
105 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
106 elm_toolbar_item_priority_set(item, 150);
108 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
109 elm_toolbar_item_priority_set(item, 0);
111 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
112 elm_toolbar_item_priority_set(item, -200);
114 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
115 elm_toolbar_item_menu_set(item, 1);
116 elm_toolbar_item_priority_set(item, -999999);
117 elm_toolbar_menu_parent_set(tb, win);
118 menu = elm_toolbar_item_menu_get(item);
120 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
121 menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
122 elm_menu_item_add(menu, menu_item, "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_homogenous_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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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_Toolbar_Item *item;
180 Elm_Menu_Item *menu_item;
183 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
184 elm_win_title_set(win, "Toolbar");
185 elm_win_autodel_set(win, 1);
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_homogenous_set(tb, 0);
199 elm_toolbar_mode_shrink_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_toolbar_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, 1);
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_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
232 elm_menu_item_add(menu, menu_item, "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_homogenous_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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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", PACKAGE_DATA_DIR);
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_Toolbar_Item *item;
290 Elm_Menu_Item *menu_item;
293 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
294 elm_win_title_set(win, "Toolbar");
295 elm_win_autodel_set(win, 1);
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_homogenous_set(tb, 0);
309 elm_toolbar_mode_shrink_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 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
319 elm_toolbar_item_disabled_set(item, EINA_TRUE);
320 elm_toolbar_item_priority_set(item, 0);
322 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
323 elm_toolbar_item_priority_set(item, -200);
325 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
326 elm_toolbar_item_priority_set(item, 1);
328 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
329 elm_toolbar_item_priority_set(item, -10);
331 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
332 elm_toolbar_item_priority_set(item, 50);
334 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
335 elm_toolbar_item_menu_set(item, 1);
336 elm_toolbar_item_priority_set(item, 999999);
337 elm_toolbar_menu_parent_set(tb, win);
338 menu = elm_toolbar_item_menu_get(item);
340 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
341 menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
342 elm_menu_item_add(menu, menu_item, "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 //elm_table_homogenous_set(tb, 1);
350 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
351 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
354 elm_photo_size_set(ph, 40);
355 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
356 elm_photo_file_set(ph, buf);
357 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
358 evas_object_size_hint_align_set(ph, 0.5, 0.5);
359 elm_table_pack(tb, ph, 0, 0, 1, 1);
360 evas_object_show(ph);
363 elm_photo_size_set(ph, 80);
364 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
365 evas_object_size_hint_align_set(ph, 0.5, 0.5);
366 elm_table_pack(tb, ph, 1, 0, 1, 1);
367 evas_object_show(ph);
370 elm_photo_size_set(ph, 20);
371 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
372 elm_photo_file_set(ph, buf);
373 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
374 evas_object_size_hint_align_set(ph, 0.5, 0.5);
375 elm_table_pack(tb, ph, 0, 1, 1, 1);
376 evas_object_show(ph);
379 elm_photo_size_set(ph, 60);
380 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
381 elm_photo_file_set(ph, buf);
382 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
383 evas_object_size_hint_align_set(ph, 0.5, 0.5);
384 elm_table_pack(tb, ph, 1, 1, 1, 1);
385 evas_object_show(ph);
387 elm_box_pack_end(bx, tb);
388 evas_object_show(tb);
390 evas_object_resize(win, 320, 300);
391 evas_object_show(win);
394 /* The same test of toolbar, but using hide shrink mode instead of menu */
396 test_toolbar4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
398 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
399 Evas_Object *ph1, *ph2, *ph3, *ph4;
400 Elm_Toolbar_Item *item;
401 Elm_Menu_Item *menu_item;
404 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
405 elm_win_title_set(win, "Toolbar 4");
406 elm_win_autodel_set(win, EINA_TRUE);
408 bg = elm_bg_add(win);
409 elm_win_resize_object_add(win, bg);
410 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
411 evas_object_show(bg);
413 bx = elm_box_add(win);
414 elm_win_resize_object_add(win, bx);
415 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
416 evas_object_show(bx);
418 tb = elm_toolbar_add(win);
419 elm_toolbar_homogenous_set(tb, 0);
420 elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_HIDE);
421 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
422 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
424 ph1 = elm_photo_add(win);
425 ph2 = elm_photo_add(win);
426 ph3 = elm_photo_add(win);
427 ph4 = elm_photo_add(win);
429 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
430 elm_toolbar_item_disabled_set(item, EINA_TRUE);
431 elm_toolbar_item_priority_set(item, 100);
433 item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
434 elm_toolbar_item_priority_set(item, -100);
436 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4);
437 elm_toolbar_item_priority_set(item, 150);
439 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4);
440 elm_toolbar_item_priority_set(item, 0);
442 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
443 elm_toolbar_item_priority_set(item, -200);
445 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
446 elm_toolbar_item_menu_set(item, 1);
447 elm_toolbar_item_priority_set(item, -999999);
448 elm_toolbar_menu_parent_set(tb, win);
449 menu = elm_toolbar_item_menu_get(item);
451 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
452 menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
453 elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4);
454 elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4);
456 elm_box_pack_end(bx, tb);
457 evas_object_show(tb);
459 tb = elm_table_add(win);
460 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
461 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
464 elm_photo_size_set(ph, 40);
465 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
466 elm_photo_file_set(ph, buf);
467 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
468 evas_object_size_hint_align_set(ph, 0.5, 0.5);
469 elm_table_pack(tb, ph, 0, 0, 1, 1);
470 evas_object_show(ph);
473 elm_photo_size_set(ph, 80);
474 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
475 evas_object_size_hint_align_set(ph, 0.5, 0.5);
476 elm_table_pack(tb, ph, 1, 0, 1, 1);
477 evas_object_show(ph);
480 elm_photo_size_set(ph, 20);
481 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
482 elm_photo_file_set(ph, buf);
483 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
484 evas_object_size_hint_align_set(ph, 0.5, 0.5);
485 elm_table_pack(tb, ph, 0, 1, 1, 1);
486 evas_object_show(ph);
489 elm_photo_size_set(ph, 60);
490 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
491 elm_photo_file_set(ph, buf);
492 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
493 evas_object_size_hint_align_set(ph, 0.5, 0.5);
494 elm_table_pack(tb, ph, 1, 1, 1, 1);
495 evas_object_show(ph);
497 elm_box_pack_end(bx, tb);
498 evas_object_show(tb);
500 evas_object_resize(win, 320, 300);
501 evas_object_show(win);
504 /* Toolbar with multiple state buttons */
506 test_toolbar5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
508 Evas_Object *win, *bg, *bx, *tb, *ph, *menu;
509 Evas_Object *ph1, *ph2, *ph3, *ph4;
510 Elm_Toolbar_Item *item;
511 Elm_Menu_Item *menu_item;
514 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
515 elm_win_title_set(win, "Toolbar");
516 elm_win_autodel_set(win, 1);
518 bg = elm_bg_add(win);
519 elm_win_resize_object_add(win, bg);
520 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
521 evas_object_show(bg);
523 bx = elm_box_add(win);
524 elm_win_resize_object_add(win, bx);
525 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
526 evas_object_show(bx);
528 tb = elm_toolbar_add(win);
529 elm_toolbar_homogenous_set(tb, 0);
530 elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_MENU);
531 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
532 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
533 elm_toolbar_no_select_mode_set(tb, EINA_TRUE);
535 ph1 = elm_photo_add(win);
536 ph2 = elm_photo_add(win);
537 ph3 = elm_photo_add(win);
538 ph4 = elm_photo_add(win);
540 item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1);
541 elm_toolbar_item_disabled_set(item, EINA_TRUE);
542 elm_toolbar_item_priority_set(item, 100);
544 item = elm_toolbar_item_append(tb, PACKAGE_DATA_DIR"/images/icon_04.png", "World", tb_2, ph1);
545 elm_toolbar_item_priority_set(item, -100);
547 item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3a, ph4);
548 elm_toolbar_item_state_add(item, "object-rotate-left", "H2", tb_3b, ph4);
549 elm_toolbar_item_priority_set(item, 150);
551 item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4a, ph4);
552 elm_toolbar_item_state_add(item, "emptytrash", "Comes2", tb_4a, ph4);
553 elm_toolbar_item_state_add(item, "trashcan_full", "Comes3", tb_4a, ph4);
554 elm_toolbar_item_priority_set(item, 0);
556 item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4);
557 elm_toolbar_item_priority_set(item, -200);
559 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
560 elm_toolbar_item_menu_set(item, 1);
561 elm_toolbar_item_priority_set(item, -999999);
562 elm_toolbar_menu_parent_set(tb, win);
563 menu = elm_toolbar_item_menu_get(item);
565 elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4);
566 menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4);
567 elm_menu_item_add(menu, menu_item, "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 //elm_table_homogenous_set(tb, 1);
575 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
576 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
579 elm_photo_size_set(ph, 40);
580 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
581 elm_photo_file_set(ph, buf);
582 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
583 evas_object_size_hint_align_set(ph, 0.5, 0.5);
584 elm_table_pack(tb, ph, 0, 0, 1, 1);
585 evas_object_show(ph);
588 elm_photo_size_set(ph, 80);
589 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
590 evas_object_size_hint_align_set(ph, 0.5, 0.5);
591 elm_table_pack(tb, ph, 1, 0, 1, 1);
592 evas_object_show(ph);
595 elm_photo_size_set(ph, 20);
596 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
597 elm_photo_file_set(ph, buf);
598 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
599 evas_object_size_hint_align_set(ph, 0.5, 0.5);
600 elm_table_pack(tb, ph, 0, 1, 1, 1);
601 evas_object_show(ph);
604 elm_photo_size_set(ph, 60);
605 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
606 elm_photo_file_set(ph, buf);
607 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
608 evas_object_size_hint_align_set(ph, 0.5, 0.5);
609 elm_table_pack(tb, ph, 1, 1, 1, 1);
610 evas_object_show(ph);
612 elm_box_pack_end(bx, tb);
613 evas_object_show(tb);
615 evas_object_resize(win, 320, 300);
616 evas_object_show(win);