4 * Copyright (c) 2000 - 2010 Samsung Electronics Co., Ltd.
6 * Contact: Seokjae Jeong <seok.j.jeong@samsung.com>, Myoungwoon Roy Kim <Myoungwoon.kim@samsung.com>, Jeonghyun Yun <jh0506.yun@samsung.com>, Jaehwan Kim <jae.hwan.kim@samsung.com>,
7 * Chuneon Park <chuneon.park@samsung.com>, Juyung Seo <juyung.seo@samsung.com>, Woohyun Jung <wh0705.jung@samsung.com>, Myungjae Lee <mjae.lee@samsung.com>, Hyoyoung Chang <hyoyoung.chang@samsung.com>,
8 * Hyunsil Park <hyunsil.park@samsung.com>, Sohyun Kim <anna1014.kim@samsung.com>, Seunggyun Kim <sgyun.kim@samsung.com>
10 * This library is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU Lesser General Public License as published by the
12 * Free Software Foundation; either version 2.1 of the License, or (at your option)
15 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software Foundation, Inc., 51
22 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 //################################################################
29 //################################################################
31 group { name: "elm/segment_control/base/default";
46 #define SEGMENT_TYPE_SINGLE 1
47 #define SEGMENT_TYPE_LEFT 2
48 #define SEGMENT_TYPE_MIDDLE 3
49 #define SEGMENT_TYPE_RIGHT 4
50 #define SEGMENT_STATE_NORMAL 1
51 #define SEGMENT_STATE_PRESSED 2
52 #define SEGMENT_STATE_SELECTED 3
53 #define SEGMENT_STATUS_ENABLED 0
54 #define SEGMENT_STATUS_DISABLED 1
56 group { name: "elm/segment_control/item/default";
57 data.item: "label.wrap.part" "label.bg";
60 image: "00_winset_btn_sge_normal.png" COMP;
61 image: "00_winset_btn_sge_normal_left.png" COMP;
62 image: "00_winset_btn_sge_normal_centre.png" COMP;
63 image: "00_winset_btn_sge_normal_right.png" COMP;
64 image: "00_winset_btn_sge_press_normal.png" COMP;
65 image: "00_winset_btn_sge_press_left.png" COMP;
66 image: "00_winset_btn_sge_press_center.png" COMP;
67 image: "00_winset_btn_sge_press_right.png" COMP;
70 part { name: "segment";
73 description { state: "default" 0.0;
77 normal: "00_winset_btn_sge_normal.png";
83 description { state: "default_single" 0.0;
84 inherit: "default" 0.0;
87 normal: "00_winset_btn_sge_normal.png";
91 description { state: "default_left" 0.0;
92 inherit: "default" 0.0;
95 normal: "00_winset_btn_sge_normal_left.png";
99 description { state: "default_right" 0.0;
100 inherit: "default" 0.0;
103 normal: "00_winset_btn_sge_normal_right.png";
107 description { state: "default_middle" 0.0;
108 inherit: "default" 0.0;
111 normal: "00_winset_btn_sge_normal_centre.png";
115 description { state: "pressed_single" 0.0;
116 inherit: "default" 0.0;
119 normal: "00_winset_btn_sge_press_normal.png";
123 description { state: "pressed_left" 0.0;
124 inherit: "default" 0.0;
127 normal: "00_winset_btn_sge_press_left.png";
131 description { state: "pressed_right" 0.0;
132 inherit: "default" 0.0;
135 normal: "00_winset_btn_sge_press_right.png";
139 description { state: "pressed_middle" 0.0;
140 inherit: "default" 0.0;
143 normal: "00_winset_btn_sge_press_center.png";
147 description { state: "selected_single" 0.0;
148 inherit: "default" 0.0;
151 normal: "00_winset_btn_sge_press_normal.png";
155 description { state: "selected_left" 0.0;
156 inherit: "default" 0.0;
159 normal: "00_winset_btn_sge_press_left.png";
163 description { state: "selected_right" 0.0;
164 inherit: "default" 0.0;
167 normal: "00_winset_btn_sge_press_right.png";
171 description { state: "selected_middle" 0.0;
172 inherit: "default" 0.0;
175 normal: "00_winset_btn_sge_press_center.png";
180 part { name: "padding_left";
184 description { state: "default" 0.0;
186 rel1.relative: 0.0 0.0;
187 rel2.relative: 0.0 1.0;
194 part { name: "padding_right";
198 description { state: "default" 0.0;
200 rel1.relative: 1.0 0.0;
201 rel2.relative: 1.0 1.0;
208 part { name: "padding_top";
212 description { state: "default" 0.0;
214 rel1.relative: 0.0 0.0;
215 rel2.relative: 1.0 0.0;
222 part { name: "padding_bottom";
226 description { state: "default" 0.0;
228 rel1.relative: 0.0 1.0;
229 rel2.relative: 1.0 1.0;
236 part { name: "icon.bg";
240 description { state: "default" 0.0;
243 rel1 {relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_top"; }
244 rel2 {relative: 1.0 1.0; to: "elm.swallow.icon"; }
249 part { name: "padding_icon_text";
253 description { state: "default" 0.0; //when only icon or no icon is there
255 rel1 { relative: 1.0 0.0; to: "icon.bg"; }
256 rel2 { relative: 1.0 1.0; to: "icon.bg"; }
261 description { state: "icononly" 0.0;
262 inherit: "default" 0.0;
264 description { state: "visible" 0.0; //when icon is visible
266 rel1 { relative: 1.0 0.0; to: "icon.bg"; }
267 rel2 { relative: 1.0 1.0; to: "icon.bg"; }
273 part { name: "elm.swallow.icon";
276 description { state: "default" 0.0;
279 rel1 {relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_top"; }
280 rel2 {relative: 0.0 0.0; to_y: "padding_bottom"; }
283 aspect_preference: BOTH;
285 description { state: "visible" 0.0;
286 inherit: "default" 0.0;
288 rel2 {relative: 0.3 0.0; to_y: "padding_bottom"; }
290 description { state: "icononly" 0.0;;
291 inherit: "default" 0.0;
293 rel2 {relative: 0.0 0.0; to_x: "padding_right"; to_y: "padding_bottom"; }
297 part { name: "label.bg";
300 description { state: "default" 0.0;
301 rel1 { relative: 1.0 1.0; to_x: "padding_icon_text"; to_y: "padding_top"; }
302 rel2 { relative: 0.0 0.0; to_x: "padding_right"; to_y: "padding_bottom"; }
305 part { name: "elm.swallow.label";
310 description { state: "default" 0.0;
315 rel1 { relative: 1.0 1.0; to_x: "padding_icon_text";}
316 rel2 { relative: 0.0 0.0; to_x: "padding_right";}
318 description { state: "visible" 0.0;
319 inherit: "default" 0.0;
323 part { name: "disabler";
326 description { state: "default" 0.0;
331 rel1 { relative: 0.0 0.0; to: "segment";}
332 rel2 { relative: 1.0 1.0; to: "segment";}
333 color: 255 255 255 150;
335 description { state: "disabled_single" 0.0;
336 inherit: "default" 0.0;
339 normal: "00_button_02_normal.png";
343 description { state: "disabled_left" 0.0;
344 inherit: "default" 0.0;
347 normal: "00_winset_btn_sge_normal_left.png";
351 description { state: "disabled_right" 0.0;
352 inherit: "default" 0.0;
355 normal: "00_winset_btn_sge_normal_right.png";
359 description { state: "disabled_middle" 0.0;
360 inherit: "default" 0.0;
363 normal: "00_winset_btn_sge_normal_centre.png";
371 public seg_type; // Single, Left, Middle, Right.
372 public seg_state; // Normal/Default, Pressed, Selected.
373 public seg_status;// Enabled/Default, Disabled
375 public update_state() {
376 new type, state, disabled;
377 type = get_int(seg_type);
378 state = get_int(seg_state);
379 disabled = get_int(seg_status);
381 if(state == SEGMENT_STATE_NORMAL)
383 if(type == SEGMENT_TYPE_SINGLE)
384 set_state(PART:"segment", "default_single", 0.0);
385 else if(type == SEGMENT_TYPE_LEFT)
386 set_state(PART:"segment", "default_left", 0.0);
387 else if(type == SEGMENT_TYPE_MIDDLE)
388 set_state(PART:"segment", "default_middle", 0.0);
389 else if(type == SEGMENT_TYPE_RIGHT)
390 set_state(PART:"segment", "default_right", 0.0);
392 else if(state == SEGMENT_STATE_PRESSED)
394 if(type == SEGMENT_TYPE_SINGLE)
395 set_state(PART:"segment", "pressed_single", 0.0);
396 else if(type == SEGMENT_TYPE_LEFT)
397 set_state(PART:"segment", "pressed_left", 0.0);
398 else if(type == SEGMENT_TYPE_MIDDLE)
399 set_state(PART:"segment", "pressed_middle", 0.0);
400 else if(type == SEGMENT_TYPE_RIGHT)
401 set_state(PART:"segment", "pressed_right", 0.0);
403 else if(state == SEGMENT_STATE_SELECTED)
405 if(type == SEGMENT_TYPE_SINGLE)
406 set_state(PART:"segment", "selected_single", 0.0);
407 else if(type == SEGMENT_TYPE_LEFT)
408 set_state(PART:"segment", "selected_left", 0.0);
409 else if(type == SEGMENT_TYPE_MIDDLE)
410 set_state(PART:"segment", "selected_middle", 0.0);
411 else if(type == SEGMENT_TYPE_RIGHT)
412 set_state(PART:"segment", "selected_right", 0.0);
414 if(disabled == SEGMENT_STATUS_DISABLED)
416 if(type == SEGMENT_TYPE_SINGLE)
417 set_state(PART:"disabler", "disabled_single", 0.0);
418 else if(type == SEGMENT_TYPE_LEFT)
419 set_state(PART:"disabler", "disabled_left", 0.0);
420 else if(type == SEGMENT_TYPE_MIDDLE)
421 set_state(PART:"disabler", "disabled_middle", 0.0);
422 else if(type == SEGMENT_TYPE_RIGHT)
423 set_state(PART:"disabler", "disabled_right", 0.0);
428 name: "segment_type_s";
429 signal: "elm,type,segment,single";
432 set_int(seg_status, SEGMENT_STATUS_ENABLED);
433 set_int(seg_type, SEGMENT_TYPE_SINGLE);
438 name: "segment_type_l";
439 signal: "elm,type,segment,left";
442 set_int(seg_status, SEGMENT_STATUS_ENABLED);
443 set_int(seg_type, SEGMENT_TYPE_LEFT);
448 name: "segment_type_m";
449 signal: "elm,type,segment,middle";
452 set_int(seg_status, SEGMENT_STATUS_ENABLED);
453 set_int(seg_type, SEGMENT_TYPE_MIDDLE);
458 name: "segment_type_r";
459 signal: "elm,type,segment,right";
462 set_int(seg_status, SEGMENT_STATUS_ENABLED);
463 set_int(seg_type, SEGMENT_TYPE_RIGHT);
468 name: "normal_segment";
469 signal: "elm,state,segment,normal";
472 set_int(seg_status, SEGMENT_STATUS_ENABLED);
473 set_int(seg_state, SEGMENT_STATE_NORMAL);
478 name: "pressed_segment";
479 signal: "elm,state,segment,pressed";
482 set_int(seg_status, SEGMENT_STATUS_ENABLED);
483 set_int(seg_state, SEGMENT_STATE_PRESSED);
488 name: "selected_segment";
489 signal: "elm,state,segment,selected";
492 set_int(seg_status, SEGMENT_STATUS_ENABLED);
493 set_int(seg_state, SEGMENT_STATE_SELECTED);
497 program { name: "disable_segment";
498 signal: "elm,state,disabled";
501 set_int(seg_status, SEGMENT_STATUS_DISABLED);
505 program { name: "enable_segment";
506 signal: "elm,state,enabled";
509 set_int(seg_status, SEGMENT_STATUS_ENABLED);
513 program { name: "text_show";
514 signal: "elm,state,text,visible";
521 get_state(PART:"elm.swallow.icon", st, 30, vl);
522 get_state(PART:"elm.swallow.label", st1, 30, vl1);
523 if (!strcmp(st, "icononly"))
525 set_state(PART:"elm.swallow.icon", "visible", 0.0);
526 set_state(PART:"padding_icon_text", "visible", 0.0);
528 set_state(PART:"elm.swallow.label", "visible", 0.0);
531 program { name: "text_hide";
532 signal: "elm,state,text,hidden";
537 get_state(PART:"elm.swallow.icon", st, 30, vl);
538 if (!strcmp(st, "visible"))
540 set_state(PART:"elm.swallow.icon", "icononly", 0.0);
541 set_state(PART:"padding_icon_text", "icononly", 0.0);
543 set_state(PART:"elm.swallow.label", "default", 0.0);
546 program { name: "icon_show";
547 signal: "elm,state,icon,visible";
552 get_state(PART:"elm.swallow.label", st, 30, vl);
553 if (!strcmp(st, "normal"))
555 set_state(PART:"elm.swallow.icon", "visible", 0.0);
556 set_state(PART:"padding_icon_text", "visible", 0.0);
560 set_state(PART:"elm.swallow.icon", "icononly", 0.0);
561 set_state(PART:"padding_icon_text", "icononly", 0.0);
565 program { name: "icon_hide";
566 signal: "elm,state,icon,hidden";
568 action: STATE_SET "default" 0.0;
569 target: "elm.swallow.icon";
574 group { name: "elm/label/base/default/segment_normal";
575 data.item: "default_font_size" "24";
576 data.item: "min_font_size" "16";
577 data.item: "max_font_size" "24";
579 style { name: "seg_text_style_normal";
580 base: "font=SLP:style=Medium font_size=18\
582 color="SEGMENT_CONTROL_ITEM_TITLE_TEXT_STYLE_COLOR_NORMAL_INC" wrap=char";
584 tag: "hilight" "+ font=SLP:style=Bold";
585 tag: "b" "+ font=SLP:style=Bold";
588 style { name: "seg_text_style_pressed";
589 base: "font=SLP:style=Medium font_size=18\
591 color="SEGMENT_CONTROL_ITEM_TITLE_TEXT_STYLE_COLOR_PRESSED_INC" wrap=char";
593 tag: "hilight" "+ font=SLP:style=Bold";
594 tag: "b" "+ font=SLP:style=Bold";
597 style { name: "seg_text_style_selected";
598 base: "font=SLP:style=Medium font_size=18\
599 align=center color="SEGMENT_CONTROL_ITEM_TITLE_TEXT_STYLE_COLOR_SELECTED_INC" \
602 tag: "hilight" "+ font=SLP:style=Bold";
603 tag: "b" "+ font=SLP:style=Bold";
606 style { name: "seg_text_style_disabled";
607 base: "font=SLP:style=Medium font_size=18\
608 align=center color="SEGMENT_CONTROL_ITEM_TITLE_TEXT_STYLE_COLOR_NORMAL_INC" \
611 tag: "hilight" "+ font=SLP:style=Bold";
612 tag: "b" "+ font=SLP:style=Bold";
617 part { name: "label.swallow.background";
619 description { state: "default" 0.0;
621 rel1.relative, 0.0 0.0;
622 rel2.relative, 1.0 1.0;
625 part { name: "label.text.clip";
627 description { state: "default" 0.0;
629 rel1 { relative: 0 0; to: "label.swallow.background"; }
630 rel2 { relative: 1 1; to: "label.swallow.background"; }
633 part { name: "elm.text";
637 clip_to: "label.text.clip";
638 description { state: "default" 0.0;
639 rel1.relative, 0.0 0.0;
640 rel2.relative, 1.0 1.0;
643 style: "seg_text_style_normal";
652 group { name: "elm/label/base/default/segment_selected";
653 data.item: "default_font_size" "24";
654 data.item: "min_font_size" "16";
655 data.item: "max_font_size" "24";
657 part { name: "label.swallow.background";
659 description { state: "default" 0.0;
661 rel1.relative, 0.0 0.0;
662 rel2.relative, 1.0 1.0;
665 part { name: "label.text.clip";
667 description { state: "default" 0.0;
669 rel1 { relative: 0 0; to: "label.swallow.background"; }
670 rel2 { relative: 1 1; to: "label.swallow.background"; }
673 part { name: "elm.text";
677 clip_to: "label.text.clip";
678 description { state: "default" 0.0;
679 rel1.relative, 0.0 0.0;
680 rel2.relative, 1.0 1.0;
683 style: "seg_text_style_selected";
691 group { name: "elm/label/base/default/segment_pressed";
692 data.item: "default_font_size" "24";
693 data.item: "min_font_size" "16";
694 data.item: "max_font_size" "24";
696 part { name: "label.swallow.background";
698 description { state: "default" 0.0;
700 rel1.relative, 0.0 0.0;
701 rel2.relative, 1.0 1.0;
704 part { name: "label.text.clip";
706 description { state: "default" 0.0;
708 rel1 { relative: 0 0; to: "label.swallow.background"; }
709 rel2 { relative: 1 1; to: "label.swallow.background"; }
712 part { name: "elm.text";
716 clip_to: "label.text.clip";
717 description { state: "default" 0.0;
718 rel1.relative, 0.0 0.0;
719 rel2.relative, 1.0 1.0;
722 style: "seg_text_style_pressed";
731 group { name: "elm/label/base/default/segment_disabled";
732 data.item: "default_font_size" "24";
733 data.item: "min_font_size" "16";
734 data.item: "max_font_size" "24";
736 part { name: "label.swallow.background";
738 description { state: "default" 0.0;
740 rel1.relative, 0.0 0.0;
741 rel2.relative, 1.0 1.0;
744 part { name: "label.text.clip";
746 description { state: "default" 0.0;
748 rel1 { relative: 0 0; to: "label.swallow.background"; }
749 rel2 { relative: 1 1; to: "label.swallow.background"; }
752 part { name: "elm.text";
756 clip_to: "label.text.clip";
757 description { state: "default" 0.0;
758 rel1.relative, 0.0 0.0;
759 rel2.relative, 1.0 1.0;
762 style: "seg_text_style_disabled";
772 group { name: "elm/segment_control/base/body_style";
779 state: "default" 0.0;
780 color: 203 193 182 255;
789 group { name: "elm/segment_control/item/body_style";
790 data.item: "label.wrap.part" "label.bg";
793 image: "00_winset_btn_sge_normal.png" COMP;
794 image: "00_winset_btn_sge_body_normal_left.png" COMP;
795 image: "00_winset_btn_sge_body_normal_centre.png" COMP;
796 image: "00_winset_btn_sge_body_normal_right.png" COMP;
797 image: "00_winset_btn_sge_body.png" COMP;
798 image: "00_winset_btn_sge_body_press_center.png" COMP;
799 image: "00_winset_btn_sge_body_press_left.png" COMP;
800 image: "00_winset_btn_sge_body_press_right.png" COMP;
803 part { name: "segment";
806 description { state: "default" 0.0;
810 normal: "00_winset_btn_sge_body.png";
816 description { state: "default_single" 0.0;
817 inherit: "default" 0.0;
820 normal: "00_winset_btn_sge_body.png";
824 description { state: "default_left" 0.0;
825 inherit: "default" 0.0;
828 normal: "00_winset_btn_sge_body_normal_left.png";
832 description { state: "default_right" 0.0;
833 inherit: "default" 0.0;
836 normal: "00_winset_btn_sge_body_normal_right.png";
840 description { state: "default_middle" 0.0;
841 inherit: "default" 0.0;
844 normal: "00_winset_btn_sge_body_normal_centre.png";
848 description { state: "pressed_single" 0.0;
849 inherit: "default" 0.0;
852 normal: "00_winset_btn_sge_normal.png";
856 description { state: "pressed_left" 0.0;
857 inherit: "default" 0.0;
860 normal: "00_winset_btn_sge_body_press_left.png";
864 description { state: "pressed_right" 0.0;
865 inherit: "default" 0.0;
868 normal: "00_winset_btn_sge_body_press_right.png";
872 description { state: "pressed_middle" 0.0;
873 inherit: "default" 0.0;
876 normal: "00_winset_btn_sge_body_press_center.png";
880 description { state: "selected_single" 0.0;
881 inherit: "default" 0.0;
884 normal: "00_winset_btn_sge_normal.png";
888 description { state: "selected_left" 0.0;
889 inherit: "default" 0.0;
892 normal: "00_winset_btn_sge_body_press_left.png";
896 description { state: "selected_right" 0.0;
897 inherit: "default" 0.0;
900 normal: "00_winset_btn_sge_body_press_right.png";
904 description { state: "selected_middle" 0.0;
905 inherit: "default" 0.0;
908 normal: "00_winset_btn_sge_body_press_center.png";
913 part { name: "padding_left";
917 description { state: "default" 0.0;
919 rel1.relative: 0.0 0.0;
920 rel2.relative: 0.0 1.0;
927 part { name: "padding_right";
931 description { state: "default" 0.0;
933 rel1.relative: 1.0 0.0;
934 rel2.relative: 1.0 1.0;
941 part { name: "padding_top";
945 description { state: "default" 0.0;
947 rel1.relative: 0.0 0.0;
948 rel2.relative: 1.0 0.0;
955 part { name: "padding_bottom";
959 description { state: "default" 0.0;
961 rel1.relative: 0.0 1.0;
962 rel2.relative: 1.0 1.0;
969 part { name: "icon.bg";
973 description { state: "default" 0.0;
976 rel1 {relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_top"; }
977 rel2 {relative: 1.0 1.0; to: "elm.swallow.icon"; }
982 part { name: "padding_icon_text";
986 description { state: "default" 0.0; //when only icon or no icon is there
988 rel1 { relative: 1.0 0.0; to: "icon.bg"; }
989 rel2 { relative: 1.0 1.0; to: "icon.bg"; }
994 description { state: "icononly" 0.0;
995 inherit: "default" 0.0;
997 description { state: "visible" 0.0; //when icon is visible
999 rel1 { relative: 1.0 0.0; to: "icon.bg"; }
1000 rel2 { relative: 1.0 1.0; to: "icon.bg"; }
1006 part { name: "elm.swallow.icon";
1009 description { state: "default" 0.0;
1012 rel1 {relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_top"; }
1013 rel2 {relative: 0.0 0.0; to_y: "padding_bottom"; }
1016 aspect_preference: BOTH;
1018 description { state: "visible" 0.0;
1019 inherit: "default" 0.0;
1021 rel2 {relative: 0.3 0.0; to_y: "padding_bottom"; }
1023 description { state: "icononly" 0.0;;
1024 inherit: "default" 0.0;
1026 rel2 {relative: 0.0 0.0; to_x: "padding_right"; to_y: "padding_bottom"; }
1030 part { name: "label.bg";
1033 description { state: "default" 0.0;
1034 rel1 { relative: 1.0 1.0; to_x: "padding_icon_text"; to_y: "padding_top"; }
1035 rel2 { relative: 0.0 0.0; to_x: "padding_right"; to_y: "padding_bottom"; }
1038 part { name: "elm.swallow.label";
1042 clip_to: "label.bg";
1043 description { state: "default" 0.0;
1048 rel1 { relative: 1.0 1.0; to_x: "padding_icon_text";}
1049 rel2 { relative: 0.0 0.0; to_x: "padding_right";}
1051 description { state: "visible" 0.0;
1052 inherit: "default" 0.0;
1056 part { name: "disabler";
1059 description { state: "default" 0.0;
1064 rel1 { relative: 0.0 0.0; to: "segment";}
1065 rel2 { relative: 1.0 1.0; to: "segment";}
1066 color: 255 255 255 150;
1068 description { state: "disabled_single" 0.0;
1069 inherit: "default" 0.0;
1072 normal: "00_button_02_normal.png";
1076 description { state: "disabled_left" 0.0;
1077 inherit: "default" 0.0;
1080 normal: "00_winset_btn_sge_normal_left.png";
1084 description { state: "disabled_right" 0.0;
1085 inherit: "default" 0.0;
1088 normal: "00_winset_btn_sge_normal_right.png";
1092 description { state: "disabled_middle" 0.0;
1093 inherit: "default" 0.0;
1096 normal: "00_winset_btn_sge_normal_centre.png";
1104 public seg_type; // Single, Left, Middle, Right.
1105 public seg_state; // Normal/Default, Pressed, Selected.
1106 public seg_status;// Enabled/Default, Disabled
1108 public update_state() {
1109 new type, state, disabled;
1110 type = get_int(seg_type);
1111 state = get_int(seg_state);
1112 disabled = get_int(seg_status);
1114 if(state == SEGMENT_STATE_NORMAL)
1116 if(type == SEGMENT_TYPE_SINGLE)
1117 set_state(PART:"segment", "default_single", 0.0);
1118 else if(type == SEGMENT_TYPE_LEFT)
1119 set_state(PART:"segment", "default_left", 0.0);
1120 else if(type == SEGMENT_TYPE_MIDDLE)
1121 set_state(PART:"segment", "default_middle", 0.0);
1122 else if(type == SEGMENT_TYPE_RIGHT)
1123 set_state(PART:"segment", "default_right", 0.0);
1125 else if(state == SEGMENT_STATE_PRESSED)
1127 if(type == SEGMENT_TYPE_SINGLE)
1128 set_state(PART:"segment", "pressed_single", 0.0);
1129 else if(type == SEGMENT_TYPE_LEFT)
1130 set_state(PART:"segment", "pressed_left", 0.0);
1131 else if(type == SEGMENT_TYPE_MIDDLE)
1132 set_state(PART:"segment", "pressed_middle", 0.0);
1133 else if(type == SEGMENT_TYPE_RIGHT)
1134 set_state(PART:"segment", "pressed_right", 0.0);
1136 else if(state == SEGMENT_STATE_SELECTED)
1138 if(type == SEGMENT_TYPE_SINGLE)
1139 set_state(PART:"segment", "selected_single", 0.0);
1140 else if(type == SEGMENT_TYPE_LEFT)
1141 set_state(PART:"segment", "selected_left", 0.0);
1142 else if(type == SEGMENT_TYPE_MIDDLE)
1143 set_state(PART:"segment", "selected_middle", 0.0);
1144 else if(type == SEGMENT_TYPE_RIGHT)
1145 set_state(PART:"segment", "selected_right", 0.0);
1147 if(disabled == SEGMENT_STATUS_DISABLED)
1149 if(type == SEGMENT_TYPE_SINGLE)
1150 set_state(PART:"disabler", "disabled_single", 0.0);
1151 else if(type == SEGMENT_TYPE_LEFT)
1152 set_state(PART:"disabler", "disabled_left", 0.0);
1153 else if(type == SEGMENT_TYPE_MIDDLE)
1154 set_state(PART:"disabler", "disabled_middle", 0.0);
1155 else if(type == SEGMENT_TYPE_RIGHT)
1156 set_state(PART:"disabler", "disabled_right", 0.0);
1161 name: "segment_type_s";
1162 signal: "elm,type,segment,single";
1165 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1166 set_int(seg_type, SEGMENT_TYPE_SINGLE);
1171 name: "segment_type_l";
1172 signal: "elm,type,segment,left";
1175 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1176 set_int(seg_type, SEGMENT_TYPE_LEFT);
1181 name: "segment_type_m";
1182 signal: "elm,type,segment,middle";
1185 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1186 set_int(seg_type, SEGMENT_TYPE_MIDDLE);
1191 name: "segment_type_r";
1192 signal: "elm,type,segment,right";
1195 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1196 set_int(seg_type, SEGMENT_TYPE_RIGHT);
1201 name: "normal_segment";
1202 signal: "elm,state,segment,normal";
1205 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1206 set_int(seg_state, SEGMENT_STATE_NORMAL);
1211 name: "pressed_segment";
1212 signal: "elm,state,segment,pressed";
1215 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1216 set_int(seg_state, SEGMENT_STATE_PRESSED);
1221 name: "selected_segment";
1222 signal: "elm,state,segment,selected";
1225 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1226 set_int(seg_state, SEGMENT_STATE_SELECTED);
1230 program { name: "disable_segment";
1231 signal: "elm,state,disabled";
1234 set_int(seg_status, SEGMENT_STATUS_DISABLED);
1238 program { name: "enable_segment";
1239 signal: "elm,state,enabled";
1242 set_int(seg_status, SEGMENT_STATUS_ENABLED);
1246 program { name: "text_show";
1247 signal: "elm,state,text,visible";
1254 get_state(PART:"elm.swallow.icon", st, 30, vl);
1255 get_state(PART:"elm.swallow.label", st1, 30, vl1);
1256 if (!strcmp(st, "icononly"))
1258 set_state(PART:"elm.swallow.icon", "visible", 0.0);
1259 set_state(PART:"padding_icon_text", "visible", 0.0);
1261 set_state(PART:"elm.swallow.label", "visible", 0.0);
1264 program { name: "text_hide";
1265 signal: "elm,state,text,hidden";
1270 get_state(PART:"elm.swallow.icon", st, 30, vl);
1271 if (!strcmp(st, "visible"))
1273 set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1274 set_state(PART:"padding_icon_text", "icononly", 0.0);
1276 set_state(PART:"elm.swallow.label", "default", 0.0);
1279 program { name: "icon_show";
1280 signal: "elm,state,icon,visible";
1285 get_state(PART:"elm.swallow.label", st, 30, vl);
1286 if (!strcmp(st, "normal"))
1288 set_state(PART:"elm.swallow.icon", "visible", 0.0);
1289 set_state(PART:"padding_icon_text", "visible", 0.0);
1293 set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1294 set_state(PART:"padding_icon_text", "icononly", 0.0);
1298 program { name: "icon_hide";
1299 signal: "elm,state,icon,hidden";
1301 action: STATE_SET "default" 0.0;
1302 target: "elm.swallow.icon";
1307 group { name: "elm/label/base/body_style/segment_normal";
1308 data.item: "default_font_size" "24";
1309 data.item: "min_font_size" "16";
1310 data.item: "max_font_size" "24";
1312 style { name: "seg_text_body_style_normal";
1313 base: "font=SLP:style=Medium font_size=18\
1315 color="SEGMENT_CONTROL_ITEM_TITLE_BODY_TEXT_STYLE_COLOR_NORMAL_INC" wrap=char";
1317 tag: "hilight" "+ font=SLP:style=Bold";
1318 tag: "b" "+ font=SLP:style=Bold";
1321 style { name: "seg_text_body_style_pressed";
1322 base: "font=SLP:style=Medium font_size=18\
1324 color="SEGMENT_CONTROL_ITEM_TITLE_TEXT_STYLE_COLOR_PRESSED_INC" wrap=char";
1326 tag: "hilight" "+ font=SLP:style=Bold";
1327 tag: "b" "+ font=SLP:style=Bold";
1330 style { name: "seg_text_body_style_selected";
1331 base: "font=SLP:style=Medium font_size=18\
1332 align=center color="SEGMENT_CONTROL_ITEM_TITLE_BODY_TEXT_STYLE_COLOR_SELECTED_INC" \
1335 tag: "hilight" "+ font=SLP:style=Bold";
1336 tag: "b" "+ font=SLP:style=Bold";
1339 style { name: "seg_text_body_style_disabled";
1340 base: "font=SLP:style=Medium font_size=18\
1341 align=center color="SEGMENT_CONTROL_ITEM_TITLE_BODY_TEXT_STYLE_COLOR_NORMAL_INC" \
1344 tag: "hilight" "+ font=SLP:style=Bold";
1345 tag: "b" "+ font=SLP:style=Bold";
1350 part { name: "label.swallow.background";
1352 description { state: "default" 0.0;
1354 rel1.relative, 0.0 0.0;
1355 rel2.relative, 1.0 1.0;
1358 part { name: "label.text.clip";
1360 description { state: "default" 0.0;
1362 rel1 { relative: 0 0; to: "label.swallow.background"; }
1363 rel2 { relative: 1 1; to: "label.swallow.background"; }
1366 part { name: "elm.text";
1370 clip_to: "label.text.clip";
1371 description { state: "default" 0.0;
1372 rel1.relative, 0.0 0.0;
1373 rel2.relative, 1.0 1.0;
1376 style: "seg_text_body_style_normal";
1385 group { name: "elm/label/base/body_style/segment_selected";
1386 data.item: "default_font_size" "24";
1387 data.item: "min_font_size" "16";
1388 data.item: "max_font_size" "24";
1390 part { name: "label.swallow.background";
1392 description { state: "default" 0.0;
1394 rel1.relative, 0.0 0.0;
1395 rel2.relative, 1.0 1.0;
1398 part { name: "label.text.clip";
1400 description { state: "default" 0.0;
1402 rel1 { relative: 0 0; to: "label.swallow.background"; }
1403 rel2 { relative: 1 1; to: "label.swallow.background"; }
1406 part { name: "elm.text";
1410 clip_to: "label.text.clip";
1411 description { state: "default" 0.0;
1412 rel1.relative, 0.0 0.0;
1413 rel2.relative, 1.0 1.0;
1416 style: "seg_text_body_style_selected";
1424 group { name: "elm/label/base/body_style/segment_pressed";
1425 data.item: "default_font_size" "24";
1426 data.item: "min_font_size" "16";
1427 data.item: "max_font_size" "24";
1429 part { name: "label.swallow.background";
1431 description { state: "default" 0.0;
1433 rel1.relative, 0.0 0.0;
1434 rel2.relative, 1.0 1.0;
1437 part { name: "label.text.clip";
1439 description { state: "default" 0.0;
1441 rel1 { relative: 0 0; to: "label.swallow.background"; }
1442 rel2 { relative: 1 1; to: "label.swallow.background"; }
1445 part { name: "elm.text";
1449 clip_to: "label.text.clip";
1450 description { state: "default" 0.0;
1451 rel1.relative, 0.0 0.0;
1452 rel2.relative, 1.0 1.0;
1455 style: "seg_text_body_style_pressed";
1464 group { name: "elm/label/base/body_style/segment_disabled";
1465 data.item: "default_font_size" "24";
1466 data.item: "min_font_size" "16";
1467 data.item: "max_font_size" "24";
1469 part { name: "label.swallow.background";
1471 description { state: "default" 0.0;
1473 rel1.relative, 0.0 0.0;
1474 rel2.relative, 1.0 1.0;
1477 part { name: "label.text.clip";
1479 description { state: "default" 0.0;
1481 rel1 { relative: 0 0; to: "label.swallow.background"; }
1482 rel2 { relative: 1 1; to: "label.swallow.background"; }
1485 part { name: "elm.text";
1489 clip_to: "label.text.clip";
1490 description { state: "default" 0.0;
1491 rel1.relative, 0.0 0.0;
1492 rel2.relative, 1.0 1.0;
1495 style: "seg_text_body_style_disabled";
1503 #undef SEGMENT_TYPE_SINGLE
1504 #undef SEGMENT_TYPE_LEFT
1505 #undef SEGMENT_TYPE_MIDDLE
1506 #undef SEGMENT_TYPE_RIGHT
1507 #undef SEGMENT_STATE_NORMAL
1508 #undef SEGMENT_STATE_PRESSED
1509 #undef SEGMENT_STATE_SELECTED
1510 #undef SEGMENT_STATUS_ENABLED
1511 #undef SEGMENT_STATUS_DISABLED