tizen 2.3.1 release
[framework/uifw/efl-theme-tizen.git] / 2.3-mobile / widgets_default / flipselector.edc
1
2 #define FLIP_PICKER_MAX_LEN (50)
3 #define FLIP_PICKER_MAX_LEN_STR "50"
4
5 group { name: "elm/flipselector/base/default";
6    images {
7       image: "whitetheme/flip_base.png" COMP;
8       image: "whitetheme/flip_shad.png" COMP;
9       image: "core_icon_picker_arrow_down.png" COMP;
10       image: "core_icon_picker_arrow_up.png" COMP;
11       image: "whitetheme/flip_t.png" COMP;
12       image: "whitetheme/flip_b.png" COMP;
13    }
14    data {
15       item: "max_len" FLIP_PICKER_MAX_LEN_STR;
16    }
17    script {
18       public cur, prev, next, lock;
19       flip_up(str[]) {
20          new tmp[FLIP_PICKER_MAX_LEN];
21          if (get_int(lock) == 1) {
22             replace_str(next, 0, str);
23             return;
24          }
25          fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN);
26
27          set_text(PART:"bottom_b", tmp);
28
29          set_state(PART:"elm.top", "shrink", 0.0);
30          set_text(PART:"elm.top", tmp);
31          set_state(PART:"elm.top", "default", 0.0);
32          set_text(PART:"elm.top", tmp);
33
34          replace_str(prev, 0, tmp);
35
36          set_state(PART:"elm.bottom", "default", 0.0);
37          set_text(PART:"elm.bottom", str);
38          set_state(PART:"elm.bottom", "shrink", 0.0);
39          set_text(PART:"elm.bottom", str);
40
41          set_text(PART:"top_b", str);
42
43          replace_str(cur, 0, str);
44
45          set_state(PART:"bottom_sheet", "shrink", 0.0);
46          set_state(PART:"top_sheet", "default", 0.0);
47
48          set_int(lock, 1);
49          set_state(PART:"shadow", "default", 0.0);
50          anim(0.2, "animator_top_down", 1);
51       }
52
53       flip_dn(str[]) {      
54          new tmp[FLIP_PICKER_MAX_LEN];
55          if (get_int(lock) == 1) {
56             replace_str(next, 0, str);
57             return;
58          }
59
60          fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN);
61
62          set_text(PART:"top_b", tmp);
63
64          set_state(PART:"elm.bottom", "shrink", 0.0);
65          set_text(PART:"elm.bottom", tmp);
66          set_state(PART:"elm.bottom", "default", 0.0);
67          set_text(PART:"elm.bottom", tmp);
68
69          replace_str(prev, 0, tmp);
70
71          set_state(PART:"elm.top", "default", 0.0);
72          set_text(PART:"elm.top", str);
73          set_state(PART:"elm.top", "shrink", 0.0);
74          set_text(PART:"elm.top", str);
75
76          set_text(PART:"bottom_b", str);
77
78          replace_str(cur, 0, str);
79
80          set_state(PART:"bottom_sheet", "default", 0.0);
81          set_state(PART:"top_sheet", "shrink", 0.0);
82
83          set_int(lock, 1);
84          set_state(PART:"shadow", "full", 0.0);
85          anim(0.2, "animator_bottom_up", 1);
86       }
87       
88       public animator_bottom_down(val, Float:pos) {
89          new tmp[FLIP_PICKER_MAX_LEN];
90
91          set_tween_state(PART:"elm.bottom", pos, "shrink", 0.0, "default", 0.0);
92          set_tween_state(PART:"bottom_sheet", pos, "shrink", 0.0, "default",
93          0.0);
94          set_tween_state(PART:"shadow", pos, "half", 0.0, "full",
95          0.0);
96
97          if (pos >= 1.0) {
98             set_state(PART:"shadow", "default", 0.0);
99             set_int(lock, 0);
100
101             fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN);
102             if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) {
103                replace_str(next, 0, "");
104                flip_up(tmp);
105             }
106          }
107       }
108
109       public animator_top_down(val, Float:pos) {
110          set_tween_state(PART:"elm.top", pos, "default", 0.0, "shrink", 0.0);
111          set_tween_state(PART:"top_sheet", pos, "default", 0.0, "shrink",
112          0.0);
113          set_tween_state(PART:"shadow", pos, "default", 0.0, "half",
114          0.0);
115
116          if (pos >= 1.0)
117          anim(0.2, "animator_bottom_down", val);
118       }
119
120       public animator_bottom_up(val, Float:pos) {
121          set_tween_state(PART:"elm.bottom", pos, "default", 0.0, "shrink", 0.0);
122          set_tween_state(PART:"bottom_sheet", pos, "default", 0.0, "shrink",
123          0.0);
124          set_tween_state(PART:"shadow", pos, "full", 0.0, "half",
125          0.0);
126
127          if (pos >= 1.0)
128          anim(0.2, "animator_top_up", val);
129       }
130
131       public animator_top_up(val, Float:pos) {
132          new tmp[FLIP_PICKER_MAX_LEN];
133
134          set_tween_state(PART:"elm.top", pos, "shrink", 0.0, "default", 0.0);
135          set_tween_state(PART:"top_sheet", pos, "shrink", 0.0, "default",
136          0.0);
137          set_tween_state(PART:"shadow", pos, "half", 0.0, "default",
138          0.0);
139
140          if (pos >= 1.0) {
141             set_state(PART:"shadow", "default", 0.0);
142             set_int(lock, 0);
143
144             fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN);
145             if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) {
146                replace_str(next, 0, "");
147                flip_dn(tmp);
148             }
149          }
150       }
151
152       public message(Msg_Type:type, id, ...) {
153          // flip down 
154          if ((type == MSG_STRING) && (id == 1)) {
155             new value[FLIP_PICKER_MAX_LEN];
156             snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2));
157             flip_up(value);
158          }
159
160          // flip up 
161          if ((type == MSG_STRING) && (id == 2)) {
162             new value[FLIP_PICKER_MAX_LEN];
163             snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2));
164             flip_dn(value);
165          }
166       }
167    }
168    parts {     
169       part { name: "base";
170          scale: 1;
171          description { state: "default" 0.0;
172             min: FLIP_SELECTOR_BG_MIN_INC;
173             image{
174                normal: "whitetheme/flip_base.png";
175                border: FLIP_SELECTOR_BG_BORDER_INC;
176             }
177          }
178       }
179       part { name: "b";
180          type: RECT;
181          mouse_events: 1;
182          description { state: "default" 0.0;
183             color: FLIP_SELECTOR_COLOR_TRANSPARENT;
184             rel1 {
185                to: "base";
186                relative: 0.0 0.5;
187             }
188             rel2.to: "base";
189          }
190          description { state: "hidden" 0.0;
191             inherit: "default" 0.0;
192             visible: 0;
193          }
194       }
195       part { name: "t";
196          type: RECT;
197          mouse_events: 1;
198          description { state: "default" 0.0;
199             color: FLIP_SELECTOR_COLOR_TRANSPARENT;
200             rel1.to: "base";
201             rel2 {
202                to: "base";
203                relative: 1.0 0.5;
204             }
205          }
206          description { state: "hidden" 0.0;
207             inherit: "default" 0.0;
208             visible: 0;
209          }
210       }
211       part { name: "bottom_sheet_static";
212          mouse_events: 0;
213          description { state: "default" 0.0;
214             visible: 1;
215             rel1.to: "b";
216             rel2.to: "b";
217             image {
218                normal: "whitetheme/flip_b.png";            
219                border: FLIP_SELECTOR_BG_PARTS_BORDER_INC;
220                border_scale: 1;
221             }
222          }
223       }
224       part { name: "bottom_b";
225          mouse_events: 0;
226          clip_to: "bottom_clipper";
227          type: TEXT;
228          scale: 1;
229          description { state: "default" 0.0;
230             color: FLIP_SELECTOR_TEXT_COLOR_INC;
231             color2: FLIP_SELECTOR_TEXT_SHADOW_COLOR_INC;
232             rel1 {
233                to_x: "elm.padding.text.left";
234                to_y: "base";
235                relative: 1 0;
236             }
237             rel2 {
238                to_x: "elm.padding.text.right";
239                to_y: "base";
240                relative: 0 1;
241             }
242             text {
243                font: "Tizen:style=Bold";
244                size: FLIP_SELECTOR_TEXT_SIZE_INC;
245                min: 1 1;
246                align: 0.5 0.5;
247             }
248          }
249       }
250       part { name: "shadow";
251          mouse_events: 0;
252          description { state: "default" 0.0;
253             rel1.to: "b";
254             rel2 {
255                to: "b";
256                relative: 1.0 0.0;
257             }
258             image.normal: "whitetheme/flip_shad.png";
259          }
260          description { state: "half" 0.0;
261             inherit: "default" 0.0;
262             rel2.relative: 1.0 0.5;
263          }
264          description { state: "full" 0.0;
265             inherit: "default" 0.0;
266             rel2.relative: 1.0 1.0;
267          }
268       }
269       part { name: "bottom_sheet";
270          mouse_events: 0;
271          description { state: "default" 0.0;
272             visible: 1;
273             rel1.to: "b";
274             rel2.to: "b";
275             image {
276                normal: "whitetheme/flip_b.png";
277                border : FLIP_SELECTOR_BG_PARTS_BORDER_INC;
278                border_scale: 1;
279             }
280          }
281          description { state: "shrink" 0.0;
282             inherit: "default" 0.0;
283             visible: 0;
284             rel2.relative: 1.0 0.0;
285          }
286       }
287       part { name: "elm.padding.text.left";
288          mouse_events: 0;
289          type: SPACER;
290          scale: 1;
291          description { state: "default" 0.0;
292             align: 0 0.5;
293             min: FLIP_SELECTOR_TEXT_PADDING_SIZE_DEFAULT 0;
294             fixed: 1 0;
295             rel1.to: "base";
296             rel2 {
297                to: "base";
298                relative: 0 1;
299             }
300          }
301       }
302       part { name: "elm.padding.text.right";
303          mouse_events: 0;
304          type: SPACER;
305          scale: 1;
306          description { state: "default" 0.0;
307             align: 1 0.5;
308             min: FLIP_SELECTOR_TEXT_PADDING_SIZE_DEFAULT 0;
309             fixed: 1 0;
310             rel1 {
311                to: "base";
312                relative: 1 0;
313             }
314             rel2.to: "base";
315             
316          }
317       }
318       part { name: "elm.bottom";
319          mouse_events: 0;
320          clip_to: "bottom_clipper";
321          type: TEXT;
322          scale: 1;
323          description { state: "default" 0.0;
324             color: FLIP_SELECTOR_TEXT_COLOR_INC;
325             color2: FLIP_SELECTOR_TEXT_SHADOW_COLOR_INC;
326             rel1 {
327                to_x: "elm.padding.text.left";
328                to_y: "base";
329                relative: 1 0;
330             }
331             rel2 {
332                to_x: "elm.padding.text.right";
333                to_y: "base";
334                relative: 0 1;
335             }
336             text {
337                font: "Tizen:style=Bold";
338                size: FLIP_SELECTOR_TEXT_SIZE_INC;
339                min: 1 1;
340                align: 0.5 0.5;
341             }
342          }
343          description { state: "shrink" 0.0;
344             inherit: "default" 0.0;
345             color: FLIP_SELECTOR_SHRINK_INC;
346             visible: 0;
347             rel2.relative: 1.0 0.5; // FIXME: same visual effect? --> MAP!
348          }
349       }
350       part { name: "top_sheet_static";
351          mouse_events: 0;
352          description { state: "default" 0.0;
353             visible: 1;
354             rel1 {
355                to: "t";
356                offset: 0 1;
357             }
358             rel2.to: "t";
359             image {
360                normal: "whitetheme/flip_t.png";
361                border : FLIP_SELECTOR_BG_PARTS_BORDER_INC;
362                border_scale: 1;
363             }
364          }
365       }
366       part { name: "top_b";
367          mouse_events: 0;
368          clip_to: "top_clipper";
369          type: TEXT;
370          scale: 1;
371          description { state: "default" 0.0;
372             color: FLIP_SELECTOR_TEXT_COLOR_INC;
373             color2: FLIP_SELECTOR_TEXT_SHADOW_COLOR_INC;
374             rel1 {
375                to_x: "elm.padding.text.left";
376                to_y: "base";
377                relative: 1 0;
378             }
379             rel2 {
380                to_x: "elm.padding.text.right";
381                to_y: "base";
382                relative: 0 1;
383             }
384             text {
385                font: "Tizen:style=Bold";
386                size: FLIP_SELECTOR_TEXT_SIZE_INC;
387                min: 0 1;
388                align: 0.5 0.5;
389                source: "elm.top";
390             }
391          }
392       }
393       part { name: "top_sheet";
394          mouse_events: 0;
395          description { state: "default" 0.0;
396             visible: 1;
397             rel1.to: "t";
398             rel2.to: "t";
399             image {
400                normal: "whitetheme/flip_t.png";
401                border : FLIP_SELECTOR_BG_PARTS_BORDER_INC;
402                border_scale: 1;
403             }
404          }
405          description { state: "shrink" 0.0;
406             inherit: "default" 0.0;
407             color: FLIP_SELECTOR_SHRINK_INC;
408             visible: 0;
409             rel1.relative: 0.0 1.0;
410          }
411       }
412       part { name: "elm.top";
413          mouse_events: 0;
414          clip_to: "top_clipper";
415          type: TEXT;
416          scale: 1;
417          description { state: "default" 0.0;
418             color: FLIP_SELECTOR_TEXT_COLOR_INC;
419             color2: FLIP_SELECTOR_TEXT_SHADOW_COLOR_INC;
420             rel1 {
421                to_x: "elm.padding.text.left";
422                to_y: "base";
423                relative: 1 0;
424             }
425             rel2 {
426                to_x: "elm.padding.text.right";
427                to_y: "base";
428                relative: 0 1;
429             }
430             text {
431                font: "Tizen:style=Bold";
432                size: FLIP_SELECTOR_TEXT_SIZE_INC;
433                min: 1 1;
434                align: 0.5 0.5;
435             }
436          }
437          description { state: "shrink" 0.0;
438             inherit: "default" 0.0;
439             visible: 0;
440             rel1.relative: 0.0 0.5;
441          }
442       }
443       part { name: "arrow_top";
444          mouse_events: 0;
445          clip_to: "disclip";
446          scale: 1;
447          description { state: "default" 0.0;
448             min: FLIP_SELECTOR_ARROW_SIZE;
449             max: FLIP_SELECTOR_ARROW_SIZE;
450             align: 0.5 0.1;
451             rel1.to: "t";
452             rel2.to: "t";
453             image.normal: "core_icon_picker_arrow_up.png";
454             color: 111 125 142 255; /*(Changeable UI) color_class: "F032L1";*/
455          }
456          description { state: "hidden" 0.0;
457             inherit: "default" 0.0;
458             visible: 0;
459          }
460       }
461       part { name: "arrow_bottom";
462          mouse_events: 0;
463          clip_to: "disclip";
464          scale: 1;
465          description { state: "default" 0.0;
466             min: FLIP_SELECTOR_ARROW_SIZE;
467             max: FLIP_SELECTOR_ARROW_SIZE;
468             align: 0.5 0.9;
469             rel1.to: "b";
470             rel2.to: "b";
471             image.normal: "core_icon_picker_arrow_down.png";
472             color: 111 125 142 255; /*(Changeable UI) color_class: "F032L1";*/
473          }
474          description { state: "hidden" 0.0;
475             inherit: "default" 0.0;
476             visible: 0;
477          }
478       }
479       part { name: "top_clipper";
480          type: RECT;
481          mouse_events: 0;
482          clip_to: "disclip";
483          description { state: "default" 0.0;
484             rel1.to: "t";
485             rel2.to: "t";
486             visible: 1;
487          }
488       }
489       part { name: "bottom_clipper";
490          type: RECT;
491          mouse_events: 0;
492          clip_to: "disclip";
493          description { state: "default" 0.0;
494             rel1.to: "b";
495             rel2.to: "b";
496             visible: 1;
497          }
498       }
499       part { name: "disclip";
500          type: RECT;
501          description { state: "default" 0.0;
502             color: FLIP_SELECTOR_DISCLIP_DEFAULT_COLOR_INC;
503          }
504          description { state: "enabled" 0.0;
505             color: FLIP_SELECTOR_DISCLIP_ENABLE_COLOR_INC;
506          }
507       }
508       part { name: "event_blocker";
509          type: RECT;
510          description { state: "default" 0.0;
511             color: FLIP_SELECTOR_COLOR_TRANSPARENT;
512             visible: 0;
513          }
514          description { state: "enabled" 0.0;
515             inherit: "default" 0.0;
516             visible: 1;
517          }
518       }
519    }
520    programs {
521       program { name: "load";
522          signal: "load";
523          source: "";
524          script {
525             append_str(cur, "");
526             append_str(prev, "");
527             append_str(next, "");
528             set_int(lock, 0);
529          }
530       }
531       program { name: "hide_arrows";
532          signal: "elm,state,button,hidden";
533          source: "elm";
534          action: STATE_SET "hidden" 0.0;
535          target: "arrow_top";
536          target: "arrow_bottom";
537          target: "t";
538          target: "b";
539       }
540       program { name: "show_arrows";
541          signal: "elm,state,button,visible";
542          source: "elm";
543          action: STATE_SET "default" 0.0;
544          target: "arrow_top";
545          target: "arrow_bottom";
546          target: "t";
547          target: "b";
548       }
549       program { name: "up";
550          signal: "mouse,down,1";
551          source: "t";
552          action: SIGNAL_EMIT "elm,action,up,start" "";
553       }
554       program { name: "up,stop";
555          signal: "mouse,up,1";
556          source: "t";
557          action: SIGNAL_EMIT "elm,action,up,stop" "";
558       }
559       program { name: "down";
560          signal: "mouse,down,1";
561          source: "b";
562          action: SIGNAL_EMIT "elm,action,down,start" "";
563       }
564       program { name: "down,stop";
565          signal: "mouse,up,1";
566          source: "b";
567          action: SIGNAL_EMIT "elm,action,down,stop" "";
568       }
569       program { name: "disable";
570          signal: "elm,state,disabled";
571          source: "elm";
572          action: STATE_SET "enabled" 0.0;
573          target: "disclip";
574          target: "event_blocker";
575       }
576        program { name: "enable";
577          signal: "elm,state,enabled";
578          source: "elm";
579          action: STATE_SET "default" 0.0;
580          target: "disclip";
581          target: "event_blocker";
582        }
583    }
584 }
585