Change DrawMode::OVERLAY to DrawMode::OVERLAY_2D
[platform/core/uifw/dali-demo.git] / resources / scripts / table-view.json
1 /*
2  * Copyright (c) 2015 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   // a tree of actors
19   /*
20    *  4 by 4 table:
21    * |------------------------------------|
22    * |          |    2(right,top)|   |    |
23    * |  -  -  - |----------------|---|----|
24    * |          |                |   |    |
25    * |          |                |   |    |
26    * |          |                |   |    |
27    * |  -  -  - |  -  -  -  -  - |--------|
28    * |          |                |   |    |
29    * |    1     |                |   |    |
30    * |          |  3             | 4 |    |
31    * |          |aligned to      |   |    |
32    * |          |(left, center)  |   |    |
33    * |  -  -  - |  -  -  -  -  - |--------|
34    * |          |                |   '    |
35    * |          |                |   '    |
36    * |          |                |   5    |
37    * |          |                |   '    |
38    * |          |                |   '    |
39    * |------------------------------------|
40   */
41
42   "stage": [{
43       "name":"simple-table",
44       "type":"TableView",
45       "background-color": [0.5,0.5,0,1],
46       "parent-origin": "CENTER",
47       "draw-mode": "OVERLAY_2D",
48       "size":[400,400,1],
49       "rows": 4,
50       "columns": 4,
51       "cell-padding": [10, 5],
52       "layout-rows": {  // set the height of the rows
53         "0": { "policy": "fixed", "value": 40 },
54         "1": { "policy": "relative", "value": 0.33 },
55         "2": { "policy": "fit", "value": 0 }
56       },
57       "layout-columns": { // set the widths of the columns
58         "0": { "policy": "fit", "value": 0 },
59         "2": { "policy": "relative", "value": 0.2 },
60         "3": { "policy": "fixed", "value": 30 }
61       },
62       "actors": [{
63           "name":"gallery-1",
64           "type":"ImageActor",
65           "height-resize-policy":"FILL_TO_PARENT",
66           "image": {
67             "filename": "{DALI_IMAGE_DIR}gallery-small-1.jpg"
68           },
69           "custom-properties": { // properties registered dynamically
70             "cell-index": [0,0], // property to specify the top-left cell this child occupies
71             "row-span":4, // property to specify how many rows this child occupies, if not set, default value is 1
72             "column-span":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1
73           }
74         },{
75           "name":"gallery-2",
76           "type":"ImageActor",
77           "height-resize-policy":"FILL_TO_PARENT",
78           "image": {
79             "filename": "{DALI_IMAGE_DIR}gallery-small-2.jpg"
80           },
81           "custom-properties": { // properties registered dynamically
82             "cell-index": [0,1],
83             "cell-horizontal-alignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left'
84           }
85         },{
86           "name":"gallery-3",
87           "type":"ImageActor",
88           "image": {
89             "filename": "{DALI_IMAGE_DIR}gallery-small-3.jpg"
90           },
91           "custom-properties": {
92             "cell-index":[1,1],
93             "row-span":3,
94             "cell-horizontal-alignment": "left",// property to specify how to align horizontally inside the cells, if not set, default value is 'left'
95             "cell-vertical-alignment": "center" // property to specify how to align vertically inside the cells, if not set, default value is 'top'
96           }
97         }, {
98           "name":"gallery-4",
99           "type":"ImageActor",
100           "width-resize-policy":"FILL_TO_PARENT",
101           "image": {
102             "filename": "{DALI_IMAGE_DIR}gallery-small-4.jpg"
103           },
104           "custom-properties": {
105             "cell-index":[2,2]
106           }
107         }, {
108           "name":"gallery-5",
109           "type":"ImageActor",
110           "width-resize-policy":"FILL_TO_PARENT",
111           "height-resize-policy":"FILL_TO_PARENT",
112           "image": {
113             "filename": "{DALI_IMAGE_DIR}gallery-small-5.jpg"
114           },
115           "custom-properties": {
116             "cell-index":[3,2],
117             "column-span": 2
118           }
119         }]
120     }]
121 }