summaryrefslogtreecommitdiff
path: root/data/equate.edc
blob: 52955ad7421920f7efa39160365f1841bf19c51d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271


#define BUTTON_TABLE_ITEM(pname, x, y, w, h)                           \
item {                                                                  \
   type: GROUP;                                                         \
   source: pname;                                                       \
   weight: 0.5 0.5;                                                     \
   align: -1 -1;                                                        \
   position: x y;                                                       \
   span: w h;                                                           \
}


#define BUTTON(pname, label, emits)                                     \
group { name: "button/"pname;                                           \
   images {                                                             \
      image: "btn_normal.png" COMP;                                     \
      image: "btn_pressed.png" COMP;                                    \
   }                                                                    \
   parts {                                                              \
      part { name: "button_image";                                      \
         mouse_events: 1;                                               \
         description { state: "default" 0.0;                            \
            rel1.offset: 3 3;                                           \
            rel2.offset: -4 -4;                                         \
            image {                                                     \
               normal: "btn_normal.png";                                \
               border: 7 7 7 7;                                         \
            }                                                           \
                                                                        \
         }                                                              \
         description { state: "clicked" 0.0;                            \
            inherit: "default" 0.0;                                     \
            image.normal: "btn_pressed.png";                            \
            image.border: 7 7 7 7;                                      \
         }                                                              \
      }                                                                 \
                                                                        \
      part {                                                            \
         name:          "elm.text";                                     \
         type:          TEXT;                                           \
         effect:        SHADOW;                                         \
         mouse_events:  0;                                              \
         scale: 1;                                                      \
         description { state: "default" 0.0;                            \
            visible: 1;                                                 \
            rel1.offset: 4 4;                                           \
            rel2.offset: -5 -5;                                         \
            color: 255 255 255 240;                                     \
            color3: 20 20 20 128;                                       \
            /* color: 172 179 191 255; */                               \
            /* color3: 0 0 0 30; */                                     \
            text {                                                      \
               font:     "Sans";                                        \
               size:     25;                                            \
               min:      1 1;                                           \
               align:    0.5 0.5;                                       \
               text_class: "button";                                    \
               text: label;                                             \
            }                                                           \
         }                                                              \
      }                                                                 \
      part {                                                            \
         name: "over1";                                                 \
         mouse_events: 0;                                               \
         type: RECT;                                                    \
         description {                                                  \
            state: "default" 0.0;                                       \
            rel2.relative: 1.0 0.5;                                     \
            color: 0 0 0 0;                                             \
         }                                                              \
         description { state: "disabled" 0.0;                           \
            inherit:  "default" 0.0;                                    \
         }                                                              \
      }                                                                 \
      part { name: "over2";                                             \
         mouse_events: 1;                                               \
         repeat_events: 1;                                              \
         ignore_flags: ON_HOLD;                                         \
         type: RECT;                                                    \
         description {                                                  \
            state: "default" 0.0;                                       \
            color: 0 0 0 0;                                             \
         }                                                              \
         description {                                                  \
            state: "disabled" 0.0;                                      \
            inherit:  "default" 0.0;                                    \
            visible: 0;                                                 \
         }                                                              \
      }                                                                 \
      part { name: "over3";                                             \
         mouse_events: 1;                                               \
         repeat_events: 1;                                              \
         type: RECT;                                                    \
         description { state: "default" 0.0;                            \
            color: 255 255 255 0;                                       \
         }                                                              \
         description { state: "clicked" 0.0;                            \
            inherit:  "default" 0.0;                                    \
            color: 255 255 255 0;                                       \
         }                                                              \
      }                                                                 \
                                                                        \
                                                                        \
   }                                                                    \
   programs {                                                           \
      program {                                                         \
         name:   "button_click";                                        \
         signal: "mouse,down,1";                                        \
         source: "over2";                                               \
         action: STATE_SET "clicked" 0.0;                               \
         target: "button_image";                                        \
      }                                                                 \
                                                                        \
      program {                                                         \
         name:   "button_unclick";                                      \
         signal: "mouse,up,1";                                          \
         source: "over3";                                               \
         action: STATE_SET "default" 0.0;                               \
         target: "button_image";                                        \
      }                                                                 \
      program {                                                         \
         name:   "button_click2";                                       \
         signal: "mouse,down,1";                                        \
         source: "over3";                                               \
         action: STATE_SET "clicked" 0.0;                               \
         target: "over3";                                               \
      }                                                                 \
      program {                                                         \
         name:   "button_unclick2";                                     \
         signal: "mouse,up,1";                                          \
         source: "over3";                                               \
         action: STATE_SET "default" 0.0;                               \
         transition: DECELERATE 0.5;                                    \
         target: "over3";                                               \
      }                                                                 \
      program {                                                         \
         name:   "button_unclick3";                                     \
         signal: "mouse,clicked,1";                                     \
         source: "over2";                                               \
         action: SIGNAL_EMIT emits "";                                  \
      }                                                                 \
   }                                                                    \
}

images {
   image: "bg.png" COMP;
   image: "shading.png" COMP;
   image: "brushed_texture.png" COMP;
   image: "metalsphere.png" COMP;
   image: "entry_disabled.png" COMP;
   image: "entry_light_overlay.png" COMP;
}
collections {

   BUTTON("add", "+", "OP_ADD");
   BUTTON("min", "-", "OP_SUB");
   BUTTON("mul", "*", "OP_MUT");
   BUTTON("div", "/", "OP_DIV");

   BUTTON("seven", "7", "NUM_7");
   BUTTON("height", "8", "NUM_8");
   BUTTON("nine", "9", "NUM_9");
   BUTTON("clear", "C", "OP_CLR");

   BUTTON("four", "4", "NUM_4");
   BUTTON("five", "5", "NUM_5");
   BUTTON("six", "6", "NUM_6");
   BUTTON("obrak", "(", "OP_OBRAK");

   BUTTON("one", "1", "NUM_1");
   BUTTON("two", "2", "NUM_2");
   BUTTON("three", "3", "NUM_3");
   BUTTON("cbrak", ")", "OP_CBRAK");

   BUTTON("zero", "0", "NUM_0");
   BUTTON("point", ".", "OP_DEC");
   BUTTON("equal", "=", "OP_EQU");

   group {
      name: "Main";

      parts {
         part {
            name: "bg";
            type: RECT;
            mouse_events: 0;
            description
            {
               state: "default" 0.0;
               visible: 1;
               color: 255 255 255 255;
            }
         }

         part {
            name: "EquateAnswer";
            type: TEXT;
            mouse_events: 0;
            description
            {
               state: "default" 0.0;
               visible: 1;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 2 0;
               } rel2 {
                  relative: 1.0 0.0;
                  offset: -1 0;

               }
               fixed: 1 1;
               align: 0.5 0;
               color: 0 0 0 255;
               color3: 192 192 192 255;
               text
               {
                  text: "";
                  font: "Sans";
                  size: 30;
                  //fit: 0 0;
                  min: 1 1;
                  align: 1.0 0.5;
               }
            }
         }

         part {
            name : "table_description";
            type : TABLE;
            description {
               state : "default" 0.0;
               fixed: 0 1;
               rel1.to: "EquateAnswer";
               rel1.relative: 0 1;
               table {
                  homogeneous: TABLE;
                  padding: 0 0;
               }
            }
            table {
               items {
                  BUTTON_TABLE_ITEM("button/add",    0, 0, 1, 1);
                  BUTTON_TABLE_ITEM("button/min",    1, 0, 1, 1);
                  BUTTON_TABLE_ITEM("button/mul",    2, 0, 1, 1);
                  BUTTON_TABLE_ITEM("button/div",    3, 0, 1, 1);

                  BUTTON_TABLE_ITEM("button/seven",  0, 1, 1, 1);
                  BUTTON_TABLE_ITEM("button/height", 1, 1, 1, 1);
                  BUTTON_TABLE_ITEM("button/nine",   2, 1, 1, 1);
                  BUTTON_TABLE_ITEM("button/clear",  3, 1, 1, 1);

                  BUTTON_TABLE_ITEM("button/four",   0, 2, 1, 1);
                  BUTTON_TABLE_ITEM("button/five",   1, 2, 1, 1);
                  BUTTON_TABLE_ITEM("button/six",    2, 2, 1, 1);
                  BUTTON_TABLE_ITEM("button/obrak",  3, 2, 1, 1);

                  BUTTON_TABLE_ITEM("button/one",    0, 3, 1, 1);
                  BUTTON_TABLE_ITEM("button/two",    1, 3, 1, 1);
                  BUTTON_TABLE_ITEM("button/three",  2, 3, 1, 1);
                  BUTTON_TABLE_ITEM("button/cbrak",  3, 3, 1, 1);

                  BUTTON_TABLE_ITEM("button/zero",   0, 4, 1, 1);
                  BUTTON_TABLE_ITEM("button/point",  1, 4, 1, 1);
                  BUTTON_TABLE_ITEM("button/equal",  2, 4, 2, 1);
               }
            }
         }
      }
     
}