2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <dali-toolkit-test-suite-utils.h>
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/devel-api/controls/control-devel.h>
24 #include <dali-toolkit/devel-api/layouting/absolute-layout.h>
25 #include <dali-toolkit/devel-api/layouting/linear-layout.h>
27 #include <../custom-layout.h>
29 #include <layout-utils.h>
32 using namespace Toolkit;
34 void utc_dali_toolkit_layouting_startup(void)
36 test_return_value = TET_UNDEF;
39 void utc_dali_toolkit_layouting_cleanup(void)
41 test_return_value = TET_PASS;
44 int UtcDaliLayouting_HboxLayout01(void)
46 ToolkitTestApplication application;
47 tet_infoline(" UtcDaliLayouting_HboxLayout01");
49 Stage stage = Stage::GetCurrent();
50 auto hbox = Control::New();
51 auto hboxLayout = LinearLayout::New();
52 hboxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
53 DevelControl::SetLayout( hbox, hboxLayout );
54 hbox.SetName( "HBox");
56 std::vector< Control > controls;
57 controls.push_back( CreateLeafControl( 40, 40 ) );
58 controls.push_back( CreateLeafControl( 60, 40 ) );
59 controls.push_back( CreateLeafControl( 80, 40 ) );
60 controls.push_back( CreateLeafControl( 100, 40 ) );
62 for( auto&& iter : controls )
66 hbox.SetParentOrigin( ParentOrigin::CENTER );
67 hbox.SetAnchorPoint( AnchorPoint::CENTER );
70 // Ensure layouting happens
71 application.SendNotification();
74 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
75 // hbox left justifies elements
76 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
77 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
78 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
79 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
81 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
82 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
83 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
84 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
87 auto newHBoxLayout = LinearLayout::New();
88 newHBoxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
89 DevelControl::SetLayout( hbox, newHBoxLayout );
91 application.SendNotification();
94 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
95 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
96 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
97 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
102 int UtcDaliLayouting_HboxLayout02(void)
104 ToolkitTestApplication application;
105 tet_infoline(" UtcDaliLayouting_HboxLayout02 Test nested hboxes with default spec of WRAP_CONTENT");
107 Stage stage = Stage::GetCurrent();
109 auto hbox1 = Control::New();
110 auto hboxLayout1 = LinearLayout::New();
111 DevelControl::SetLayout( hbox1, hboxLayout1 );
113 auto hbox2 = Control::New();
114 auto hboxLayout2 = LinearLayout::New();
115 DevelControl::SetLayout( hbox2, hboxLayout2 );
117 hbox1.SetName( "HBox1");
118 hbox2.SetName( "HBox2");
120 std::vector< Control > controls;
121 controls.push_back( CreateLeafControl( 20, 40 ) );
122 controls.push_back( CreateLeafControl( 30, 50 ) );
123 controls.push_back( CreateLeafControl( 40, 60 ) );
124 controls.push_back( CreateLeafControl( 50, 70 ) );
126 controls.push_back( CreateLeafControl( 25, 40 ) );
127 controls.push_back( CreateLeafControl( 35, 50 ) );
128 controls.push_back( CreateLeafControl( 45, 60 ) );
129 controls.push_back( CreateLeafControl( 55, 70 ) );
132 for( auto&& iter : controls )
144 hbox1.SetParentOrigin( ParentOrigin::CENTER );
145 hbox1.SetAnchorPoint( AnchorPoint::CENTER );
146 hbox2.SetParentOrigin( ParentOrigin::CENTER );
147 hbox2.SetAnchorPoint( AnchorPoint::CENTER );
149 auto hbox3 = Control::New();
150 auto hboxLayout3 = LinearLayout::New();
151 DevelControl::SetLayout( hbox3, hboxLayout3 );
153 hbox3.SetParentOrigin( ParentOrigin::CENTER );
154 hbox3.SetName( "HBox3");
160 // Ensure layouting happens
161 application.SendNotification();
162 application.Render();
165 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
166 // hbox left justifies elements
167 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
168 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f, 10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
169 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 5.0f, 0.0f ), 0.0001f, TEST_LOCATION );
170 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 90.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
172 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 20.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
173 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 30.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
174 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
175 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 50.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
178 DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
179 DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 25.0f, 10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
180 DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 60.0f, 5.0f, 0.0f ), 0.0001f, TEST_LOCATION );
181 DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 105.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
183 DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 25.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
184 DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 35.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
185 DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 45.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
186 DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 55.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
188 // Test hbox1 and 2 are sized to wrap their content
189 DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 140.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
190 DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 160.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
191 DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
192 DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 140.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
194 // Test hbox3 matches parent (root layer)
195 DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
196 DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
202 int UtcDaliLayouting_HboxLayout03(void)
204 ToolkitTestApplication application;
205 tet_infoline(" UtcDaliLayouting_HboxLayout03 Test nested hboxes with MATCH_PARENT");
207 Stage stage = Stage::GetCurrent();
209 auto hbox1 = Control::New();
210 auto hboxLayout1 = LinearLayout::New();
211 DevelControl::SetLayout( hbox1, hboxLayout1 );
213 auto hbox2 = Control::New();
214 auto hboxLayout2 = LinearLayout::New();
215 DevelControl::SetLayout( hbox2, hboxLayout2 );
217 hbox1.SetName( "HBox1");
218 hbox2.SetName( "HBox2");
219 hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
220 hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
221 hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
222 hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
224 std::vector< Control > controls;
225 controls.push_back( CreateLeafControl( 20, 40 ) );
226 controls.push_back( CreateLeafControl( 30, 50 ) );
227 controls.push_back( CreateLeafControl( 40, 60 ) );
228 controls.push_back( CreateLeafControl( 50, 70 ) );
230 controls.push_back( CreateLeafControl( 25, 40 ) );
231 controls.push_back( CreateLeafControl( 35, 50 ) );
232 controls.push_back( CreateLeafControl( 45, 60 ) );
233 controls.push_back( CreateLeafControl( 55, 70 ) );
236 for( auto&& iter : controls )
248 hbox1.SetParentOrigin( ParentOrigin::CENTER );
249 hbox1.SetAnchorPoint( AnchorPoint::CENTER );
250 hbox2.SetParentOrigin( ParentOrigin::CENTER );
251 hbox2.SetAnchorPoint( AnchorPoint::CENTER );
253 auto hbox3 = Control::New();
254 auto hboxLayout3 = LinearLayout::New();
255 DevelControl::SetLayout( hbox3, hboxLayout3);
257 hbox3.SetParentOrigin( ParentOrigin::CENTER );
258 hbox3.SetName( "HBox3");
264 //std::ostringstream oss;
265 //DumpControlHierarchy( oss, Stage::GetCurrent().GetRootLayer() );
266 //printf("Control hierarchy: \n%s\n", oss.str().c_str() );
268 // Ensure layouting happens
269 application.SendNotification();
270 application.Render();
273 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
274 // hbox left justifies elements
275 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
276 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f,375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
277 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f,370.0f, 0.0f ), 0.0001f, TEST_LOCATION );
278 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 90.0f,365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
280 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 20.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
281 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 30.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
282 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
283 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 50.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
285 DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
286 DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 25.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
287 DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 60.0f, 370.0f, 0.0f ), 0.0001f, TEST_LOCATION );
288 DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 105.0f,365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
290 DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 25.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
291 DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 35.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
292 DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 45.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
293 DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 55.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
295 DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
296 DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
297 DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
298 DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 480.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
300 // Test hbox3 matches parent (root layer)
301 DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
302 DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
307 int UtcDaliLayouting_HboxLayout04(void)
309 ToolkitTestApplication application;
310 tet_infoline(" UtcDaliLayouting_HboxLayout04 Test nested hboxes with explicit WRAP_CONTENT");
312 Stage stage = Stage::GetCurrent();
314 auto hbox1 = Control::New();
315 auto hboxLayout1 = LinearLayout::New();
316 DevelControl::SetLayout( hbox1, hboxLayout1 );
318 auto hbox2 = Control::New();
319 auto hboxLayout2 = LinearLayout::New();
320 DevelControl::SetLayout( hbox2, hboxLayout2 );
322 hbox1.SetName( "HBox1"); // Default spec is to wrap content
323 hbox2.SetName( "HBox2");
324 hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
325 hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
326 hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
327 hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
329 std::vector< Control > controls;
330 controls.push_back( CreateLeafControl( 80, 40 ) );
331 controls.push_back( CreateLeafControl( 80, 50 ) );
332 controls.push_back( CreateLeafControl( 80, 60 ) );
333 controls.push_back( CreateLeafControl( 80, 70 ) );
335 controls.push_back( CreateLeafControl( 80, 40 ) );
336 controls.push_back( CreateLeafControl( 80, 50 ) );
337 controls.push_back( CreateLeafControl( 80, 60 ) );
338 controls.push_back( CreateLeafControl( 80, 70 ) );
341 for( auto&& iter : controls )
354 controls[6].SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
355 auto hbox3 = Control::New();
356 auto hboxLayout3 = LinearLayout::New();
357 DevelControl::SetLayout( hbox3, hboxLayout3 );
359 hbox3.SetParentOrigin( ParentOrigin::CENTER );
360 hbox3.SetName( "HBox3");
365 //std::ostringstream oss;
366 //DumpControlHierarchy( oss, Stage::GetCurrent().GetRootLayer() );
367 //printf("Control hierarchy: \n%s\n", oss.str().c_str() );
369 // Ensure layouting happens
370 application.SendNotification();
371 application.Render();
374 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
375 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f,10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
376 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 160.0f, 5.0f, 0.0f ), 0.0001f, TEST_LOCATION );
377 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 240.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
379 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
380 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
381 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
382 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
384 DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
385 DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f, 10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
386 DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 160.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
387 DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 240.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
389 DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
390 DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
391 DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
392 DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
394 DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 320.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
395 DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 320.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
396 DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
397 DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 320.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
400 // Test hbox3 matches parent (root layer)
401 DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
402 DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
407 int UtcDaliLayouting_HboxLayout05(void)
409 ToolkitTestApplication application;
410 tet_infoline(" UtcDaliLayouting_HboxLayout05 - Set children size explicitly via width & height specification");
412 Stage stage = Stage::GetCurrent();
413 auto hbox = Control::New();
414 auto hboxLayout = LinearLayout::New();
415 hboxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
416 DevelControl::SetLayout( hbox, hboxLayout );
417 hbox.SetName( "HBox");
419 std::vector< Control > controls;
420 controls.push_back( CreateLeafControl( 40, 40 ) );
421 controls.push_back( CreateLeafControl( 60, 40 ) );
422 controls.push_back( CreateLeafControl( 80, 40 ) );
423 controls.push_back( CreateLeafControl( 100, 40 ) );
425 for( auto&& iter : controls )
428 iter.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 100 );
429 iter.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, 50 );
432 hbox.SetParentOrigin( ParentOrigin::CENTER );
433 hbox.SetAnchorPoint( AnchorPoint::CENTER );
436 // Ensure layouting happens
437 application.SendNotification();
438 application.Render();
440 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
441 // hbox left justifies elements
442 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
443 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 110.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
444 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 220.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
445 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 330.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
447 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
448 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
449 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
450 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
455 int UtcDaliLayouting_HboxLayout06(void)
457 ToolkitTestApplication application;
458 tet_infoline(" UtcDaliLayouting_HboxLayout06 - Test nested layouts");
460 Stage stage = Stage::GetCurrent();
462 auto rootControl = Control::New();
463 auto absoluteLayout = AbsoluteLayout::New();
464 DevelControl::SetLayout( rootControl, absoluteLayout );
465 rootControl.SetName( "AbsoluteLayout" );
466 stage.Add( rootControl );
468 auto hbox = Control::New();
469 auto hboxLayout = LinearLayout::New();
470 hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
471 DevelControl::SetLayout( hbox, hboxLayout );
472 hbox.SetName( "HBox" );
474 std::vector< Control > controls;
475 controls.push_back( CreateLeafControl( 40, 40 ) );
476 controls.push_back( CreateLeafControl( 60, 40 ) );
478 for( auto&& iter : controls )
482 hbox.SetParentOrigin( ParentOrigin::CENTER );
483 hbox.SetAnchorPoint( AnchorPoint::CENTER );
484 rootControl.Add( hbox );
486 // Ensure layouting happens
487 application.SendNotification();
488 application.Render();
490 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
491 // hbox left justifies elements
492 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
493 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 40.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
495 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
496 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
498 DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
501 auto newHBoxLayout = LinearLayout::New();
502 newHBoxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
503 DevelControl::SetLayout( hbox, newHBoxLayout );
505 hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
506 hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
508 application.SendNotification();
509 application.Render();
511 DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
513 // Change size specification
514 hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
515 hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
517 application.SendNotification();
518 application.Render();
520 DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
522 // Use WRAP_CONTENT again
523 hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
524 hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
526 application.SendNotification();
527 application.Render();
529 DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
535 int UtcDaliLayouting_HboxLayout07(void)
537 ToolkitTestApplication application;
538 tet_infoline(" UtcDaliLayouting_HboxLayout07 - Set LTR/RTL direction");
540 Stage stage = Stage::GetCurrent();
541 auto hbox = Control::New();
542 auto hboxLayout = LinearLayout::New();
543 hboxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
544 DevelControl::SetLayout( hbox, hboxLayout );
545 hbox.SetName( "HBox");
547 std::vector< Control > controls;
548 controls.push_back( CreateLeafControl( 40, 40 ) );
549 controls.push_back( CreateLeafControl( 60, 40 ) );
550 controls.push_back( CreateLeafControl( 80, 40 ) );
551 controls.push_back( CreateLeafControl( 100, 40 ) );
553 for( auto&& iter : controls )
557 hbox.SetParentOrigin( ParentOrigin::CENTER );
558 hbox.SetAnchorPoint( AnchorPoint::CENTER );
561 hbox.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
563 // Ensure layouting happens
564 application.SendNotification();
565 application.Render();
567 // hbox centers elements vertically, it fills test harness stage, which is 480x800 from left to right.
568 // hbox left justifies elements
569 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
570 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
571 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
572 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
574 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
575 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
576 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
577 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
579 hbox.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
581 // Ensure layouting happens
582 application.SendNotification();
583 application.Render();
585 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 470.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
586 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 400.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
587 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 310.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
588 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 200.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
590 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
591 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
592 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
593 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
598 int UtcDaliLayouting_HboxLayout08(void)
600 ToolkitTestApplication application;
601 tet_infoline(" UtcDaliLayouting_HboxLayout08 - Test layout animation");
603 Stage stage = Stage::GetCurrent();
605 auto rootControl = Control::New();
606 auto absoluteLayout = AbsoluteLayout::New();
607 absoluteLayout.SetAnimateLayout( true );
608 DevelControl::SetLayout( rootControl, absoluteLayout );
609 rootControl.SetName( "AbsoluteLayout" );
610 stage.Add( rootControl );
612 Control control1 = CreateLeafControl( 40, 40 );
613 rootControl.Add( control1 );
615 auto hbox = Control::New();
616 auto hboxLayout = LinearLayout::New();
617 hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
618 DevelControl::SetLayout( hbox, hboxLayout );
619 hbox.SetName( "HBox" );
621 Control control2 = CreateLeafControl( 40, 40 );
622 hbox.Add( control2 );
624 hbox.SetParentOrigin( ParentOrigin::CENTER );
625 hbox.SetAnchorPoint( AnchorPoint::CENTER );
626 rootControl.Add( hbox );
628 DALI_TEST_EQUALS( absoluteLayout.IsLayoutAnimated(), true, TEST_LOCATION );
629 DALI_TEST_EQUALS( DevelControl::GetLayout( control1 ).IsLayoutAnimated(), true, TEST_LOCATION );
630 DALI_TEST_EQUALS( hboxLayout.IsLayoutAnimated(), false, TEST_LOCATION );
631 DALI_TEST_EQUALS( DevelControl::GetLayout( control2 ).IsLayoutAnimated(), false, TEST_LOCATION );
633 hboxLayout.SetAnimateLayout( true );
634 absoluteLayout.SetAnimateLayout( false );
636 DALI_TEST_EQUALS( absoluteLayout.IsLayoutAnimated(), false, TEST_LOCATION );
637 DALI_TEST_EQUALS( DevelControl::GetLayout( control1 ).IsLayoutAnimated(), false, TEST_LOCATION );
638 DALI_TEST_EQUALS( hboxLayout.IsLayoutAnimated(), true, TEST_LOCATION );
639 DALI_TEST_EQUALS( DevelControl::GetLayout( control2 ).IsLayoutAnimated(), true, TEST_LOCATION );
646 int UtcDaliLayouting_HboxLayout_Padding01(void)
648 ToolkitTestApplication application;
649 tet_infoline("UtcDaliLayouting_HboxLayout_Padding01 - Adding Padding to a single child");
651 Stage stage = Stage::GetCurrent();
652 auto hbox = Control::New();
653 auto hboxLayout = LinearLayout::New();
654 DevelControl::SetLayout( hbox, hboxLayout );
655 hbox.SetName( "HBox");
657 std::vector< Control > controls;
658 controls.push_back( CreateLeafControl( 40, 40 ) );
659 controls.push_back( CreateLeafControl( 60, 40 ) );
660 controls.push_back( CreateLeafControl( 80, 40 ) );
661 controls.push_back( CreateLeafControl( 100, 40 ) );
663 const Extents CONTROL_PADDING = Extents(5, 10, 20, 2 );
664 tet_printf( "\nAdding Padding to control at index %u \n", 1 );
665 controls[1].SetProperty(Toolkit::Control::Property::PADDING, CONTROL_PADDING );
667 for( auto&& iter : controls )
671 hbox.SetParentOrigin( ParentOrigin::CENTER );
672 hbox.SetAnchorPoint( AnchorPoint::CENTER );
675 // Ensure layouting happens
676 application.SendNotification();
677 application.Render();
679 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
680 // hbox left justifies elements
681 tet_infoline("Test Child Actor Position");
682 float xPositionOfControlBeingTested = 0.0f;
683 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
685 0.0f ), 0.0001f, TEST_LOCATION );
686 xPositionOfControlBeingTested += 40.0f;
688 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
689 380.0f - ( ( CONTROL_PADDING.top + CONTROL_PADDING.bottom) * 0.5f ), 0.0f ),
690 0.0001f, TEST_LOCATION );
692 xPositionOfControlBeingTested += 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
693 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
695 xPositionOfControlBeingTested += 80.0f;
696 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
698 tet_infoline("Test Child Actor Size");
699 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
701 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
702 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom , 0.0f ),
703 0.0001f, TEST_LOCATION );
705 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
706 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
711 int UtcDaliLayouting_HboxLayout_Padding02(void)
713 ToolkitTestApplication application;
714 tet_infoline("UtcDaliLayouting_HboxLayout_Padding02 - Adding Padding to a all children");
716 Stage stage = Stage::GetCurrent();
717 auto hbox = Control::New();
718 auto hboxLayout = LinearLayout::New();
719 DevelControl::SetLayout( hbox, hboxLayout );
720 hbox.SetName( "HBox");
722 std::vector< Control > controls;
723 controls.push_back( CreateLeafControl( 40, 40 ) );
724 controls.push_back( CreateLeafControl( 60, 40 ) );
725 controls.push_back( CreateLeafControl( 80, 40 ) );
726 controls.push_back( CreateLeafControl( 100, 40 ) );
728 const Extents CONTROL_PADDING = Extents(5, 10, 20, 2 );
730 for( auto&& iter : controls )
732 iter.SetProperty(Toolkit::Control::Property::PADDING, CONTROL_PADDING );
735 hbox.SetParentOrigin( ParentOrigin::CENTER );
736 hbox.SetAnchorPoint( AnchorPoint::CENTER );
739 // Ensure layouting happens
740 application.SendNotification();
741 application.Render();
743 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
744 // hbox left justifies elements
745 tet_infoline("Test Child Actor Position");
746 float xPositionOfControlBeingTested = 0.0f;
747 float yPositionOfControlBeingTested = ( 800.0f * 0.5) - ( 0.5 * ( 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom ) );
749 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
750 yPositionOfControlBeingTested,
751 0.0f ), 0.0001f, TEST_LOCATION );
752 xPositionOfControlBeingTested += 40.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
754 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
755 yPositionOfControlBeingTested,
757 0.0001f, TEST_LOCATION );
759 xPositionOfControlBeingTested += 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
760 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
761 yPositionOfControlBeingTested,
762 0.0f ), 0.0001f, TEST_LOCATION );
764 xPositionOfControlBeingTested += 80.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
765 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
766 yPositionOfControlBeingTested,
767 0.0f ), 0.0001f, TEST_LOCATION );
769 tet_infoline("Test Child Actor Size");
770 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
771 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
772 0.0f ), 0.0001f, TEST_LOCATION );
774 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
775 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
776 0.0f ), 0.0001f, TEST_LOCATION );
778 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f + CONTROL_PADDING.start + CONTROL_PADDING.end ,
779 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
780 0.0f ), 0.0001f, TEST_LOCATION );
782 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
783 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
784 0.0f ), 0.0001f, TEST_LOCATION );
790 int UtcDaliLayouting_HboxLayout_Padding03(void)
792 ToolkitTestApplication application;
793 tet_infoline("UtcDaliLayouting_HboxLayout_Padding03 - Adding Changing padding on a single child");
795 Stage stage = Stage::GetCurrent();
796 auto hbox = Control::New();
797 auto hboxLayout = LinearLayout::New();
798 DevelControl::SetLayout( hbox, hboxLayout );
799 hbox.SetName( "HBox");
801 std::vector< Control > controls;
802 controls.push_back( CreateLeafControl( 40, 40 ) );
803 controls.push_back( CreateLeafControl( 40, 40 ) );
804 controls.push_back( CreateLeafControl( 40, 40 ) );
806 const Extents CONTROL_PADDING = Extents(5, 10, 20, 2 );
807 tet_printf( "\nAdding Padding to control at index 1 \n" );
808 controls[1].SetProperty(Toolkit::Control::Property::PADDING, CONTROL_PADDING );
810 for( auto&& iter : controls )
814 hbox.SetParentOrigin( ParentOrigin::CENTER );
815 hbox.SetAnchorPoint( AnchorPoint::CENTER );
818 // Ensure layouting happens
819 application.SendNotification();
820 application.Render();
822 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
823 // hbox left justifies elements
824 tet_infoline("Test Child Actor Position");
825 float xPositionOfControlBeingTested = 0.0f;
826 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
828 0.0f ), 0.0001f, TEST_LOCATION );
829 xPositionOfControlBeingTested += 40.0f;
831 DALI_TEST_EQUALS( controls[ 1 ].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
832 380.0f - ( ( CONTROL_PADDING.top + CONTROL_PADDING.bottom) * 0.5f ), 0.0f ),
833 0.0001f, TEST_LOCATION );
835 xPositionOfControlBeingTested += 40.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
836 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
838 const Extents NEW_CONTROL_PADDING = Extents(10, 10, 20, 2 );
839 tet_printf( "\nChanging Padding to control at index 1 \n" );
840 controls[1].SetProperty(Toolkit::Control::Property::PADDING, NEW_CONTROL_PADDING );
842 // Ensure layouting happens
843 application.SendNotification();
844 application.Render();
846 xPositionOfControlBeingTested = 0.0f; // reset
848 tet_infoline("Test Child Actor Position");
849 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
851 0.0f ), 0.0001f, TEST_LOCATION );
852 xPositionOfControlBeingTested += 40.0f;
854 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
855 380.0f - ( ( NEW_CONTROL_PADDING.top + NEW_CONTROL_PADDING.bottom) * 0.5f ), 0.0f ),
856 0.0001f, TEST_LOCATION );
858 xPositionOfControlBeingTested += 40.0f + NEW_CONTROL_PADDING.start + NEW_CONTROL_PADDING.end;
859 tet_printf( "\nIf x position %u then change has not been processed \n", 40 + 40 + CONTROL_PADDING.start + CONTROL_PADDING.end );
860 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
862 tet_infoline("Test Child Actor Size");
863 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ) , Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
865 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ) , Vector3( 40.0f + NEW_CONTROL_PADDING.start + NEW_CONTROL_PADDING.end,
866 40.0f + NEW_CONTROL_PADDING.top + NEW_CONTROL_PADDING.bottom , 0.0f ),
867 0.0001f, TEST_LOCATION );
869 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ) , Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
876 int UtcDaliLayouting_HboxLayout_Margin01(void)
878 ToolkitTestApplication application;
879 tet_infoline("UtcDaliLayouting_HboxLayout_Margin01 - Adding a margin to a single child");
881 Stage stage = Stage::GetCurrent();
882 auto hbox = Control::New();
883 auto hboxLayout = LinearLayout::New();
884 DevelControl::SetLayout( hbox, hboxLayout );
885 hbox.SetName( "HBox");
887 std::vector< Control > controls;
888 controls.push_back( CreateLeafControl( 40, 40 ) );
889 controls.push_back( CreateLeafControl( 60, 40 ) );
890 controls.push_back( CreateLeafControl( 80, 40 ) );
891 controls.push_back( CreateLeafControl( 100, 40 ) );
893 const Extents CONTROL_MARGIN = Extents(5, 10, 20, 0 );
894 tet_printf( "\nAdding Margin to control at index 1 \n" );
895 controls[1].SetProperty(Toolkit::Control::Property::MARGIN, CONTROL_MARGIN );
897 for( auto&& iter : controls )
901 hbox.SetParentOrigin( ParentOrigin::CENTER );
902 hbox.SetAnchorPoint( AnchorPoint::CENTER );
905 // Ensure layouting happens
906 application.SendNotification();
907 application.Render();
909 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
910 // hbox left justifies elements
911 tet_infoline("Test Child Actor Position");
912 auto xPositionOfControlBeingTested = 0.0f;
913 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
915 0.0f ), 0.0001f, TEST_LOCATION );
916 xPositionOfControlBeingTested += 40.0f + CONTROL_MARGIN.start;
918 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
919 380.0f + CONTROL_MARGIN.top, 0.0f ),
920 0.0001f, TEST_LOCATION );
922 xPositionOfControlBeingTested += 60.0f + CONTROL_MARGIN.end;
923 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
925 xPositionOfControlBeingTested += 80.0f;
926 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
928 tet_infoline("Test Child Actor Size is the same after Margin added");
929 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
930 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f , 0.0f ), 0.0001f, TEST_LOCATION );
931 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
932 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
938 int UtcDaliLayouting_VboxLayout01(void)
940 ToolkitTestApplication application;
941 tet_infoline(" UtcDaliLayouting_VboxLayout01");
943 Stage stage = Stage::GetCurrent();
944 auto vbox = Control::New();
945 auto vboxLayout = LinearLayout::New();
946 vboxLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
947 DevelControl::SetLayout( vbox, vboxLayout );
948 vbox.SetName( "Vbox");
950 std::vector< Control > controls;
951 controls.push_back( CreateLeafControl( 40, 40 ) );
952 controls.push_back( CreateLeafControl( 60, 60 ) );
953 controls.push_back( CreateLeafControl( 80, 80 ) );
954 controls.push_back( CreateLeafControl( 100, 100 ) );
956 for( auto&& iter : controls )
960 vbox.SetParentOrigin( ParentOrigin::CENTER );
961 vbox.SetAnchorPoint( AnchorPoint::CENTER );
964 controls[2].SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
967 DALI_TEST_EQUALS( controls[2].GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ), Property::Value( ChildLayoutData::MATCH_PARENT ), TEST_LOCATION );
969 // Ensure layouting happens
970 application.SendNotification();
971 application.Render();
973 // vbox centers elements horizontally, it fills test harness stage, which is 480x800.
974 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 220.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
975 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
976 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
977 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 190.0f, 180.0f, 0.0f ), 0.0001f, TEST_LOCATION );
979 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
980 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
981 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
982 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
987 int UtcDaliLayouting_VboxLayout02(void)
989 ToolkitTestApplication application;
990 tet_infoline(" UtcDaliLayouting_VboxLayout01");
992 Stage stage = Stage::GetCurrent();
994 // @todo Can't set specification properties on root control. Really need to make LayoutController a root
995 // LayoutGroup for this to happen automatically.
997 // For this test, add an hbox instead
998 auto rootControl = Control::New();
999 auto absoluteLayout = AbsoluteLayout::New();
1000 DevelControl::SetLayout( rootControl, absoluteLayout );
1001 rootControl.SetName( "AbsoluteLayout");
1002 stage.Add( rootControl );
1004 auto vbox = Control::New();
1005 auto vboxLayout = LinearLayout::New();
1006 vboxLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
1007 DevelControl::SetLayout( vbox, vboxLayout );
1008 vbox.SetName( "Vbox");
1009 rootControl.Add( vbox );
1011 vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
1012 vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1014 std::vector< Control > controls;
1015 controls.push_back( CreateLeafControl( 40, 40 ) );
1016 controls.push_back( CreateLeafControl( 60, 60 ) );
1017 controls.push_back( CreateLeafControl( 80, 80 ) );
1018 controls.push_back( CreateLeafControl( 100, 100 ) );
1020 for( auto&& iter : controls )
1024 vbox.SetParentOrigin( ParentOrigin::CENTER );
1025 vbox.SetAnchorPoint( AnchorPoint::CENTER );
1027 controls[2].SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1030 DALI_TEST_EQUALS( controls[2].GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ), Property::Value( ChildLayoutData::MATCH_PARENT ), TEST_LOCATION );
1032 // Ensure layouting happens
1033 application.SendNotification();
1034 application.Render();
1036 DALI_TEST_EQUALS( rootControl.GetProperty<Vector3>(Actor::Property::POSITION), Vector3(0,0,0),TEST_LOCATION);
1037 DALI_TEST_EQUALS( rootControl.GetProperty<Vector3>(Actor::Property::SIZE), Vector3(480,800,0),TEST_LOCATION);
1039 // vbox centers elements horizontally, it should wrap it's content horizontally, i.e. it should take the width of the largest element (100)
1040 DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1041 DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1043 // 3rd control is set to match parent - this should also be 100 wide
1044 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 30.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1045 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1046 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1047 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 180.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1049 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1050 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1051 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1052 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1058 int UtcDaliLayouting_VboxLayout03(void)
1060 ToolkitTestApplication application;
1061 tet_infoline(" UtcDaliLayouting_VboxLayout03 test with cell padding set");
1063 Stage stage = Stage::GetCurrent();
1065 // @todo Can't set specification properties on root control. Really need to make LayoutController a root
1066 // LayoutGroup for this to happen automatically.
1068 // For this test, add an hbox instead
1069 auto hbox = Control::New();
1070 auto hboxLayout = LinearLayout::New();
1071 DevelControl::SetLayout( hbox, hboxLayout );
1072 hbox.SetName( "Hbox");
1075 auto vbox = Control::New();
1076 auto vboxLayout = LinearLayout::New();
1077 vboxLayout.SetCellPadding( LayoutSize( 0, 10 ) );
1078 vboxLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
1080 DALI_TEST_EQUALS( vboxLayout.GetCellPadding(), LayoutSize( 0, 10 ), TEST_LOCATION );
1082 DevelControl::SetLayout( vbox, vboxLayout );
1083 vbox.SetName( "Vbox");
1086 vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
1087 vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1089 std::vector< Control > controls;
1090 controls.push_back( CreateLeafControl( 40, 40 ) );
1091 controls.push_back( CreateLeafControl( 60, 60 ) );
1092 controls.push_back( CreateLeafControl( 80, 80 ) );
1093 controls.push_back( CreateLeafControl( 100, 100 ) );
1095 for( auto&& iter : controls )
1099 vbox.SetParentOrigin( ParentOrigin::CENTER );
1100 vbox.SetAnchorPoint( AnchorPoint::CENTER );
1102 controls[2].SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1105 DALI_TEST_EQUALS( controls[2].GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ), Property::Value( ChildLayoutData::MATCH_PARENT ), TEST_LOCATION );
1107 // Ensure layouting happens
1108 application.SendNotification();
1109 application.Render();
1111 DALI_TEST_EQUALS( hbox.GetProperty<Vector3>(Actor::Property::POSITION), Vector3(0,0,0),TEST_LOCATION);
1112 DALI_TEST_EQUALS( hbox.GetProperty<Vector3>(Actor::Property::SIZE), Vector3(480,800,0),TEST_LOCATION);
1114 // vbox centers elements horizontally, it should wrap it's content horizontally, i.e. it should take the width of the largest element (100)
1115 DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1116 DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1118 // 3rd control is set to match parent - this should also be 100 wide
1119 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 30.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1120 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1121 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1122 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 210.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1124 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1125 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1126 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1127 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1134 int UtcDaliLayouting_RelayoutOnChildOrderChanged(void)
1136 ToolkitTestApplication application;
1137 tet_infoline(" UtcDaliLayouting_RelayoutOnChildOrderChanged");
1138 tet_infoline(" Test that if the sibling order changes, the container is re-laid out automatically");
1140 Stage stage = Stage::GetCurrent();
1142 auto hbox = Control::New();
1143 auto hboxLayout = Test::CustomLayout::New();
1144 DevelControl::SetLayout( hbox, hboxLayout );
1145 hbox.SetName( "HBox");
1147 std::vector< Control > controls;
1148 controls.push_back( CreateLeafControl( 40, 40 ) );
1149 controls.push_back( CreateLeafControl( 60, 40 ) );
1150 controls.push_back( CreateLeafControl( 80, 40 ) );
1151 controls.push_back( CreateLeafControl( 100, 40 ) );
1153 for( auto&& iter : controls )
1157 hbox.SetParentOrigin( ParentOrigin::CENTER );
1158 hbox.SetAnchorPoint( AnchorPoint::CENTER );
1161 // Ensure layouting happens
1162 application.SendNotification();
1163 application.Render();
1165 // hbox centers elements vertically, it fills test harness stage, which is 480x800.
1166 // hbox left justifies elements
1167 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1168 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 40.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1169 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1170 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 180.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1172 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1173 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1174 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1175 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1177 controls[0].RaiseToTop(); // 0->3; 1, 2, 3, 0
1178 controls[2].Lower(); // 2->1; 2, 1, 3, 0
1180 application.SendNotification();
1181 application.Render();
1183 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1184 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1185 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 140.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1186 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 240.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1188 DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1189 DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1190 DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1191 DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );