2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #define RADIO_STATE_DEFAULT 0
19 #define RADIO_STATE_VISIBLE 1
20 #define RADIO_STATE_DISABLED_VISIBLE 2
21 #define RADIO_STATE_DISABLED 3
24 style { name: "radio_label_textblock_style";
25 base: "font=SLP:style=Medium font_size="RADIO_STYLE_DEFAULT_FONT_SIZE_INC" color=#ffffff wrap=char";
28 tag: "hilight" "+ font=SLP:style=Bold";
29 tag: "b" "+ font=SLP:style=Bold";
30 tag: "whitecolor" "+ color=#ffffff";
34 ////////////////////////////////////////////////////////////////////////////////////////
36 #define RADIO_STYLE_DEFAULT(style_name, min_width, min_height) \
37 group { name: "elm/radio/base/"style_name; \
39 image: "00_button_radio_normal1.png" COMP; \
40 image: "00_button_radio_normal2.png" COMP; \
43 part { name: "back_bg"; \
47 description { state: "default" 0.0; \
48 rel2.relative: 0.0 1.0; \
50 min: min_width min_height; \
60 description { state: "default" 0.0; \
61 rel1{ to: "back_bg"; } \
62 rel2{ to: "back_bg"; } \
65 min: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
66 max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
70 part { name: "radio"; \
73 description { state: "default" 0.0; \
83 color: 255 255 255 255; \
84 image.normal: "00_button_radio_normal2.png"; \
86 description { state: "visible" 0.0; \
87 inherit: "default" 0.0; \
88 image.normal: "00_button_radio_normal1.png"; \
89 color: 255 255 255 255; \
91 description { state: "disabled" 0.0; \
92 inherit: "default" 0.0; \
93 color: 255 255 255 128; \
95 description { state: "disabled_visible" 0.0; \
96 inherit: "visible" 0.0; \
97 color: 255 255 255 128; \
100 part { name: "elm.swallow.content"; \
102 description { state: "default" 0.0; \
105 color: 255 255 255 255; \
108 rel1.relative: 1.0 0.0; \
111 rel2.relative: 1.0 1.0; \
114 description { state: "visible" 0.0; \
115 inherit: "default" 0.0; \
119 aspect_preference: VERTICAL; \
121 description { state: "disabled" 0.0; \
122 inherit: "default" 0.0; \
123 color: 128 128 128 128; \
125 description { state: "disabled_visible" 0.0; \
126 inherit: "default" 0.0; \
127 color: 128 128 128 128; \
133 part { name: "elm.text"; \
137 description { state: "default" 0.0; \
140 rel1 { relative: 1.0 0.5; offset: 1 1; to_x: "elm.swallow.content"; } \
141 rel2 { relative: 1.0 0.5; offset: -2 -2; } \
142 color: 255 255 255 255; \
145 style: "radio_label_textblock_style"; \
148 color: RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC; \
150 description { state: "visible" 0.0; \
151 inherit: "default" 0.0; \
155 description { state: "disabled" 0.0; \
156 inherit: "default" 0.0; \
158 description { state: "disabled_visible" 0.0; \
159 inherit: "default" 0.0; \
162 color: RADIO_DEFAULT_TEXT_DISABLED_COLOR_INC; \
165 part { name: "over1"; \
167 ignore_flags: ON_HOLD; \
168 description { state: "default" 0.0; \
172 part { name: "over2"; \
175 description { state: "default" 0.0; \
179 part { name: "disabler"; \
181 description { state: "default" 0.0; \
185 description { state: "disabled" 0.0; \
186 inherit: "default" 0.0; \
193 program { name: "click"; \
194 signal: "mouse,clicked,1"; \
196 action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \
198 program { name: "radio_on"; \
199 signal: "elm,state,radio,on"; \
202 set_state(PART:"radio", "visible", 0.0); \
205 program { name: "radio_off"; \
206 signal: "elm,state,radio,off"; \
209 set_state(PART:"radio", "default", 0.0); \
212 program { name: "text_show"; \
213 signal: "elm,state,text,visible"; \
215 action: STATE_SET "visible" 0.0; \
216 target: "elm.text"; \
218 program { name: "text_hide"; \
219 signal: "elm,state,text,hidden"; \
221 action: STATE_SET "default" 0.0; \
222 target: "elm.text"; \
224 program { name: "icon_show"; \
225 signal: "elm,state,icon,visible"; \
227 action: STATE_SET "visible" 0.0; \
228 target: "elm.swallow.content"; \
230 program { name: "icon_hide"; \
231 signal: "elm,state,icon,hidden"; \
233 action: STATE_SET "default" 0.0; \
234 target: "elm.swallow.content"; \
236 program { name: "disable"; \
237 signal: "elm,state,disabled"; \
239 action: STATE_SET "disabled" 0.0; \
240 target: "disabler"; \
241 after: "disable_text"; \
243 program { name: "disable_text"; \
247 get_state(PART:"elm.text", st, 30, vl); \
248 if (!strcmp(st, "visible")) \
249 set_state(PART:"elm.text", "disabled_visible", 0.0); \
251 set_state(PART:"elm.text", "disabled", 0.0); \
252 get_state(PART:"elm.swallow.content", st, 30, vl); \
253 if (!strcmp(st, "visible")) \
254 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
256 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
257 get_state(PART:"radio", st, 30, vl); \
258 if (!strcmp(st, "visible")) \
260 set_state(PART:"radio", "disabled_visible", 0.0); \
264 set_state(PART:"radio", "disabled", 0.0); \
268 program { name: "enable"; \
269 signal: "elm,state,enabled"; \
271 action: STATE_SET "default" 0.0; \
272 target: "disabler"; \
273 after: "enable_text"; \
275 program { name: "enable_text"; \
279 get_state(PART:"elm.text", st, 30, vl); \
280 if (!strcmp(st, "disabled_visible")) \
281 set_state(PART:"elm.text", "visible", 0.0); \
283 set_state(PART:"elm.text", "default", 0.0); \
284 get_state(PART:"elm.swallow.content", st, 30, vl); \
285 if (!strcmp(st, "disabled_visible")) \
286 set_state(PART:"elm.swallow.content", "visible", 0.0); \
288 set_state(PART:"elm.swallow.content", "default", 0.0); \
289 get_state(PART:"radio", st, 30, vl); \
290 if (!strcmp(st, "disabled_visible")) \
292 set_state(PART:"radio", "visible", 0.0); \
296 set_state(PART:"radio", "default", 0.0); \
303 ///////////////////////////////////////////////////////////////////////////////////////
304 RADIO_STYLE_DEFAULT("default", RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
306 ///////////////////////////////////////////////////////////////////////////////////////
307 RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC)
309 ///////////////////////////////////////////////////////////////////////////////////////
311 #undef RADIO_STATE_DEFAULT
312 #undef RADIO_STATE_VISIBLE
313 #undef RADIO_STATE_DISABLED_VISIBLE
314 #undef RADIO_STATE_DISABLED