Removal of Actor::Insert API
[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       "size":[400,400,1],
48       "rows": 4,
49       "columns": 4,
50       "cell-padding": [10, 5],
51       "layout-rows": {  // set the height of the rows
52         "0": { "policy": "fixed", "value": 40 },
53         "1": { "policy": "relative", "value": 0.33 },
54         "2": { "policy": "fit", "value": 0 }
55       },
56       "layout-columns": { // set the widths of the columns
57         "0": { "policy": "fit", "value": 0 },
58         "2": { "policy": "relative", "value": 0.2 },
59         "3": { "policy": "fixed", "value": 30 }
60       },
61       "actors": [{
62           "name":"gallery-1",
63           "type":"ImageActor",
64           "height-resize-policy":"FILL_TO_PARENT",
65           "image": {
66             "filename": "{DALI_IMAGE_DIR}gallery-small-1.jpg"
67           },
68           "custom-properties": { // properties registered dynamically
69             "cell-index": [0,0], // property to specify the top-left cell this child occupies
70             "row-span":4, // property to specify how many rows this child occupies, if not set, default value is 1
71             "column-span":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1
72           }
73         },{
74           "name":"gallery-2",
75           "type":"ImageActor",
76           "height-resize-policy":"FILL_TO_PARENT",
77           "image": {
78             "filename": "{DALI_IMAGE_DIR}gallery-small-2.jpg"
79           },
80           "custom-properties": { // properties registered dynamically
81             "cell-index": [0,1],
82             "cell-horizontal-alignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left'
83           }
84         },{
85           "name":"gallery-3",
86           "type":"ImageActor",
87           "image": {
88             "filename": "{DALI_IMAGE_DIR}gallery-small-3.jpg"
89           },
90           "custom-properties": {
91             "cell-index":[1,1],
92             "row-span":3,
93             "cell-horizontal-alignment": "left",// property to specify how to align horizontally inside the cells, if not set, default value is 'left'
94             "cell-vertical-alignment": "center" // property to specify how to align vertically inside the cells, if not set, default value is 'top'
95           }
96         }, {
97           "name":"gallery-4",
98           "type":"ImageActor",
99           "width-resize-policy":"FILL_TO_PARENT",
100           "image": {
101             "filename": "{DALI_IMAGE_DIR}gallery-small-4.jpg"
102           },
103           "custom-properties": {
104             "cell-index":[2,2]
105           }
106         }, {
107           "name":"gallery-5",
108           "type":"ImageActor",
109           "width-resize-policy":"FILL_TO_PARENT",
110           "height-resize-policy":"FILL_TO_PARENT",
111           "image": {
112             "filename": "{DALI_IMAGE_DIR}gallery-small-5.jpg"
113           },
114           "custom-properties": {
115             "cell-index":[3,2],
116             "column-span": 2
117           }
118         }]
119     }]
120 }