X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fvisual-transitions%2Ftransition-application.cpp;h=480253778fa1ccbd9fe2ac7055bfe9e4a442838d;hb=2e182925204bf3ef9f2a36cbfbf998e79fbafaf5;hp=fcb7c00c70fd79694d0ca6b347ef40df74d13a2d;hpb=a523d825cb2fb4871e59f807338cdfc5e1e13d42;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/visual-transitions/transition-application.cpp b/examples/visual-transitions/transition-application.cpp index fcb7c00..4802537 100644 --- a/examples/visual-transitions/transition-application.cpp +++ b/examples/visual-transitions/transition-application.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,6 @@ // External includes #include -#include -#include #include "beat-control.h" #include #include @@ -35,6 +33,16 @@ using namespace Dali; using namespace Dali::Toolkit; +namespace +{ + +void SetLabelText( Button button, const char* label ) +{ + button.SetProperty( Toolkit::Button::Property::LABEL, label ); +} + +} + namespace Demo { @@ -43,7 +51,6 @@ const char* DALI_LOGO_PATH( DEMO_IMAGE_DIR "Logo-for-demo.png" ); const char* DALI_ROBOT_MODEL_PATH( DEMO_MODEL_DIR "ToyRobot-Metal.obj" ); const char* DALI_ROBOT_MATERIAL_PATH( DEMO_MODEL_DIR "ToyRobot-Metal.mtl" ); - TransitionApplication::TransitionApplication( Application& application ) : mApplication( application ), mTitle(), @@ -70,10 +77,10 @@ void TransitionApplication::Create( Application& application ) // Content panes: TableView contentLayout = TableView::New( 4, 1 ); - contentLayout.SetName("ContentLayout"); + contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout"); contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT ); + contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); contentLayout.SetCellPadding( Vector2( 0.0f, 5.0f ) ); // Assign all rows the size negotiation property of fitting to children @@ -81,7 +88,7 @@ void TransitionApplication::Create( Application& application ) stage.Add( contentLayout ); mTitle = TextLabel::New( "Custom Control Transition Example" ); - mTitle.SetName( "Title" ); + mTitle.SetProperty( Dali::Actor::Property::NAME, "Title" ); mTitle.SetStyleName("Title"); mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); @@ -90,19 +97,19 @@ void TransitionApplication::Create( Application& application ) contentLayout.SetFitHeight(0); // Fill width mBeatControl = BeatControl::New(); - mBeatControl.SetName("BeatControl"); + mBeatControl.SetProperty( Dali::Actor::Property::NAME,"BeatControl"); mBeatControl.SetProperty( BeatControl::Property::BEAT_VISUAL, Property::Map() - .Add( DevelVisual::Property::TRANSFORM, Property::Map() - .Add( DevelVisual::Transform::Property::SIZE, Vector2(0.5f, 0.5f) ) ) ); + .Add( Visual::Property::TRANSFORM, Property::Map() + .Add( Visual::Transform::Property::SIZE, Vector2(0.5f, 0.5f) ) ) ); - mBeatControl.SetAnchorPoint( AnchorPoint::CENTER ); - mBeatControl.SetParentOrigin( ParentOrigin::CENTER ); + mBeatControl.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mBeatControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mBeatControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); contentLayout.Add( mBeatControl ); // beat control should fill the tableview cell, so no change to default parameters TableView visualTypeLayout = TableView::New( 1, NUMBER_OF_VISUAL_BUTTONS ); - visualTypeLayout.SetName("VisualTypeLayout"); + visualTypeLayout.SetProperty( Dali::Actor::Property::NAME,"VisualTypeLayout"); visualTypeLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); visualTypeLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); visualTypeLayout.SetFitHeight( 0 ); @@ -114,13 +121,13 @@ void TransitionApplication::Create( Application& application ) { Property::Map map; CreateVisualMap( i, map ); - map.Add( DevelVisual::Property::TRANSFORM, Property::Map() - .Add( DevelVisual::Transform::Property::SIZE, Vector2(0.8f, 0.8f) ) ); + map.Add( Visual::Property::TRANSFORM, Property::Map() + .Add( Visual::Transform::Property::SIZE, Vector2(0.8f, 0.8f) ) ); mVisualButtons[i] = BeatControl::New(); mVisualButtons[i].SetProperty( BeatControl::Property::BEAT_VISUAL, map ); - mVisualButtons[i].SetName("VisualButton"); + mVisualButtons[i].SetProperty( Dali::Actor::Property::NAME,"VisualButton"); mVisualButtons[i].SetStyleName("VisualButton"); - mVisualButtons[i].SetSize(0, 50); + mVisualButtons[i].SetProperty( Actor::Property::SIZE, Vector2(0, 50) ); mVisualButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mVisualButtons[i].SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); mVisualIndex = mVisualButtons[i].RegisterProperty( "visualId", i, Property::READ_WRITE ); @@ -129,7 +136,7 @@ void TransitionApplication::Create( Application& application ) } TableView actionButtonLayout = TableView::New( 1, NUMBER_OF_ACTION_BUTTONS+1 ); - actionButtonLayout.SetName("ThemeButtonsLayout"); + actionButtonLayout.SetProperty( Dali::Actor::Property::NAME,"ThemeButtonsLayout"); actionButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); actionButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); actionButtonLayout.SetFitHeight( 0 ); @@ -143,7 +150,7 @@ void TransitionApplication::Create( Application& application ) for( int i=0; i( mVisualIndex ); Property::Map map; CreateVisualMap( visual, map ); - map.Add( DevelVisual::Property::TRANSFORM, Property::Map() - .Add( DevelVisual::Transform::Property::SIZE, Vector2( 0.5f, 0.5f ) ) ); + map.Add( Visual::Property::TRANSFORM, Property::Map() + .Add( Visual::Transform::Property::SIZE, Vector2( 0.5f, 0.5f ) ) ); mBeatControl.SetProperty( BeatControl::Property::BEAT_VISUAL, map ); } return true;