Merge "[Button]Naviframe_control style macro's modified."
[profile/ivi/efl-theme-tizen.git] / themes / widgets / toggle.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved 
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of SAMSUNG
7  * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this
8  * software is owned by Samsung and you shall not disclose such Confidential
9  * Information and shall use it only in accordance with the terms of the license
10  * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
11  * representations or warranties about the suitability of the software, either
12  * express or implied, including but not limited to the implied warranties of
13  * merchantability, fitness for a particular purpose, or non-infringement.
14  * SAMSUNG shall not be liable for any damages suffered by licensee arising out
15  * of or releated to this software.
16  *
17  */
18
19         group {
20                 name: "elm/toggle/base/style1";
21                 
22                 images {
23                         image: "switch_btn.png" COMP;
24                         image: "switch_bg.png" COMP;
25                         image: "switch_left_padding.png" COMP;
26                         image: "switch_right_padding.png" COMP;
27                 }
28
29                 script {
30                         public timer_on(val) {
31                                 new Float:x, Float:y;
32                                 get_drag(PART:"button", x, y);
33                                 if (x >= 1.0) {
34                                         set_state(PART:"bg", "on", 0.0);
35                                         x = 1.0;
36                                         set_drag(PART:"button", x, y);
37                                         emit("elm,action,toggle,on", "");
38                                 } else if (x <= 0.5) {
39                                         x = x + 0.2;
40                                         set_drag(PART:"button", x, y);
41                                         timer(0.01, "timer_on", 0);
42                                 } else {
43                                         x = x + 0.1;
44                                         set_drag(PART:"button", x, y);
45                                         timer(0.01, "timer_on", 0);
46                                 }
47                                 return 0;
48                         }
49                         public timer_off(val) {
50                                 new Float:x, Float:y;
51                                 get_drag(PART:"button", x, y);
52                                 if (x <= 0.0) {
53                                         set_state(PART:"bg", "off", 0.0);
54                                         x = 0.0;
55                                         set_drag(PART:"button", x, y);
56                                         emit("elm,action,toggle,off", "");
57                                 } else if (x >= 0.5) {
58                                         x = x - 0.2;
59                                         set_drag(PART:"button", x, y);
60                                         timer(0.01, "timer_off", 0);
61                                 } else {
62                                         x = x - 0.1;
63                                         set_drag(PART:"button", x, y);
64                                         timer(0.01, "timer_off", 0);
65                                 }
66                                 return 0;
67                         }
68                 }
69                 
70                 parts {
71                         part {
72                                 name: "bg";
73                                 type: RECT;
74                                 mouse_events: 1;
75                                 scale: 1;
76                                 description {
77                                         state: "default" 0.0;
78                                         min: 142 41;
79                                         max: 142 41;
80                                         fixed: 1 1;
81                                         align: 1.0 0.5;
82                                         color: 255 255 255 255;
83                                 }
84                                 description {
85                                         state: "on" 0.0;
86                                         inherit: "default" 0.0;
87                                 }
88                         }
89                         part {
90                                 name: "left_padding";
91                                 mouse_events: 0;
92                                 scale: 1;
93                                 description {
94                                         state: "default" 0.0;
95                                         min: 5 0;
96                                         fixed: 1 0;
97                                         rel1.to: "bg";
98                                         rel2 { relative: 0 1; to: "bg"; }
99                                         align: 0 0.5;
100                                         image.normal: "switch_left_padding.png";
101                                 }
102                         }
103                         part {
104                                 name: "right_padding";
105                                 mouse_events: 0;
106                                 scale: 1;
107                                 description {
108                                         state: "default" 0.0;
109                                         min: 5 0;
110                                         fixed: 1 0;
111                                         rel1 { relative: 1 0; to: "bg"; }
112                                         rel2.to: "bg";
113                                         align: 1 0.5;
114                                         image.normal: "switch_right_padding.png";
115                                 }
116                         }
117                         part {
118                                 name: "button_clipper";
119                                 type: RECT;
120                                 mouse_events: 0;
121                                 description {
122                                         state: "default" 0.0;
123                                         rel1.to: "left_padding";
124                                         rel2.to: "right_padding";
125                                 }
126                         }               
127                         part {
128                                 name: "clipper";
129                                 type: RECT;
130                                 mouse_events: 0;
131                                 description {
132                                         state: "default" 0.0;
133                                         rel1 { relative: 1 0; to_x: "left_padding"; to_y: "bg"; }
134                                         rel2 { relative: 0 1; to_x: "right_padding"; to_y: "bg"; }
135                                 }
136                         }
137                         part { name: "button";
138                                 type: RECT;
139                                 scale: 1;
140                                 clip_to: "clipper";
141                                 dragable {
142                                         x: 1 1 0;
143                                         y: 0 0 0;
144                                         confine: "bg";
145                                 }
146                                 description {
147                                         state: "default" 0.0;
148                                         rel1.to: "bg";
149                                         rel2.to: "bg";
150                                         min: 58 41;
151                                         max: 58 41;
152                                         fixed: 1 1;
153                                         color: 0 0 0 0;
154                                 }
155                         }
156                         part {
157                                 name: "button_events";
158                                 type: RECT;
159                                 dragable {
160                                         events: "button";
161                                 }
162                                 description {
163                                         state: "default" 0.0;
164                                         rel1.to_x: "bg";
165                                         rel2.to_x: "bg";
166                                         color: 0 0 0 0;
167                                 }
168                         }
169                         part {
170                                 name: "onrect";
171                                 type: RECT;
172                                 scale: 1;
173                                 clip_to: "clipper";
174                                 mouse_events: 0;
175                                 description {
176                                         state: "default" 0.0;
177                                         rel1.to: "button";
178                                         rel1.relative: -2.0 0.0;
179                                         rel2.to: "button";
180                                         rel2.relative: 0.0 1.0;
181                                         color: 0 0 0 0;
182                                 }
183                         }
184                         part {
185                                 name: "offrect";
186                                 type: RECT;
187                                 scale: 1;
188                                 clip_to: "clipper";
189                                 mouse_events: 0;
190                                 description {
191                                         state: "default" 0.0;
192                                         rel1.to: "button";
193                                         rel1.relative: 1.0 0.0;
194                                         rel2.to: "button";
195                                         rel2.relative: 3.0 1.0;
196                                         color: 0 0 0 0;
197                                 }
198                         }
199                         part {
200                                 name: "togbase";
201                                 mouse_events:  0;
202                                 clip_to: "clipper";
203                                 description { state: "default" 0.0;
204                                         rel1.to: "onrect";
205                                         rel2.to: "offrect";
206                                         image.normal: "switch_bg.png";
207                                 }
208                         }
209                         part {
210                                 name: "button2";
211                                 mouse_events:  0;
212                                 clip_to: "button_clipper";
213                                 description {
214                                         state: "default" 0.0;
215                                         rel1.to: "button";
216                                         rel2.to: "button";
217                                         image {
218                                                 normal: "switch_btn.png";
219                                                 border: 4 4 7 7;
220                                                 border_scale: 1;
221                                         }
222                                         image.middle: SOLID;
223                                 }
224                         }
225                         part {
226                                 name: "disabler";
227                                 type: RECT;
228                                 description {
229                                         state: "default" 0.0;
230                                         color: 0 0 0 0;
231                                         visible: 0;
232                                 }
233                                 description {
234                                         state: "disabled" 0.0;
235                                         inherit: "default" 0.0;
236                                         visible: 1;
237                                 }
238                         }
239                 }
240         
241                 programs {
242                         program {
243                                 name:   "drag_end";
244                                 signal: "mouse,up,1";
245                                 source: "button";
246                                 script {
247                                         new st[30];
248                                         new Float:vl;
249                                         get_state(PART:"bg", st, 30, vl)
250                                         if (!strncmp(st, "default", 7)) {
251                                                 set_state(PART:"bg", "on", 0.0);
252                                                 timer_on(0);
253                                         } else {
254                                                 set_state(PART:"bg", "off", 0.0);
255                                                 timer_off(0);
256                                         }
257                                 }
258                         }
259                         program {
260                                 name: "toggle_on";
261                                 signal: "elm,state,toggle,on";
262                                 source: "elm";
263                                 script {
264                                         set_state(PART:"bg", "on", 0.0);
265                                         timer_on(0);
266                                 }
267                         }
268                         program {
269                                 name: "toggle_off";
270                                 signal: "elm,state,toggle,off";
271                                 source: "elm";
272                                 script {
273                                         set_state(PART:"bg", "off", 0.0);
274                                         timer_off(0);
275                                 }
276                         }
277                         program {
278                                 name: "disable";
279                                 signal: "elm,state,disabled";
280                                 source: "elm";
281                                 action: STATE_SET "disabled" 0.0;
282                                 target: "togbase";
283                                 target: "disabler";
284                         }
285                         program {
286                                 name: "enable";
287                                 signal: "elm,state,enabled";
288                                 source: "elm";
289                                 action: STATE_SET "default" 0.0;
290                                 target: "disabler";
291                         }
292                 }
293         }
294
295 /////////////////////////////////////////////////////////////////////////////////////// 
296         group { name: "elm/toggle/base/default";
297                 images {
298                 image: "00_button_on.png" COMP;
299                 image: "00_button_on_press.png" COMP;
300                 image: "00_button_off.png" COMP;
301                 image: "00_button_off_press.png" COMP;
302                 image: "00_button_onoff_handle.png" COMP;
303                 image: "00_button_onoff_handle_press.png" COMP;
304                 }
305                 script {
306                         public toggle_move_state = 0; //0:no movement, 1: moved
307                         public toggle_is_down = 0; //0:not down, 1: down
308                 }
309                 parts {
310                 part { name: "bg";
311                         type: RECT;
312                                 mouse_events: 1;
313                         scale: 1;
314                         description { state: "default" 0.0;
315                                 min: 122 40;
316                                 max: 122 40;
317                                 rel1.relative: 1.0 0.0;
318                                 fixed: 1 0;
319                                 color: 0 0 0 0;
320                                 align: 1.0 0.5;
321                         }
322                 }
323                 part {
324                                 name: "padding_left";
325                                 type: RECT;
326                                 scale: 1;
327                                 mouse_events: 0;
328                                 description { state: "default" 0.0;
329                                         align: 0.0 0.0;
330                                         rel1{ relative: 0.0 0.0; to: "bg"; }
331                                         rel2{ relative: 0.0 1.0; to: "bg"; }
332                                         min: 4 4;
333                                         fixed: 1 0;
334                                         color: 0 0 0 0;
335                                 }
336                         }
337                         part {
338                                 name: "padding_right";
339                                 type: RECT;
340                                 scale: 1;
341                                 mouse_events: 0;
342                                 description { state: "default" 0.0;
343                                         align: 1.0 0.0;
344                                         rel1{ relative: 1.0 0.0; to: "bg"; }
345                                         rel2{ relative: 1.0 1.0; to: "bg"; }
346                                         min: 4 4;
347                                         fixed: 1 0;
348                                         color: 0 0 0 0;
349                                 }
350                         }
351                         part {
352                                 name: "padding_top";
353                                 type: RECT;
354                                 scale: 1;
355                                 mouse_events: 0;
356                                 description { state: "default" 0.0;
357                                         align: 0.0 0.0;
358                                         rel1{ relative: 0.0 0.0; to: "bg"; }
359                                         rel2{ relative: 1.0 0.0; to: "bg"; }
360                                         min: 4 4;
361                                         fixed: 0 1;
362                                         color: 0 0 0 0;
363                                 }
364                         }
365                         part {
366                                 name: "padding_bottom";
367                                 type: RECT;
368                                 scale: 1;
369                                 mouse_events: 0;
370                                 description { state: "default" 0.0;
371                                         align: 1.0 1.0;
372                                         rel1{ relative: 0.0 1.0; to: "bg"; }
373                                         rel2{ relative: 1.0 1.0; to: "bg"; }
374                                         min: 4 4;
375                                         fixed: 0 1;
376                                         color: 0 0 0 0;
377                                 }
378                         }
379                         part { name: "bg_image";
380                                 type: IMAGE;
381                                 mouse_events: 0;
382                                 scale: 1;
383                                 description { state: "default" 0.0;
384                                         align: 0.0 0.0;
385                                         rel1{ relative: 0.0 1.0; to_x: "bg"; to_y: "padding_top"; }
386                                         rel2{ relative: 1.0 0.0; to_x: "bg"; to_y: "padding_bottom"; }
387                                         image.normal: "00_button_off.png";
388                         }
389                         description { state: "off_pressed" 0.0;
390                                         inherit: "default" 0.0;
391                                         image.normal: "00_button_off_press.png";
392                         }
393                         description { state: "on_pressed" 0.0;
394                                         inherit: "default" 0.0;
395                                         image.normal: "00_button_on_press.png";
396                         }
397                         description { state: "on" 0.0;
398                                         inherit: "default" 0.0;
399                                         image.normal: "00_button_on.png";
400                         }
401                         }
402                         part { name: "drag_container";
403                                 type: RECT;
404                                 scale: 1;
405                                 mouse_events: 0;
406                                 description { state: "default" 0.0;
407                                         rel1{ relative: 1.0 0.0; to_x: "padding_left"; to_y: "bg_image"; }
408                                         rel2{ relative: 0.0 1.0; to_x: "padding_right"; to_y: "bg_image"; }
409                                         color: 0 0 0 0;
410                                 }
411                         }
412                 part { name: "clipper";
413                         type: RECT;
414                         mouse_events: 0;
415                                 description { state: "default" 0.0;
416                                 rel1.to: "bg_image";
417                                 rel2.to: "bg_image";
418                                 color: 255 255 255 255;
419                         }
420                         }
421                         part { name: "clipper_inner";
422                         type: RECT;
423                         mouse_events: 0;
424                                 description { state: "default" 0.0;
425                                 rel1.to: "bg_image";
426                                 rel2.to: "bg_image";
427                                 rel1.offset: 2 0;
428                                 rel2.offset: -2 0;
429                                 color: 255 255 255 255;
430                         }
431                         }
432                 part { name: "button";
433                         type: IMAGE;
434                         scale: 1;
435                         clip_to: "clipper";
436                         mouse_events: 1;
437                         dragable {
438                                 x: 1 1 0;
439                                 y: 0 0 0;
440                                 confine: "drag_container";
441                         }
442                         description { state: "default" 0.0;
443                                min: 56 32;
444                                max: 56 32;
445                                image.normal: "00_button_onoff_handle.png";
446                         }
447                         description { state: "pressed" 0.0;
448                                inherit: "default" 0.0;
449                                image.normal: "00_button_onoff_handle_press.png";
450                         }
451                         }
452                 part { name: "button_events";
453                             type: RECT;
454                             dragable {
455                                events: "button";
456                         }
457                             description { state: "default" 0.0;
458                                rel1.to_x: "bg";
459                                rel2.to_x: "bg";
460                                color: 0 0 0 0;
461                             }
462                         }
463                 part { name: "onrect";
464                             type: RECT;
465                             scale: 1;
466                             clip_to: "clipper";
467                             mouse_events: 0;
468                             description { state: "default" 0.0;
469                                rel1{ relative: -1.0 0.0; to: "button"; }
470                                rel2{ relative: 0.0 1.0; to: "button"; }
471                                align: 1.0 0.5;
472                                color: 0 0 0 0;
473                             }
474                         }
475                 part { name: "offrect";
476                             type: RECT;
477                             scale: 1;
478                             clip_to: "clipper";
479                             mouse_events: 0;
480                             description { state: "default" 0.0;
481                                rel1{ relative: 1.0 0.0; to: "button"; }
482                                rel2{ relative: 2.0 1.0; to: "button"; }
483                                color: 0 0 0 0;
484                             }
485                         }
486                         part { name: "elm.offtext";
487                             type: TEXT;
488                             mouse_events:  0;
489                             scale: 1;
490                             clip_to: "clipper_inner";
491                             description { state: "default" 0.0;
492                                         rel1.to: "offrect";
493                                         rel2.to: "offrect";
494                                         color: 255 255 255 255;
495                                         text {
496                                                 font: "SLP:style=Medium";
497                                                 size: 20;
498                                                 min:      0 1;
499                                                 align:    0.5 0.5;
500                                                 text:     "OFF";
501                                                 text_class: "slp_medium";
502                                }
503                             }
504                             description { state: "disabled" 0.0;
505                                inherit: "default" 0.0;
506                                color: 128 128 128 128;
507                             }
508                         }
509                 part { name: "elm.ontext";
510                             type: TEXT;
511                             mouse_events:  0;
512                             scale: 1;
513                             clip_to: "clipper_inner";
514                             description { state: "default" 0.0;
515                                         rel1.to: "onrect";
516                                         rel2.to: "onrect";
517                                         color: 255 255 255 255;
518                                         text {
519                                                 font: "SLP:style=Medium";
520                                                 size: 20;
521                                                 min:      0 1;
522                                                 align:    0.5 0.5;
523                                                 text:     "ON";
524                                                 text_class: "slp_medium";
525                                         }
526                             }
527                             description { state: "disabled" 0.0;
528                                inherit: "default" 0.0;
529                                color: 128 128 128 128;
530                                color3: 0 0 0 24;
531                             }
532                         }
533                         part { name: "elm.swallow.content";
534                             type: SWALLOW;
535                             description { state: "default" 0.0;
536                                fixed: 1 0;
537                                visible: 0;
538                                align: 0.0 0.5;
539                                rel1.offset: 4 4;
540                                rel2.relative: 0.0 1.0;
541                                rel2.offset: 3 -5;
542                             }
543                             description { state: "visible" 0.0;
544                                inherit: "default" 0.0;
545                            fixed: 1 1;
546                                visible: 1;
547                                aspect: 1.0 1.0;
548                                aspect_preference: VERTICAL;
549                                rel2.offset: 4 -5;
550                             }
551                             description { state: "disabled" 0.0;
552                                inherit: "default" 0.0;
553                                color: 128 128 128 128;
554                             }
555                             description { state: "disabled_visible" 0.0;
556                                inherit: "default" 0.0;
557                                color: 128 128 128 128;
558                                fixed: 1 1;
559                                visible: 1;
560                                aspect: 1.0 1.0;
561                             }
562                         }
563                 part { name: "elm.text";
564                             type: TEXT;
565                             mouse_events: 0;
566                             scale: 1;
567                             description { state: "default" 0.0;
568                                visible: 0;
569                                rel1.to_x: "elm.swallow.content";
570                                rel1.relative: 1.0 0.0;
571                            rel1.offset: 0 4;
572                                rel2.to_x: "bg";
573                                rel2.relative: 0.0 1.0;
574                                rel2.offset: -5 -5;
575                                color: 0 0 0 255;
576                                text {
577                                   font: "SLP:style=Medium";
578                                   size: 10;
579                                   min: 0 0;
580                                   align: 0.0 0.5;
581                                                 text_class: "slp_medium";
582                                          }
583                             }
584                             description { state: "visible" 0.0;
585                                inherit: "default" 0.0;
586                                visible: 1;
587                                text.min: 1 1;
588                             }
589                             description { state: "disabled" 0.0;
590                                inherit: "default" 0.0;
591                                color: 128 128 128 128;
592                             }
593                             description { state: "disabled_visible" 0.0;
594                                inherit: "default" 0.0;
595                                color: 128 128 128 128;
596                                visible: 1;
597                             }
598                         }
599                         part { name: "disabler";
600                             type: RECT;
601                             description { state: "default" 0.0;
602                                color: 0 0 0 0;
603                                visible: 0;
604                             }
605                             description { state: "disabled" 0.0;
606                                inherit: "default" 0.0;
607                                visible: 1;
608                             }
609                          }
610                 }
611             programs {
612                         program { name:   "drag_end";
613                                 signal: "mouse,up,1";
614                                 source: "button";
615                                 script {
616                                         new Float:dx, Float:dy;
617                                         new st[30];
618                                         new Float:vl;
619                                         get_drag(PART:"button", dx, dy);
620                                         set_int(toggle_is_down, 0);
621                                         get_state(PART:"bg_image", st, 30, vl)
622                                         if(get_int(toggle_move_state) == 0) //no movement
623                                         {
624                                                 if(dx > 0.5)
625                                                 {
626                                                         set_drag(PART:"button", 0.0, 0.0);
627                                                         emit("elm,action,toggle,off", "");
628                                                         set_state(PART:"bg_image", "default", 0.0);
629                                                 }
630                                                 else
631                                                 {       
632                                                         set_drag(PART:"button", 1.0, 0.0);
633                                                         emit("elm,action,toggle,on", "");
634                                                         set_state(PART:"bg_image", "on", 0.0);
635                                                 }               
636                                         }
637                                         else 
638                                         {
639                                                 if (dx > 0.5)
640                                                 {
641                                                         set_drag(PART:"button", 1.0, 0.0);
642                                                         if (!strcmp(st, "off_pressed")) {
643                                                                 emit("elm,action,toggle,on", "");
644                                                         }
645                                                         set_state(PART:"bg_image", "on", 0.0);
646                                                 }
647                                                 else
648                                                 {
649                                                         set_drag(PART:"button", 0.0, 0.0);
650                                                         if (!strcmp(st, "on_pressed")) {
651                                                                 emit("elm,action,toggle,off", "");
652                                                         }
653                                                         set_state(PART:"bg_image", "default", 0.0);
654                                                 }
655                                         }
656                                         set_state(PART:"button", "default", 0.0);
657                                         set_int(toggle_move_state,0);
658                                 }
659                         }
660                         program { name: "toggle_on";
661                             signal: "elm,state,toggle,on";
662                             source: "elm";
663                             script {
664                                set_drag(PART:"button", 100.0, 0.0);
665                                set_state(PART:"bg_image", "on", 0.0);
666                             }
667                         }
668                         program { name: "toggle_off";
669                             signal: "elm,state,toggle,off";
670                             source: "elm";
671                             script {
672                                set_drag(PART:"button", 0.0, 0.0);
673                                set_state(PART:"bg_image", "default", 0.0);
674                             }
675                         }
676                         program { name: "mouse_press,";
677                             signal: "mouse,down,1";
678                             source: "button";
679                             script {
680                                 new st[30];
681                                         new Float:vl;
682                                         set_int(toggle_is_down, 1);
683                                         get_state(PART:"bg_image", st, 30, vl)
684                                         if (!strcmp(st, "default")) {
685                                                 set_state(PART:"bg_image", "off_pressed", 0.0);
686                                         }
687                                 else {
688                                         set_state(PART:"bg_image", "on_pressed", 0.0);
689                                 }
690                                 set_state(PART:"button", "pressed", 0.0);
691                             }
692                         }
693                         program { name: "mouse_move,";
694                             signal: "mouse,move";
695                             source: "button";
696                             script {
697                                         if(get_int(toggle_is_down) == 0)
698                                         {
699                                                 set_int(toggle_move_state,0);
700                                         }
701                                         else
702                                         {
703                                                 set_int(toggle_move_state,1);
704                                         }
705                             }
706                         }
707                         program { name: "text_show";
708                             signal: "elm,state,text,visible";
709                             source: "elm";
710                             action:  STATE_SET "visible" 0.0;
711                             target: "elm.text";
712                         }
713                         program { name: "text_hide";
714                             signal: "elm,state,text,hidden";
715                             source: "elm";
716                             action:  STATE_SET "default" 0.0;
717                             target: "elm.text";
718                         }
719                         program { name: "icon_show";
720                             signal: "elm,state,icon,visible";
721                             source: "elm";
722                             action:  STATE_SET "visible" 0.0;
723                             target: "elm.swallow.content";
724                         }
725                         program { name: "icon_hide";
726                             signal: "elm,state,icon,hidden";
727                             source: "elm";
728                             action:  STATE_SET "default" 0.0;
729                             target: "elm.swallow.content";
730                         }
731                         program { name: "disable";
732                             signal: "elm,state,disabled";
733                             source: "elm";
734                             action: STATE_SET "disabled" 0.0;
735                             target: "elm.ontext";
736                             target: "elm.offtext";
737                             target: "disabler";
738                             after: "disable_text";
739                         }
740                         program { name: "disable_text";
741                                 script {
742                                         new st[31];
743                                         new Float:vl;
744                                         get_state(PART:"elm.text", st, 30, vl);
745                                         if (!strcmp(st, "visible"))
746                                                 set_state(PART:"elm.text", "disabled_visible", 0.0);
747                                         else
748                                                 set_state(PART:"elm.text", "disabled", 0.0);
749                                         
750                                         get_state(PART:"elm.swallow.content", st, 30, vl);
751                                         if (!strcmp(st, "visible"))
752                                                 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
753                                         else
754                                                 set_state(PART:"elm.swallow.content", "disabled", 0.0);
755                                 }
756                         }
757                         program { name: "enable";
758                                 signal: "elm,state,enabled";
759                                 source: "elm";
760                                 action: STATE_SET "default" 0.0;
761                 target: "elm.ontext";
762                 target: "elm.offtext";
763                                 target: "disabler";
764                                 after: "enable_text";
765                         }
766                         program { name: "enable_text";
767                                 script {
768                                         new st[31];
769                                         new Float:vl;
770                                         get_state(PART:"elm.text", st, 30, vl);
771                                         if (!strcmp(st, "disabled_visible"))
772                                                 set_state(PART:"elm.text", "visible", 0.0);
773                                         else
774                                                 set_state(PART:"elm.text", "default", 0.0);
775                         
776                                         get_state(PART:"elm.swallow.content", st, 30, vl);
777                                         if (!strcmp(st, "visible"))
778                                                 set_state(PART:"elm.swallow.content", "visible", 0.0);
779                                         else
780                                                 set_state(PART:"elm.swallow.content", "default", 0.0);
781                                 }
782                         }
783                 }
784         }