2 /* those 2 groups are used as custom icons for the buttons */
3 group { name: "icon_green";
5 part { name: "icon_green";
7 description { state: "default" 0.0;
10 aspect_preference: VERTICAL;
15 group { name: "icon_red";
17 part { name: "icon_red";
19 description { state: "default" 0.0;
22 aspect_preference: VERTICAL;
29 /* set a min window size */
32 /* tell edje that we are going to use elementary external parts */
37 /* define global variables */
39 public counter, toggle1, toggle2, toggle3, toggle4;
45 description { state: "default" 0.0;
46 color: 255 255 255 255;
53 description { state: "default" 0.0;
54 color: 255 255 255 255;
57 text: "Elementary buttons";
65 /* bottom label used for reporting */
68 description { state: "default" 0.0;
71 text: "try every buttons";
79 /* EXTERNAL elementary button with a label */
83 description { state: "default" 0;
92 string: "label" "Label only";
97 /* EXTERNAL elementary button with label + standard icon */
100 source: "elm/button";
101 description { state: "default" 0;
113 string: "label" "Label + standard icon";
114 string: "icon" "home";
119 /* EXTERNAL elementary button with a label and a custom icon */
122 source: "elm/button";
123 description { state: "default" 0;
135 string: "label" "Label + custom icon";
136 string: "icon" "icon_green";
141 /* EXTERNAL elementary button with just a standard icon */
144 source: "elm/button";
145 description { state: "default" 0;
157 string: "icon" "folder";
162 /* EXTERNAL elementary button with just a custom icon */
165 source: "elm/button";
166 description { state: "default" 0;
178 string: "icon" "icon_green";
185 /* bt1 clicked, change it's label and count the clicks */
186 program { name: "bt1_click";
191 /* increment the global counter*/
192 set_int(counter, get_int(counter) + 1);
193 /* set the button label */
194 snprintf(buf, sizeof(buf), "Clicked %d times", get_int(counter));
195 external_param_set_str(PART:"bt1", "label", buf);
196 /* set the bottom label */
197 set_text(PART:"label", "button 1 clicked: set label");
201 /* bt2 clicked, toggle it's standard icon */
202 program { name: "bt2_click";
206 if (get_int(toggle1) == 0) {
207 external_param_set_str(PART:"bt2", "icon", "home");
211 external_param_set_str(PART:"bt2", "icon", "folder");
214 set_text(PART:"label", "button 2 clicked: toggle icon");
218 /* bt3 clicked, toggle it's custom icon */
219 program { name: "bt3_click";
223 if (get_int(toggle2) == 0) {
224 external_param_set_str(PART:"bt3", "icon", "icon_red");
228 external_param_set_str(PART:"bt3", "icon", "icon_green");
231 set_text(PART:"label", "button 3 clicked: toggle icon");
235 /* bt4 clicked, toggle it's icon */
236 program { name: "bt4_click";
240 if (get_int(toggle3) == 0) {
241 external_param_set_str(PART:"bt4", "icon", "home");
245 external_param_set_str(PART:"bt4", "icon", "folder");
248 set_text(PART:"label", "button 4 clicked: toggle icon");
252 /* bt5 clicked, toggle it's icon */
253 program { name: "bt5_click";
257 if (get_int(toggle4) == 0) {
258 external_param_set_str(PART:"bt5", "icon", "icon_red");
262 external_param_set_str(PART:"bt5", "icon", "icon_green");
265 set_text(PART:"label", "button 5 clicked: toggle icon");