1 #define BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC 249 249 249 255
2 #define BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC 249 249 249 255
3 #define BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC 249 249 249 255
4 #define BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC 249 249 249 102
5 #define BUTTON_TEXT_STYLE1_TEXT_DISABLED_COLOR_INC 180 180 1 255
7 #define BUTTON_TEXT_STYLE2_BG_MIN_INC 100 72
8 #define BUTTON_TEXT_STYLE2_VISIBLE_BG_MIN_INC 148 74
9 #define BUTTON_TEXT_STYLE2_ICONONLY_BG_MIN_INC 74 74
10 #define BUTTON_TEXT_STYLE2_BG_BORDER_INC 5 5 5 5
11 #define BUTTON_TEXT_STYLE2_PADDING_MIN_INC 5 3
12 #define BUTTON_TEXT_STYLE2_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38
13 #define BUTTON_TEXT_STYLE2_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0
14 #define BUTTON_TEXT_STYLE2_VISIBLE_ICON_MIN_MAX_INC 38 38
15 #define BUTTON_TEXT_STYLE2_ICONONLY_ICON_MIN_MAX_INC 38 38
16 #define BUTTON_TEXT_STYLE2_FONT_SIZE_INC 36
17 #define BUTTON_TEXT_STYLE2_MULTILINE_FONT_SIZE_INC 32
19 #define BUTTON_STATE_ENABLED 0
20 #define BUTTON_STATE_DISABLED 1
24 name: "touch_sound" AS_IS;
25 source: "S_Touch_30ms.wav";
29 group { name: "elm/button/base/pwlock/lang_btn";
31 image: "A01-9_button_background_nomal_nomal.png" COMP;
32 image: "A01-9_button_background_nomal_press.png" COMP;
33 image: "A01-9_button_background_nomal_dim.png" COMP;
34 image: "A01-9_button_background_nomal_focus.png" COMP;
37 public button_state = BUTTON_STATE_ENABLED;
40 part { name: "button_image";
42 description { state: "default" 0.0;
44 normal: "A01-9_button_background_nomal_nomal.png";
45 border: BUTTON_TEXT_STYLE2_BG_BORDER_INC;
49 description { state: "clicked" 0.0;
50 inherit: "default" 0.0;
51 image.normal: "A01-9_button_background_nomal_press.png";
53 description { state: "disabled" 0.0;
54 inherit: "default" 0.0;
55 image.normal: "A01-9_button_background_nomal_dim.png";
57 description { state: "focused" 0.0;
58 inherit: "default" 0.0;
59 image.normal: "A01-9_button_background_nomal_focus.png";
62 part { name: "padding_left_top";
66 description { state: "default" 0.0;
68 rel2.relative: 0.0 0.0;
69 min: BUTTON_TEXT_STYLE2_PADDING_MIN_INC;
78 description { state: "default" 0.0;
79 min: BUTTON_TEXT_STYLE2_BG_MIN_INC;
82 description { state: "visible" 0.0;
83 inherit: "default" 0.0;
84 min: BUTTON_TEXT_STYLE2_VISIBLE_BG_MIN_INC;
86 description { state: "icononly" 0.0;
87 inherit: "default" 0.0;
88 min: BUTTON_TEXT_STYLE2_ICONONLY_BG_MIN_INC;
91 part { name: "padding_right_bottom";
95 description { state: "default" 0.0;
97 rel1.relative: 1.0 1.0;
98 min: BUTTON_TEXT_STYLE2_PADDING_MIN_INC;
103 part { name: "icon_rect";
107 description { state: "default" 0.0;
113 to: "padding_left_top";
117 to_x: "padding_left_top";
118 to_y: "padding_right_bottom";
122 description { state: "visible" 0.0;
124 min: BUTTON_TEXT_STYLE2_VISIBLE_ICON_RECT_MIN_MAX_INC;
125 max: BUTTON_TEXT_STYLE2_VISIBLE_ICON_RECT_MIN_MAX_INC;
129 to: "padding_left_top";
133 to_x: "padding_left_top";
134 to_y: "padding_right_bottom";
138 description { state: "icononly" 0.0;
139 inherit: "default" 0.0;
142 part { name: "padding_after_icon";
146 description { state: "default" 0.0; //when only icon or no icon is there
152 rel2.to: "icon_rect";
157 description { state: "visible" 0.0;
164 rel2.to: "icon_rect";
166 min: BUTTON_TEXT_STYLE2_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
168 description { state: "icononly" 0.0;
169 inherit: "default" 0.0;
172 part { name: "padding_before_text";
176 description { state: "default" 0.0; //when only icon or no icon is there
181 to_y: "padding_left_top";
186 to_y: "padding_right_bottom";
189 min: BUTTON_TEXT_STYLE2_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
193 part { name: "elm.swallow.content";
197 description { state: "default" 0.0;
202 to: "padding_left_top";
206 to_x: "padding_left_top";
207 to_y: "padding_right_bottom";
211 description { state: "visible" 0.0;
213 min: BUTTON_TEXT_STYLE2_VISIBLE_ICON_MIN_MAX_INC;
214 max: BUTTON_TEXT_STYLE2_VISIBLE_ICON_MIN_MAX_INC;
218 to_x: "padding_before_text";
219 to_y: "padding_left_top";
223 to_x: "padding_before_text";
224 to_y: "padding_right_bottom";
227 description { state: "icononly" 0.0;
228 min: BUTTON_TEXT_STYLE2_ICONONLY_ICON_MIN_MAX_INC;
229 max: BUTTON_TEXT_STYLE2_ICONONLY_ICON_MIN_MAX_INC;
232 part { name: "elm.text";
237 description { state: "default" 0.0;
241 to_x: "padding_after_icon";
242 to_y: "padding_left_top";
246 to: "padding_right_bottom";
248 color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC;
250 font: "SLP:style=Medium";
251 size: BUTTON_TEXT_STYLE2_FONT_SIZE_INC;
254 text_class: "slp_medium";
257 description { state: "visible" 0.0;
258 inherit: "default" 0.0;
261 description { state: "clicked" 0.0;
262 inherit: "default" 0.0;
264 color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC;
266 description { state: "disabled" 0.0;
267 inherit: "default" 0.0;
270 description { state: "disabled_visible" 0.0;
271 inherit: "default" 0.0;
272 color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC;
275 description { state: "focused" 0.0;
276 inherit: "default" 0.0;
278 color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC;
281 part { name: "over2";
284 ignore_flags: ON_HOLD;
285 description { state: "default" 0.0;
289 part { name: "over3";
292 description { state: "default" 0.0;
296 part { name: "clipper";
298 description { state: "default" 0.0;
299 color: 255 255 255 255;
302 part { name: "disabler";
304 description { state: "default" 0.0;
308 description { state: "disabled" 0.0;
309 inherit: "default" 0.0;
315 program { name: "button_click";
316 signal: "mouse,down,1";
318 action: SIGNAL_EMIT "elm,action,press" "";
319 after: "button_click_anim";
321 program { name: "button_click_anim";
322 action: STATE_SET "clicked" 0.0;
323 target: "button_image";
324 after: "text_clicked";
326 program { name: "text_clicked";
330 get_state(PART:"elm.text", st, 30, vl);
331 if (!strcmp(st, "visible"))
332 set_state(PART:"elm.text", "clicked", 0.0);
335 program { name: "button_unpress";
336 action: SIGNAL_EMIT "elm,action,unpress" "";
338 program { name: "button_mouseout_clicked";
339 signal: "mouse,up,1";
344 get_state(PART:"elm.swallow.content", st, 30, vl);
345 if (strcmp(st, "icononly"))
347 emit("elm,action,default,text,set", "");
348 set_state(PART:"elm.text", "visible", 0.0);
350 if (get_int(button_state) != BUTTON_STATE_DISABLED)
351 set_state(PART:"button_image", "default", 0.0);
353 after: button_unpress;
355 program { name: "touch_snd";
356 signal: "mouse,clicked,1";
358 action: PLAY_SAMPLE "touch_sound" 1.0;
359 after: button_unclick3;
361 program { name: "button_unclick3";
362 action: SIGNAL_EMIT "elm,action,click" "";
364 program { name: "text_show";
365 signal: "elm,state,text,visible";
370 get_state(PART:"elm.swallow.content", st, 30, vl);
371 if (!strcmp(st, "icononly"))
373 set_state(PART:"elm.swallow.content", "visible", 0.0);
374 set_state(PART:"icon_rect", "visible", 0.0);
375 set_state(PART:"padding_after_icon", "visible", 0.0);
376 set_state(PART:"bg", "visible", 0.0);
378 if (get_int(button_state) != BUTTON_STATE_DISABLED)
379 set_state(PART:"elm.text", "visible", 0.0);
381 set_state(PART:"elm.text", "disabled_visible", 0.0);
384 program { name: "text_hide";
385 signal: "elm,state,text,hidden";
390 get_state(PART:"elm.swallow.content", st, 30, vl);
391 if (!strcmp(st, "visible"))
393 set_state(PART:"elm.swallow.content", "icononly", 0.0);
394 set_state(PART:"icon_rect", "icononly", 0.0);
395 set_state(PART:"padding_after_icon", "icononly", 0.0);
396 set_state(PART:"bg", "icononly", 0.0);
398 set_state(PART:"elm.text", "default", 0.0);
401 program { name: "icon_show";
402 signal: "elm,state,icon,visible";
407 get_state(PART:"elm.text", st, 30, vl);
408 if (!strcmp(st, "visible"))
410 set_state(PART:"elm.swallow.content", "visible", 0.0);
411 set_state(PART:"icon_rect", "visible", 0.0);
412 set_state(PART:"padding_after_icon", "visible", 0.0);
413 set_state(PART:"bg", "visible", 0.0);
417 set_state(PART:"elm.swallow.content", "icononly", 0.0);
418 set_state(PART:"icon_rect", "icononly", 0.0);
419 set_state(PART:"padding_after_icon", "icononly", 0.0);
420 set_state(PART:"bg", "icononly", 0.0);
424 program { name: "icon_hide";
425 signal: "elm,state,icon,hidden";
427 action: STATE_SET "default" 0.0;
428 target: "elm.swallow.content";
429 target: "padding_after_icon";
433 program { name: "disable";
434 signal: "elm,state,disabled";
436 action: STATE_SET "disabled" 0.0;
437 target: "button_image";
439 after: "disable_text";
441 program { name: "disable_text";
445 get_state(PART:"elm.text", st, 30, vl);
446 if (!strcmp(st, "visible"))
447 set_state(PART:"elm.text", "disabled_visible", 0.0);
449 set_state(PART:"elm.text", "disabled", 0.0);
450 set_int(button_state, BUTTON_STATE_DISABLED);
453 program { name: "enable";
454 signal: "elm,state,enabled";
456 action: STATE_SET "default" 0.0;
457 target: "button_image";
459 after: "enable_text";
461 program { name: "enable_text";
465 get_state(PART:"elm.text", st, 30, vl);
466 if (!strcmp(st, "disabled_visible"))
467 set_state(PART:"elm.text", "visible", 0.0);
469 set_state(PART:"elm.text", "default", 0.0);
470 set_int(button_state, BUTTON_STATE_ENABLED);
473 program { name: "focused";
474 //signal: "elm,action,focus";
476 action: STATE_SET "focused" 0.0;
477 target: "button_image";
480 program { name: "unfocused";
481 //signal: "elm,action,unfocus";
483 action: STATE_SET "default" 0.0;
484 target: "button_image";
485 after: "unfocus_text";
487 program { name: "unfocus_text";
488 action: STATE_SET "visible" 0.0;
494 group { name: "elm/button/base/pwlock/bottom_btn";
496 image: "A01-9_button_bottom_nomal.png" COMP;
497 image: "A01-9_button_bottom_nomal_press.png" COMP;
498 image: "A01-9_button_bottom_nomal_dim.png" COMP;
499 image: "A01-9_button_bottom_nomal_focus.png" COMP;
502 public button_state = BUTTON_STATE_ENABLED;
505 part { name: "button_image";
507 description { state: "default" 0.0;
509 normal: "A01-9_button_bottom_nomal.png";
510 border: BUTTON_TEXT_STYLE2_BG_BORDER_INC;
514 description { state: "clicked" 0.0;
515 inherit: "default" 0.0;
516 image.normal: "A01-9_button_bottom_nomal_press.png";
518 description { state: "disabled" 0.0;
519 inherit: "default" 0.0;
520 image.normal: "A01-9_button_bottom_nomal_dim.png";
522 description { state: "focused" 0.0;
523 inherit: "default" 0.0;
524 image.normal: "A01-9_button_bottom_nomal_focus.png";
527 part { name: "padding_left_top";
531 description { state: "default" 0.0;
533 rel2.relative: 0.0 0.0;
534 min: BUTTON_TEXT_STYLE2_PADDING_MIN_INC;
543 description { state: "default" 0.0;
544 min: BUTTON_TEXT_STYLE2_BG_MIN_INC;
547 description { state: "visible" 0.0;
548 inherit: "default" 0.0;
549 min: BUTTON_TEXT_STYLE2_VISIBLE_BG_MIN_INC;
551 description { state: "icononly" 0.0;
552 inherit: "default" 0.0;
553 min: BUTTON_TEXT_STYLE2_ICONONLY_BG_MIN_INC;
556 part { name: "padding_right_bottom";
560 description { state: "default" 0.0;
562 rel1.relative: 1.0 1.0;
563 min: BUTTON_TEXT_STYLE2_PADDING_MIN_INC;
568 part { name: "icon_rect";
572 description { state: "default" 0.0;
578 to: "padding_left_top";
582 to_x: "padding_left_top";
583 to_y: "padding_right_bottom";
587 description { state: "visible" 0.0;
589 min: BUTTON_TEXT_STYLE2_VISIBLE_ICON_RECT_MIN_MAX_INC;
590 max: BUTTON_TEXT_STYLE2_VISIBLE_ICON_RECT_MIN_MAX_INC;
594 to: "padding_left_top";
598 to_x: "padding_left_top";
599 to_y: "padding_right_bottom";
603 description { state: "icononly" 0.0;
604 inherit: "default" 0.0;
607 part { name: "padding_after_icon";
611 description { state: "default" 0.0; //when only icon or no icon is there
617 rel2.to: "icon_rect";
622 description { state: "visible" 0.0;
629 rel2.to: "icon_rect";
631 min: BUTTON_TEXT_STYLE2_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
633 description { state: "icononly" 0.0;
634 inherit: "default" 0.0;
637 part { name: "padding_before_text";
641 description { state: "default" 0.0; //when only icon or no icon is there
646 to_y: "padding_left_top";
651 to_y: "padding_right_bottom";
654 min: BUTTON_TEXT_STYLE2_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
658 part { name: "elm.swallow.content";
662 description { state: "default" 0.0;
667 to: "padding_left_top";
671 to_x: "padding_left_top";
672 to_y: "padding_right_bottom";
676 description { state: "visible" 0.0;
678 min: BUTTON_TEXT_STYLE2_VISIBLE_ICON_MIN_MAX_INC;
679 max: BUTTON_TEXT_STYLE2_VISIBLE_ICON_MIN_MAX_INC;
683 to_x: "padding_before_text";
684 to_y: "padding_left_top";
688 to_x: "padding_before_text";
689 to_y: "padding_right_bottom";
692 description { state: "icononly" 0.0;
693 min: BUTTON_TEXT_STYLE2_ICONONLY_ICON_MIN_MAX_INC;
694 max: BUTTON_TEXT_STYLE2_ICONONLY_ICON_MIN_MAX_INC;
697 part { name: "elm.text";
702 description { state: "default" 0.0;
706 to_x: "padding_after_icon";
707 to_y: "padding_left_top";
711 to: "padding_right_bottom";
713 color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC;
715 font: "SLP:style=Medium";
716 size: BUTTON_TEXT_STYLE2_FONT_SIZE_INC;
719 text_class: "slp_medium";
722 description { state: "visible" 0.0;
723 inherit: "default" 0.0;
726 description { state: "clicked" 0.0;
727 inherit: "default" 0.0;
729 color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC;
731 description { state: "disabled" 0.0;
732 inherit: "default" 0.0;
735 description { state: "disabled_visible" 0.0;
736 inherit: "default" 0.0;
737 color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC;
740 description { state: "focused" 0.0;
741 inherit: "default" 0.0;
743 color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC;
746 part { name: "over2";
749 ignore_flags: ON_HOLD;
750 description { state: "default" 0.0;
754 part { name: "over3";
757 description { state: "default" 0.0;
761 part { name: "clipper";
763 description { state: "default" 0.0;
764 color: 255 255 255 255;
767 part { name: "disabler";
769 description { state: "default" 0.0;
773 description { state: "disabled" 0.0;
774 inherit: "default" 0.0;
780 program { name: "button_click";
781 signal: "mouse,down,1";
783 action: SIGNAL_EMIT "elm,action,press" "";
784 after: "button_click_anim";
786 program { name: "button_click_anim";
787 action: STATE_SET "clicked" 0.0;
788 target: "button_image";
789 after: "text_clicked";
791 program { name: "text_clicked";
795 get_state(PART:"elm.text", st, 30, vl);
796 if (!strcmp(st, "visible"))
797 set_state(PART:"elm.text", "clicked", 0.0);
800 program { name: "button_unpress";
801 action: SIGNAL_EMIT "elm,action,unpress" "";
803 program { name: "button_mouseout_clicked";
804 signal: "mouse,up,1";
809 get_state(PART:"elm.swallow.content", st, 30, vl);
810 if (strcmp(st, "icononly"))
812 emit("elm,action,default,text,set", "");
813 set_state(PART:"elm.text", "visible", 0.0);
815 if (get_int(button_state) != BUTTON_STATE_DISABLED)
816 set_state(PART:"button_image", "default", 0.0);
818 after: button_unpress;
820 program { name: "touch_snd";
821 signal: "mouse,clicked,1";
823 action: PLAY_SAMPLE "touch_sound" 1.0;
824 after: button_unclick3;
826 program { name: "button_unclick3";
827 action: SIGNAL_EMIT "elm,action,click" "";
829 program { name: "text_show";
830 signal: "elm,state,text,visible";
835 get_state(PART:"elm.swallow.content", st, 30, vl);
836 if (!strcmp(st, "icononly"))
838 set_state(PART:"elm.swallow.content", "visible", 0.0);
839 set_state(PART:"icon_rect", "visible", 0.0);
840 set_state(PART:"padding_after_icon", "visible", 0.0);
841 set_state(PART:"bg", "visible", 0.0);
843 if (get_int(button_state) != BUTTON_STATE_DISABLED)
844 set_state(PART:"elm.text", "visible", 0.0);
846 set_state(PART:"elm.text", "disabled_visible", 0.0);
849 program { name: "text_hide";
850 signal: "elm,state,text,hidden";
855 get_state(PART:"elm.swallow.content", st, 30, vl);
856 if (!strcmp(st, "visible"))
858 set_state(PART:"elm.swallow.content", "icononly", 0.0);
859 set_state(PART:"icon_rect", "icononly", 0.0);
860 set_state(PART:"padding_after_icon", "icononly", 0.0);
861 set_state(PART:"bg", "icononly", 0.0);
863 set_state(PART:"elm.text", "default", 0.0);
866 program { name: "icon_show";
867 signal: "elm,state,icon,visible";
872 get_state(PART:"elm.text", st, 30, vl);
873 if (!strcmp(st, "visible"))
875 set_state(PART:"elm.swallow.content", "visible", 0.0);
876 set_state(PART:"icon_rect", "visible", 0.0);
877 set_state(PART:"padding_after_icon", "visible", 0.0);
878 set_state(PART:"bg", "visible", 0.0);
882 set_state(PART:"elm.swallow.content", "icononly", 0.0);
883 set_state(PART:"icon_rect", "icononly", 0.0);
884 set_state(PART:"padding_after_icon", "icononly", 0.0);
885 set_state(PART:"bg", "icononly", 0.0);
889 program { name: "icon_hide";
890 signal: "elm,state,icon,hidden";
892 action: STATE_SET "default" 0.0;
893 target: "elm.swallow.content";
894 target: "padding_after_icon";
898 program { name: "disable";
899 signal: "elm,state,disabled";
901 action: STATE_SET "disabled" 0.0;
902 target: "button_image";
904 after: "disable_text";
906 program { name: "disable_text";
910 get_state(PART:"elm.text", st, 30, vl);
911 if (!strcmp(st, "visible"))
912 set_state(PART:"elm.text", "disabled_visible", 0.0);
914 set_state(PART:"elm.text", "disabled", 0.0);
915 set_int(button_state, BUTTON_STATE_DISABLED);
918 program { name: "enable";
919 signal: "elm,state,enabled";
921 action: STATE_SET "default" 0.0;
922 target: "button_image";
924 after: "enable_text";
926 program { name: "enable_text";
930 get_state(PART:"elm.text", st, 30, vl);
931 if (!strcmp(st, "disabled_visible"))
932 set_state(PART:"elm.text", "visible", 0.0);
934 set_state(PART:"elm.text", "default", 0.0);
935 set_int(button_state, BUTTON_STATE_ENABLED);
938 program { name: "focused";
939 //signal: "elm,action,focus";
941 action: STATE_SET "focused" 0.0;
942 target: "button_image";
945 program { name: "unfocused";
946 //signal: "elm,action,unfocus";
948 action: STATE_SET "default" 0.0;
949 target: "button_image";
950 after: "unfocus_text";
952 program { name: "unfocus_text";
953 action: STATE_SET "visible" 0.0;