DALi Version 1.4.27
[platform/core/uifw/dali-demo.git] / resources / scripts / popup.json
1 {
2   "constants": {
3     "CONFIG_SCRIPT_LOG_LEVEL": "Verbose"
4   },
5   "stage": [
6     {
7       "type": "ConfirmationPopup",
8       "name": "confirmationPopup",
9       "parentOrigin": [0.5, 0.55, 0.5],
10       "anchorPoint": "CENTER",
11       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
12       "heightResizePolicy": "USE_NATURAL_SIZE",
13       "sizeModeFactor": [0.65, 1.0, 1.0],
14       "tailVisibility": false,
15       "tailPosition": [0, 0, 0],
16       "displayChangeAnimationDuration": 1.0,
17       "contextualMode": "NON_CONTEXTUAL",
18       "animationMode": "ZOOM",
19       "controlOk": "controlOk",
20       "controlCancel": "controlCancel",
21       "connectSignalOkSelected": "clicked",
22       "connectSignalCancelSelected": "clicked",
23       "title": {
24         "type": "TextLabel",
25         "text": "Title text",
26         "textColor": [1, 1, 1, 1]
27       },
28       "content": {
29         "type": "TextLabel",
30         "text": "Content text",
31         "padding": [20, 20, 20, 0],
32         "textColor": [1, 1, 1, 1]
33       },
34       "footer": {
35         "type": "Control",
36         "size": [0, 80, 0],
37         "widthResizePolicy": "FILL_TO_PARENT",
38         "heightResizePolicy": "FIXED",
39         "parentOrigin": "CENTER",
40         "anchorPoint": "CENTER",
41         "actors": [
42           {
43             "type": "PushButton",
44             "name": "controlOk",
45             "parentOrigin": "CENTER_LEFT",
46             "anchorPoint": "CENTER_LEFT",
47             "position": [20, 0, 0],
48             "labelText": "OK"
49           },
50           {
51             "type": "PushButton",
52             "name": "controlCancel",
53             "parentOrigin": "CENTER_RIGHT",
54             "anchorPoint": "CENTER_RIGHT",
55             "position": [-20, 0, 0],
56             "labelText": "Cancel"
57           }
58         ]
59       },
60       "signals": [
61         {
62           "name": "controlSignalOk",
63           "action": "set",
64           "actor": "selectionLabel",
65           "property": "text",
66           "value": "User pressed: OK Button"
67         },
68         {
69           "name": "controlSignalOk",
70           "action": "set",
71           "actor": "confirmationPopup",
72           "property": "displayState",
73           "value": "HIDDEN"
74         },
75         {
76           "name": "controlSignalCancel",
77           "action": "set",
78           "actor": "selectionLabel",
79           "property": "text",
80           "value": "User pressed: Cancel Button"
81         },
82         {
83           "name": "controlSignalCancel",
84           "action": "set",
85           "actor": "confirmationPopup",
86           "property": "displayState",
87           "value": "HIDDEN"
88         },
89         {
90           "name": "touchedOutside",
91           "action": "set",
92           "actor": "confirmationPopup",
93           "property": "displayState",
94           "value": "HIDDEN"
95         },
96         {
97           "name": "touchedOutside",
98           "action": "set",
99           "actor": "selectionLabel",
100           "property": "text",
101           "value": "No button pressed, backing touched"
102         }
103       ]
104     },
105     {
106       "type": "ConfirmationPopup",
107       "name": "customAnimationPopup",
108       "parentOrigin": [0.5, 0.55, 0.5],
109       "anchorPoint": "CENTER",
110       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
111       "heightResizePolicy": "USE_NATURAL_SIZE",
112       "sizeModeFactor": [0.65, 1.0, 1.0],
113       "tailVisible": false,
114       "tailPosition": [0, 0, 0],
115       "displayChangeAnimationDuration": 1.0,
116       "contextualMode": "NON_CONTEXTUAL",
117       "controlOk": "controlOk",
118       "controlCancel": "controlCancel",
119       "connectSignalOkSelected": "clicked",
120       "connectSignalCancelSelected": "clicked",
121       "animationMode": "CUSTOM",
122       "entryAnimation": {
123         "actor": "customAnimationPopup",
124         "property": "position",
125         "value": [
126           0,
127           0,
128           0
129         ],
130         "alphaFunction": "EASE_OUT",
131         "timePeriod": {
132           "delay": 0.0,
133           "duration": 1.0
134         }
135       },
136       "exitAnimation": {
137         "actor": "customAnimationPopup",
138         "property": "position",
139         "value": [
140           -450,
141           -225,
142           0
143         ],
144         "alphaFunction": "EASE_IN",
145         "timePeriod": {
146           "delay": 0.0,
147           "duration": 1.0
148         }
149       },
150       "title": {
151         "type": "TextLabel",
152         "text": "Title text",
153         "textColor": [1, 1, 1, 1]
154       },
155       "content": {
156         "type": "TextLabel",
157         "text": "Content text",
158         "padding": [20, 20, 20, 0],
159         "textColor": [1, 1, 1, 1]
160       },
161       "footer": {
162         "type": "Control",
163         "size": [0, 80, 0],
164         "widthResizePolicy": "FILL_TO_PARENT",
165         "heightResizePolicy": "FIXED",
166         "parentOrigin": "CENTER",
167         "anchorPoint": "CENTER",
168         "actors": [
169           {
170             "type": "PushButton",
171             "name": "controlOk",
172             "parentOrigin": "CENTER_LEFT",
173             "anchorPoint": "CENTER_LEFT",
174             "position": [20, 0, 0],
175             "labelText": "OK"
176           },
177           {
178             "type": "PushButton",
179             "name": "controlCancel",
180             "parentOrigin": "CENTER_RIGHT",
181             "anchorPoint": "CENTER_RIGHT",
182             "position": [-20, 0, 0],
183             "labelText": "Cancel"
184           }
185         ]
186       },
187       "signals": [
188         {
189           "name": "controlSignalOk",
190           "action": "set",
191           "actor": "selectionLabel",
192           "property": "text",
193           "value": "User pressed: OK Button"
194         },
195         {
196           "name": "controlSignalOk",
197           "action": "set",
198           "actor": "customAnimationPopup",
199           "property": "displayState",
200           "value": "HIDDEN"
201         },
202         {
203           "name": "controlSignalCancel",
204           "action": "set",
205           "actor": "selectionLabel",
206           "property": "text",
207           "value": "User pressed: Cancel Button"
208         },
209         {
210           "name": "controlSignalCancel",
211           "action": "set",
212           "actor": "customAnimationPopup",
213           "property": "displayState",
214           "value": "HIDDEN"
215         },
216         {
217           "name": "touchedOutside",
218           "action": "set",
219           "actor": "customAnimationPopup",
220           "property": "displayState",
221           "value": "HIDDEN"
222         },
223         {
224           "name": "touchedOutside",
225           "action": "set",
226           "actor": "selectionLabel",
227           "property": "text",
228           "value": "No button pressed, backing touched"
229         }
230       ]
231     },
232     {
233       "type": "PopupToast",
234       "name": "toast",
235       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
236       "heightResizePolicy": "USE_NATURAL_SIZE",
237       "sizeModeFactor": [0.85, 0, 0],
238       "title": {
239         "type": "TextLabel",
240         "widthResizePolicy": "FILL_TO_PARENT",
241         "heightResizePolicy": "USE_NATURAL_SIZE",
242         "parentOrigin": "CENTER",
243         "anchorPoint": "CENTER",
244         "text": "This is a toast popup. \nIt will auto-hide itself.",
245         "textColor": [1, 1, 1, 1],
246         "multiLine": true,
247         "horizontalAlignment": "CENTER",
248         "verticalAlignment": "CENTER",
249         "padding": [20.0, 20.0, 20.0, 20.0]
250       }
251     },
252     {
253       "type": "PushButton",
254       "name": "popupTriggerButton",
255       "parentOrigin": [0.1, 0.1, 0.5],
256       "anchorPoint": "TOP_LEFT",
257       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
258       "heightResizePolicy": "SIZE_RELATIVE_TO_PARENT",
259       "sizeModeFactor": [0.38, 0.14, 1.0],
260       "labelText": "Popup",
261       "signals": [{
262         "name": "clicked",
263         "action": "set",
264         "actor": "confirmationPopup",
265         "property": "displayState",
266         "value": "SHOWN"
267       }]
268     },
269     {
270       "type": "PushButton",
271       "name": "animatedPopupTriggerButton",
272       "parentOrigin": [0.9, 0.1, 0.5],
273       "anchorPoint": "TOP_RIGHT",
274       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
275       "heightResizePolicy": "SIZE_RELATIVE_TO_PARENT",
276       "sizeModeFactor": [0.38, 0.14, 1.0],
277       "labelText": "Animated",
278       "signals": [{
279         "name": "clicked",
280         "action": "set",
281         "actor": "customAnimationPopup",
282         "property": "displayState",
283         "value": "SHOWN"
284       }]
285     },
286     {
287       "type": "PushButton",
288       "name": "toastTriggerButton",
289       "parentOrigin": [0.5, 1.0, 0.5],
290       "anchorPoint": "BOTTOM_CENTER",
291       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
292       "heightResizePolicy": "SIZE_RELATIVE_TO_PARENT",
293       "sizeModeFactor": [0.5, 0.14, 1.0],
294       "labelText": "Push for Toast",
295       "signals": [{
296         "name": "clicked",
297         "action": "set",
298         "actor": "toast",
299         "property": "displayState",
300         "value": "SHOWN"
301       }]
302     },
303     {
304       "type": "TextLabel",
305       "name": "selectionLabel",
306       "parentOrigin": [0.5, 0.22, 0.5],
307       "anchorPoint": "TOP_CENTER",
308       "widthResizePolicy": "SIZE_RELATIVE_TO_PARENT",
309       "heightResizePolicy": "SIZE_RELATIVE_TO_PARENT",
310       "sizeModeFactor": [0.9, 0.14, 1.0],
311       "text": "No selection made",
312       "horizontalAlignment": "CENTER",
313       "verticalAlignment": "CENTER"
314     }
315   ]
316 }