ba7ecab53220f53cd9df6e9c5cf7f3e014a71d5b
[apps/home/calculator.git] / edc / Inc.calculator.main.edc
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   * 
4   * Licensed under the Flora License, Version 1.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
7   * 
8   *     http://www.tizenopensource.org/license
9   * 
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.
15   */
16
17 #define PADDING_TOP_POR         60
18 #define PADDING_BOTTOM_POR       50
19 #define PADDING_LEFT_POR        24
20 #define PADDING_RIGHT_POR       24
21
22
23 group {
24     name: "main";
25
26     script {
27         public result_show;
28     }
29
30     parts {
31         /* background */
32         //EDC_PART_BG("bg")
33         part {
34                 name: "head";
35                 type: RECT;
36                 mouse_events: 0;
37                 description {
38                     state: "default" 0.0;
39                     rel1 { relative: 0.0 0.0;}
40                     rel2 { relative: 1.0 50/1280;}
41                     color: 0 0 0 255;
42                 }
43                 description {
44                     state: "default" 0.0;
45                     rel1 { relative: 0.0 0.0;}
46                     rel2 { relative: 0.0 0.0;}
47                     color: 0 0 0 255;
48                 }
49             }
50             part {
51                 name: "bg";
52                 type: RECT;
53                 mouse_events: 0;
54                 description {
55                     state: "default" 0.0;
56                     rel1 { relative: 0.0 50/1280;}
57                     rel2 { relative: 1.0 (1.0+1.0/1280);}
58                     color: 0 0 0 0;
59                 }
60             }
61         //EDC_PART_IMAGE("bg_img", "bg", EDC_IMAGE("images/59_calculator_bg.png")) /* DON'T REMOVE */
62         EDC_PART_IMAGE("bg_img", "bg", EDC_IMAGE("images/P04_calculator_bg.png"))
63
64         EDC_PART_PADDING_BR("entry_img_pad_br_por", EDC_SIZE(PADDING_RIGHT_POR, 0), "bg")
65
66         /* Input Entry */
67         part {
68             name: "entry/rect";
69             type: IMAGE;
70             mouse_events: 1;
71             scale: 1;
72
73             description {
74                 state: "default" 0.0;
75                 visible: 1;
76                 min: 0 252;
77                 fixed: 0 1;
78                 align: 0.5 0;
79                 rel1 {relative: 24/720 110/1280;}
80                 rel2 {relative: (720-24)/720 (50+60+252)/1280;}
81                 image {
82                     normal: "images/P04_calculator_input_bg.png";
83                     border: 24 24 79 24;
84                     border_scale: 1;
85                 }
86             }
87         }
88
89         EDC_PART_PADDING_TL("entry_swl_pad_tl_por", EDC_SIZE(32, 38), "entry/rect")
90         EDC_PART_PADDING_BR("entry_swl_pad_br_por", EDC_SIZE(32, 46), "entry/rect")
91
92         part {
93             name: "input/entry";
94             type: SWALLOW;
95             mouse_events: 1;
96             description {
97                 state: "default" 0.0;
98                 visible: 1;
99                 rel1 {relative: 1.0 1.0; to: "entry_swl_pad_tl_por";}
100                 rel2 {relative: 0.0 0.0; to: "entry_swl_pad_br_por";}
101             }
102         }
103
104         /* History Entry */
105         part {
106             name: "history_rect_padding_br";
107             type: RECT;
108             mouse_events: 0;
109             description {
110                 state: "default" 0.0;
111                 rel1 {relative: 24/720 (1280-61)/1280;}
112                 rel2 {relative: (720-24)/720 1.0;}
113                 color: 0 0 0 0;
114             }
115         }
116         part {
117             name: "history/rect";
118             type: IMAGE;
119             mouse_events: 0;
120             description {
121                 state: "default" 0.0;
122                 visible: 0;
123                 rel1 { relative: 0.0 0.0; to: "entry/rect";}
124                 rel2 {
125                     relative: 1.0 0.0;
126                     to_x: "entry/rect";
127                     to_y: "history_rect_padding_br";
128                 }
129                 image {
130                     normal: "images/P04_calculator_input_bg.png";
131                     border: 24 24 79 24;
132                     border_scale: 1;
133                 }
134             }
135            description {
136                 state: "show" 0.0;
137                 inherit: "default" 0.0;
138                 visible: 1;
139                 image {
140                     normal: "images/P04_calculator_input_bg_02.png";
141                     border: 24 24 79 24;
142                     border_scale: 1;
143                 }
144             }
145         }
146
147         EDC_PART_RECT_PADDING("history/rect2", "history/rect",
148            EDC_COOR(32, 32), EDC_COOR(32, 42))
149         EDC_PART_SWALLOW_HIDE_SHOW("history/scroll", "history/rect2")
150
151         /* Keypad */
152         EDC_PART_SWALLOW_SHOW_HIDE("por_pannel/rect", "bg")
153         EDC_PART_SWALLOW_SHOW_HIDE("lan_pannel/rect", "bg")
154
155         part {
156             name: "history/clear/image";
157             type: IMAGE;
158             mouse_events: 1;
159             description {
160                 state: "default" 0.0;
161                 visible: 0;
162
163                 rel1 { relative: 0.0 0.0; to: "history/rect"; offset: 32 38;}
164                     rel2 { relative: 0.0 0.0; to: "history/rect"; offset: 96 102;}
165                 image {
166                     normal: "images/P04_calculator_button_clear_dim.png";
167                    // border: 24 24 79 24;
168                    // border_scale: 1;
169                 }
170             }
171             description {
172                 state: "up" 0.0;
173                 inherit: "default" 0.0;
174                 visible: 1;
175                 image {
176                     normal: "images/P04_calculator_button_clear_dim.png";
177
178                 }
179             }
180
181             description {
182                 state: "press" 0.0;
183                 inherit: "default" 0.0;
184                 visible: 1;
185                 image {
186                     normal: "images/P04_calculator_button_clear_press.png";
187
188                 }
189             }
190         }
191
192     }
193
194     programs {
195         program {
196             name: "group_load";
197             signal: "load";
198             script {
199                 set_int(result_show, 0);
200             }
201         }
202
203         program {
204             name: "show_history";
205             signal: "show,hist";
206             source: "";
207             script {
208                 set_state(PART:"history/scroll", "show", 0.0);
209                 set_state(PART:"history/rect", "show", 0.0);
210                 set_state(PART:"history/clear/image", "up", 0.0);
211
212             }
213         }
214         program {
215             name: "hide_history";
216             signal: "hide,hist";
217             source: "";
218             script {
219                 set_state(PART:"history/scroll", "default", 0.0);
220                 set_state(PART:"history/rect", "default", 0.0);
221                 set_state(PART:"history/clear/image", "default", 0.0);
222
223             }
224         }
225         program {
226             name: "to_portrait";
227             signal: "portrait";
228             source: "";
229             script {
230                 set_state(PART:"entry/rect", "default", 0.0);
231                 set_state(PART:"input/entry", "default", 0.0);
232                 set_state(PART:"lan_pannel/rect", "hide", 0.0);
233                 set_state(PART:"por_pannel/rect", "default", 0.0);
234                 set_state(PART:"bg_img", "default", 0.0);
235                 set_state(PART:"bg", "default", 0.0);
236                 set_state(PART:"head", "default", 0.0);
237             }
238         }
239
240         program {
241                         name: "clear_click";
242                         signal: "mouse,clicked,1";
243                         source: "history/clear/image";
244             action: SIGNAL_EMIT "clicked" "";
245                 }
246                 program {
247                         name: "clear_click1";
248                         signal: "mouse,down,1";
249                         source: "history/clear/image";
250             action: STATE_SET "press" 0.0;
251                         target: "history/clear/image";
252                 }
253                 program {
254                         name: "clear_click2";
255                         signal: "mouse,up,1";
256                         source: "history/clear/image";
257             action: STATE_SET "up" 0.0;
258                         target: "history/clear/image";
259                 }
260
261     }
262 }
263
264
265
266
267
268
269
270
271
272
273
274
275