1 #define FLIP_PICKER_MAX_LEN (50)
2 #define FLIP_PICKER_MAX_LEN_STR "50"
4 group { name: "elm/flipselector/base/default";
6 image: "flip_base.png" COMP;
7 image: "flip_base_shad.png" COMP;
8 image: "flip_shad.png" COMP;
9 image: "arrow_up.png" COMP;
10 image: "arrow_down.png" COMP;
11 image: "flip_t.png" COMP;
12 image: "flip_b.png" COMP;
16 item: "max_len" FLIP_PICKER_MAX_LEN_STR;
19 //FIXME: quick successive clicks on, say, up, lead to nastiness
21 public cur, prev, next, lock;
24 new tmp[FLIP_PICKER_MAX_LEN];
25 if (get_int(lock) == 1) {
26 replace_str(next, 0, str);
29 fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN);
31 set_text(PART:"bottom_b", tmp);
33 set_state(PART:"elm.top", "shrink", 0.0);
34 set_text(PART:"elm.top", tmp);
35 set_state(PART:"elm.top", "default", 0.0);
36 set_text(PART:"elm.top", tmp);
38 replace_str(prev, 0, tmp);
40 set_state(PART:"elm.bottom", "default", 0.0);
41 set_text(PART:"elm.bottom", str);
42 set_state(PART:"elm.bottom", "shrink", 0.0);
43 set_text(PART:"elm.bottom", str);
45 set_text(PART:"top_b", str);
47 replace_str(cur, 0, str);
49 set_state(PART:"bottom_sheet", "shrink", 0.0);
50 set_state(PART:"top_sheet", "default", 0.0);
53 set_state(PART:"shadow", "default", 0.0);
54 anim(0.2, "animator_top_down", 1);
58 new tmp[FLIP_PICKER_MAX_LEN];
59 if (get_int(lock) == 1) {
60 replace_str(next, 0, str);
64 fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN);
66 set_text(PART:"top_b", tmp);
68 set_state(PART:"elm.bottom", "shrink", 0.0);
69 set_text(PART:"elm.bottom", tmp);
70 set_state(PART:"elm.bottom", "default", 0.0);
71 set_text(PART:"elm.bottom", tmp);
73 replace_str(prev, 0, tmp);
75 set_state(PART:"elm.top", "default", 0.0);
76 set_text(PART:"elm.top", str);
77 set_state(PART:"elm.top", "shrink", 0.0);
78 set_text(PART:"elm.top", str);
80 set_text(PART:"bottom_b", str);
82 replace_str(cur, 0, str);
84 set_state(PART:"bottom_sheet", "default", 0.0);
85 set_state(PART:"top_sheet", "shrink", 0.0);
88 set_state(PART:"shadow", "full", 0.0);
89 anim(0.2, "animator_bottom_up", 1);
92 public animator_bottom_down(val, Float:pos) {
93 new tmp[FLIP_PICKER_MAX_LEN];
95 set_tween_state(PART:"elm.bottom", pos, "shrink", 0.0, "default", 0.0);
96 set_tween_state(PART:"bottom_sheet", pos, "shrink", 0.0, "default",
98 set_tween_state(PART:"shadow", pos, "half", 0.0, "full",
102 set_state(PART:"shadow", "default", 0.0);
105 fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN);
106 if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) {
107 replace_str(next, 0, "");
113 public animator_top_down(val, Float:pos) {
114 set_tween_state(PART:"elm.top", pos, "default", 0.0, "shrink", 0.0);
115 set_tween_state(PART:"top_sheet", pos, "default", 0.0, "shrink",
117 set_tween_state(PART:"shadow", pos, "default", 0.0, "half",
121 anim(0.2, "animator_bottom_down", val);
124 public animator_bottom_up(val, Float:pos) {
125 set_tween_state(PART:"elm.bottom", pos, "default", 0.0, "shrink", 0.0);
126 set_tween_state(PART:"bottom_sheet", pos, "default", 0.0, "shrink",
128 set_tween_state(PART:"shadow", pos, "full", 0.0, "half",
132 anim(0.2, "animator_top_up", val);
135 public animator_top_up(val, Float:pos) {
136 new tmp[FLIP_PICKER_MAX_LEN];
138 set_tween_state(PART:"elm.top", pos, "shrink", 0.0, "default", 0.0);
139 set_tween_state(PART:"top_sheet", pos, "shrink", 0.0, "default",
141 set_tween_state(PART:"shadow", pos, "half", 0.0, "default",
145 set_state(PART:"shadow", "default", 0.0);
148 fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN);
149 if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) {
150 replace_str(next, 0, "");
156 public message(Msg_Type:type, id, ...) {
158 if ((type == MSG_STRING) && (id == 1)) {
159 new value[FLIP_PICKER_MAX_LEN];
160 snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2));
165 if ((type == MSG_STRING) && (id == 2)) {
166 new value[FLIP_PICKER_MAX_LEN];
167 snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2));
176 description { state: "default" 0.0;
182 normal: "flip_base_shad.png";
190 description { state: "default" 0.0;
194 image.normal: "flip_base.png";
201 description { state: "default" 0.0;
203 rel1.relative: 0.0 0.5;
207 description { state: "hidden" 0.0;
208 inherit: "default" 0.0;
216 description { state: "default" 0.0;
219 rel2.relative: 1.0 0.5;
222 description { state: "hidden" 0.0;
223 inherit: "default" 0.0;
228 part { name: "bottom_sheet_static";
230 description { state: "default" 0.0;
234 image.normal: "flip_b.png";
238 part { name: "bottom_b";
240 clip_to: "bottom_clipper";
243 description { state: "default" 0.0;
249 font: "Sans:style=Bold,Edje-Vera-Bold";
257 part { name: "shadow";
259 description { state: "default" 0.0;
262 rel2.relative: 1.0 0.0;
263 image.normal: "flip_shad.png";
265 description { state: "half" 0.0;
266 inherit: "default" 0.0;
267 rel2.relative: 1.0 0.5;
269 description { state: "full" 0.0;
270 inherit: "default" 0.0;
271 rel2.relative: 1.0 1.0;
275 part { name: "bottom_sheet";
277 description { state: "default" 0.0;
281 image.normal: "flip_b.png";
283 description { state: "shrink" 0.0;
284 inherit: "default" 0.0;
286 rel2.relative: 1.0 0.0;
290 part { name: "elm.bottom";
292 clip_to: "bottom_clipper";
295 description { state: "default" 0.0;
301 font: "Sans:style=Bold,Edje-Vera-Bold";
307 description { state: "shrink" 0.0;
308 inherit: "default" 0.0;
309 color: 128 128 128 255;
311 rel2.relative: 1.0 0.5; /* FIXME: same visual effect? --> MAP! */
315 part { name: "top_sheet_static";
317 description { state: "default" 0.0;
321 image.normal: "flip_t.png";
325 part { name: "top_b";
327 clip_to: "top_clipper";
330 description { state: "default" 0.0;
336 font: "Sans:style=Bold,Edje-Vera-Bold";
345 part { name: "top_sheet";
347 description { state: "default" 0.0;
351 image.normal: "flip_t.png";
353 description { state: "shrink" 0.0;
354 inherit: "default" 0.0;
355 color: 128 128 128 255;
357 rel1.relative: 0.0 1.0;
361 part { name: "elm.top";
363 clip_to: "top_clipper";
366 description { state: "default" 0.0;
372 font: "Sans:style=Bold,Edje-Vera-Bold";
378 description { state: "shrink" 0.0;
379 inherit: "default" 0.0;
381 rel1.relative: 0.0 0.5;
385 part { name: "arrow_top";
389 description { state: "default" 0.0;
395 image.normal: "arrow_up.png";
397 description { state: "hidden" 0.0;
398 inherit: "default" 0.0;
402 part { name: "arrow_bottom";
406 description { state: "default" 0.0;
412 image.normal: "arrow_down.png";
414 description { state: "hidden" 0.0;
415 inherit: "default" 0.0;
426 state: "default" 0.0;
436 name: "bottom_clipper";
439 state: "default" 0.0;
450 state: "default" 0.0;
451 color: 255 255 255 255;
454 state: "enabled" 0.0;
455 color: 100 100 100 100;
461 name: "event_blocker";
463 state: "default" 0.0;
468 state: "enabled" 0.0;
469 inherit: "default" 0.0;
477 program { name: "load";
482 append_str(prev, "");
483 append_str(next, "");
488 program { name: "hide_arrows";
489 signal: "elm,state,button,hidden";
491 action: STATE_SET "hidden" 0.0;
493 target: "arrow_bottom";
498 program { name: "show_arrows";
499 signal: "elm,state,button,visible";
501 action: STATE_SET "default" 0.0;
503 target: "arrow_bottom";
508 program { name: "up";
509 signal: "mouse,down,1";
511 action: SIGNAL_EMIT "elm,action,up,start" "";
513 program { name: "up,stop";
514 signal: "mouse,up,1";
516 action: SIGNAL_EMIT "elm,action,up,stop" "";
518 program { name: "down";
519 signal: "mouse,down,1";
521 action: SIGNAL_EMIT "elm,action,down,start" "";
523 program { name: "down,stop";
524 signal: "mouse,up,1";
526 action: SIGNAL_EMIT "elm,action,down,stop" "";
528 program { name: "disable";
529 signal: "elm,state,disabled";
531 action: STATE_SET "enabled" 0.0;
533 target: "event_blocker";
535 program { name: "enable";
536 signal: "elm,state,enabled";
538 action: STATE_SET "default" 0.0;
540 target: "event_blocker";