Improved layout in text-field example
[platform/core/uifw/dali-demo.git] / demo / scripts / button.json
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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 {
18   "constants": {
19     "CONFIG_SCRIPT_LOG_LEVEL": "Verbose"
20   },
21   "stage": [
22     // First Button
23     {
24       "type": "PushButton",
25       "parent-origin": "TOP_CENTER",
26       "anchor-point": "TOP_CENTER",
27       "position": [0, 0, 0],
28       "size": [0, 200, 0],
29       "normal-state-actor": {
30         "type": "ImageActor",
31         "image": {
32           "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png"
33         }
34       },
35       "selected-state-actor": {
36         "type": "ImageActor",
37         "image": {
38           "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png"
39         }
40       },
41       "label-actor": {
42         "type": "TextView",
43         "text": "Normal"
44       }
45     },
46
47     // Second Button
48     {
49       "type": "PushButton",
50       "parent-origin": "CENTER",
51       "anchor-point": "CENTER",
52       "position": [0, 0, 0],
53       "size": [0, 200, 0],
54       "label-actor": {
55         "type": "TextView",
56         "text": "Disabled"
57       },
58       "disabled": true,
59       "normal-state-actor": {
60         "type": "ImageActor",
61         "image": {
62           "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png"
63         }
64       },
65       "selected-state-actor": {
66         "type": "ImageActor",
67         "image": {
68           "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png"
69         }
70       },
71       "disabled-state-actor": {
72         "type": "ImageActor",
73         "image": {
74           "filename": "{DALI_IMAGE_DIR}blocks-brick-3.png"
75         }
76       }
77     },
78
79     // Third Button
80     {
81       "type": "PushButton",
82       "name": "toggle-button",
83       "parent-origin": "BOTTOM_CENTER",
84       "anchor-point": "BOTTOM_CENTER",
85       "position": [0, 0, 0],
86       "size": [0, 200, 0],
87       "label-actor": {
88         "type": "TextView",
89         "text": "Toggle"
90       },
91       "togglable": true,
92       "normal-state-actor": {
93         "type": "ImageActor",
94         "style": "STYLE_NINE_PATCH",
95         "border": [26, 24, 26, 23],
96         "image": {
97           "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png"
98         }
99       },
100       "selected-state-actor": {
101         "type": "ImageActor",
102         "style": "STYLE_NINE_PATCH",
103         "border": [26, 24, 26, 23],
104         "image": {
105           "filename": "{DALI_IMAGE_DIR}blocks-paddle.png"
106         }
107       },
108       "signals": [{
109         "name": "selected",
110         "action": "set",
111         "actor": "toggle-button",
112         "property": "label-actor",
113         "value": {
114           "type": "TextView",
115           "text": "Using a 9-patch image"
116         }
117       }]
118     }
119   ]
120 }