1 #include <Elementary.h>
2 #ifndef ELM_LIB_QUICKLAUNCH
4 tb_1(void *data, Evas_Object *obj, void *event_info)
7 snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", PACKAGE_DATA_DIR);
8 elm_photo_file_set(data, buf);
12 tb_2(void *data, Evas_Object *obj, void *event_info)
15 snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR);
16 elm_photo_file_set(data, buf);
20 tb_3(void *data, Evas_Object *obj, void *event_info)
23 snprintf(buf, sizeof(buf), "%s/images/wood_01.jpg", PACKAGE_DATA_DIR);
24 elm_photo_file_set(data, buf);
28 tb_4(void *data, Evas_Object *obj, void *event_info)
31 snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR);
32 elm_photo_file_set(data, buf);
36 tb_5(void *data, Evas_Object *obj, void *event_info)
38 elm_photo_file_set(data, NULL);
42 test_toolbar(void *data, Evas_Object *obj, void *event_info)
44 Evas_Object *win, *bg, *bx, *tb, *ic, *ph, *menu;
45 Evas_Object *ph1, *ph2, *ph3, *ph4;
46 Elm_Toolbar_Item *item;
47 Elm_Menu_Item *menu_item;
50 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
51 elm_win_title_set(win, "Toolbar");
52 elm_win_autodel_set(win, 1);
55 elm_win_resize_object_add(win, bg);
56 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
59 bx = elm_box_add(win);
60 elm_win_resize_object_add(win, bx);
61 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
64 tb = elm_toolbar_add(win);
65 elm_toolbar_homogenous_set(tb, 0);
66 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
67 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
69 ph1 = elm_photo_add(win);
70 ph2 = elm_photo_add(win);
71 ph3 = elm_photo_add(win);
72 ph4 = elm_photo_add(win);
74 ic = elm_icon_add(win);
75 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
76 elm_icon_file_set(ic, buf, NULL);
77 item = elm_toolbar_item_add(tb, ic, "Hello", tb_1, ph1);
78 elm_toolbar_item_disabled_set(item, EINA_TRUE);
80 ic = elm_icon_add(win);
81 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
82 elm_icon_file_set(ic, buf, NULL);
83 elm_toolbar_item_add(tb, ic, "World", tb_2, ph1);
85 ic = elm_icon_add(win);
86 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
87 elm_icon_file_set(ic, buf, NULL);
88 elm_toolbar_item_add(tb, ic, "H", tb_3, ph4);
90 ic = elm_icon_add(win);
91 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
92 elm_icon_file_set(ic, buf, NULL);
93 elm_toolbar_item_add(tb, ic, "Comes", tb_4, ph4);
95 ic = elm_icon_add(win);
96 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
97 elm_icon_file_set(ic, buf, NULL);
98 elm_toolbar_item_add(tb, ic, "Elementary", tb_5, ph4);
100 ic = elm_icon_add(win);
101 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
102 elm_icon_file_set(ic, buf, NULL);
103 item = elm_toolbar_item_add(tb, ic, "Menu", NULL, NULL);
104 elm_toolbar_item_menu_set(item, 1);
105 elm_toolbar_menu_parent_set(tb, win);
106 menu = elm_toolbar_item_menu_get(item);
108 ic = elm_icon_add(win);
109 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
110 elm_icon_file_set(ic, buf, NULL);
111 elm_menu_item_add(menu, NULL, ic, "Here", tb_3, ph4);
113 ic = elm_icon_add(win);
114 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
115 elm_icon_file_set(ic, buf, NULL);
116 menu_item = elm_menu_item_add(menu, NULL, ic, "Comes", tb_4, ph4);
118 ic = elm_icon_add(win);
119 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
120 elm_icon_file_set(ic, buf, NULL);
121 elm_menu_item_add(menu, menu_item, ic, "hey ho", tb_4, ph4);
123 ic = elm_icon_add(win);
124 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
125 elm_icon_file_set(ic, buf, NULL);
126 menu_item = elm_menu_item_add(menu, NULL, ic, "Elementary", tb_5, ph4);
128 elm_box_pack_end(bx, tb);
129 evas_object_show(tb);
131 tb = elm_table_add(win);
132 //elm_table_homogenous_set(tb, 1);
133 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
134 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
137 elm_photo_size_set(ph, 40);
138 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
139 elm_photo_file_set(ph, buf);
140 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
141 evas_object_size_hint_align_set(ph, 0.5, 0.5);
142 elm_table_pack(tb, ph, 0, 0, 1, 1);
143 evas_object_show(ph);
146 elm_photo_size_set(ph, 80);
147 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
148 evas_object_size_hint_align_set(ph, 0.5, 0.5);
149 elm_table_pack(tb, ph, 1, 0, 1, 1);
150 evas_object_show(ph);
153 elm_photo_size_set(ph, 20);
154 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR);
155 elm_photo_file_set(ph, buf);
156 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
157 evas_object_size_hint_align_set(ph, 0.5, 0.5);
158 elm_table_pack(tb, ph, 0, 1, 1, 1);
159 evas_object_show(ph);
162 elm_photo_size_set(ph, 60);
163 snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR);
164 elm_photo_file_set(ph, buf);
165 evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
166 evas_object_size_hint_align_set(ph, 0.5, 0.5);
167 elm_table_pack(tb, ph, 1, 1, 1, 1);
168 evas_object_show(ph);
170 elm_box_pack_end(bx, tb);
171 evas_object_show(tb);
173 evas_object_resize(win, 320, 300);
175 evas_object_show(win);