X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fsize-negotiation%2Fsize-negotiation-example.cpp;h=dab54470ab9916272f609e6a0df4b8bdc0a97911;hb=2e182925204bf3ef9f2a36cbfbf998e79fbafaf5;hp=fe292caff59f78f4848e302c2d34a44fc195ec11;hpb=afefd161cd4a2deb2c5c855330087389d435c348;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/size-negotiation/size-negotiation-example.cpp b/examples/size-negotiation/size-negotiation-example.cpp index fe292ca..dab5447 100644 --- a/examples/size-negotiation/size-negotiation-example.cpp +++ b/examples/size-negotiation/size-negotiation-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 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. @@ -19,6 +19,7 @@ #include #include #include +#include using namespace Dali; @@ -33,9 +34,9 @@ struct ButtonItem namespace { -const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "background-gradient.jpg"; -const char* const TOOLBAR_IMAGE = DALI_IMAGE_DIR "top-bar.png"; -const char* const IMAGE = DALI_IMAGE_DIR "background-magnifier.jpg"; +const char* const BACKGROUND_IMAGE = DEMO_IMAGE_DIR "background-gradient.jpg"; +const char* const TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png"; +const char* const IMAGE = DEMO_IMAGE_DIR "background-magnifier.jpg"; const char* const TOOLBAR_TITLE = "Negotiate Size"; @@ -72,6 +73,19 @@ const ButtonItem TABLEVIEW_BUTTON_ITEMS[] = { const unsigned int TABLEVIEW_BUTTON_ITEMS_COUNT = sizeof( TABLEVIEW_BUTTON_ITEMS ) / sizeof( TABLEVIEW_BUTTON_ITEMS[0] ); + +Actor CreateSolidColor( Vector4 color ) +{ + Toolkit::Control control = Toolkit::Control::New(); + + Property::Map map; + map[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::COLOR; + map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color; + control.SetProperty( Toolkit::Control::Property::BACKGROUND, map ); + + return control; +} + } // anonymous namespace @@ -99,7 +113,7 @@ public: // The Init signal is received once (only) during the Application lifetime Stage stage = Stage::GetCurrent(); - // Respond to key events + // Respond to key events if not handled stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent); // Creates a default view with a default tool bar. @@ -119,8 +133,8 @@ public: mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::Padding( padding, padding, padding, padding ) ); mItemView = Toolkit::ItemView::New( *this ); - mItemView.SetParentOrigin( ParentOrigin::CENTER ); - mItemView.SetAnchorPoint( AnchorPoint::CENTER ); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Use a grid layout for tests @@ -166,10 +180,10 @@ public: const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f; Toolkit::Popup popup = Toolkit::Popup::New(); - popup.SetName( "popup" ); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( AnchorPoint::CENTER ); - popup.SetSize( POPUP_WIDTH_DP, 0.0f ); + popup.SetProperty( Dali::Actor::Property::NAME, "popup" ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + popup.SetProperty( Actor::Property::SIZE, Vector2( POPUP_WIDTH_DP, 0.0f ) ); popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false ); popup.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::OnPopupOutsideTouched ); @@ -180,17 +194,17 @@ public: bool OnButtonClicked( Toolkit::Button button ) { - if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_1CELL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 0, 0 ); - table.SetName( "TABLEVIEW_BUTTON_1CELL_ID" ); + table.SetProperty( Dali::Actor::Property::NAME, "TABLEVIEW_BUTTON_1CELL_ID" ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.Add( backing ); @@ -198,27 +212,27 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3CELL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 0 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 0 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 0 ) ); } @@ -227,62 +241,62 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3X3CELL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 3, 3 ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Column 0 { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 0 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 0 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 0 ) ); } // Column 1 { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 1 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 1 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 0.0f, 1.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 0.0f, 1.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 1 ) ); } // Column 2 { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 2 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.5f, 0.5f, 0.5f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.5f, 0.5f, 0.5f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 2 ) ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.5f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.5f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 2 ) ); } @@ -291,22 +305,22 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED1_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.SetFixedHeight( 0, 50.0f ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -314,24 +328,24 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); backing.Add( text ); table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); backing.Add( text ); @@ -342,11 +356,11 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED2_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -354,12 +368,12 @@ public: table.SetFixedHeight( 2, 50.0f ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -368,12 +382,12 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -382,12 +396,12 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -400,11 +414,11 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT1_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -412,14 +426,14 @@ public: table.SetFitHeight( 2 ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 100.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -429,13 +443,13 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -445,14 +459,14 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 100.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -466,24 +480,24 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT2_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.SetFitHeight( 1 ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -493,9 +507,9 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 200.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); @@ -503,20 +517,20 @@ public: text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); backing.Add( text ); table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -530,11 +544,11 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL1_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) ); mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); @@ -545,14 +559,14 @@ public: table.SetFitHeight( 2 ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 100.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -562,14 +576,14 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 200.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -579,14 +593,14 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 300.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 300.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -600,11 +614,11 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL2_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) ); mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); @@ -614,15 +628,15 @@ public: table.SetFitHeight( 1 ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); - backing.SetSize( 0.0f, 100.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -632,14 +646,14 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 200.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -653,11 +667,11 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL3_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) ); mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); Toolkit::TableView table = Toolkit::TableView::New( 3, 1 ); @@ -667,13 +681,13 @@ public: table.SetFitHeight( 1 ); { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -683,14 +697,14 @@ public: table.Add( backing ); } { - Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); + Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - backing.SetSize( 0.0f, 200.0f ); + backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -703,42 +717,42 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE ) ); + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE ); image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mPopup.Add( image ); StagePopup( mPopup ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE ) ); + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE ); image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); + image.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); mPopup.Add( image ); StagePopup( mPopup ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); + mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) ); - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE ) ); + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE ); image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO ); + image.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FILL_WITH_ASPECT_RATIO ); mPopup.Add( image ); @@ -781,8 +795,8 @@ public: // From ItemFactory virtual Actor NewItem(unsigned int itemId) { Toolkit::PushButton popupButton = Toolkit::PushButton::New(); - popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name ); - popupButton.SetLabelText( TABLEVIEW_BUTTON_ITEMS[ itemId ].text ); + popupButton.SetProperty( Dali::Actor::Property::NAME, TABLEVIEW_BUTTON_ITEMS[ itemId ].name ); + popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text ); popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); @@ -798,26 +812,17 @@ private: Layer mContentLayer; ///< Content layer. Toolkit::TextLabel mTitleActor; ///< Title text. - Toolkit::Popup mMenu; ///< The navigation menu todor. + Toolkit::Popup mMenu; ///< The navigation menu. Toolkit::Popup mPopup; ///< The current example popup. Toolkit::ItemView mItemView; ///< ItemView to hold test images. }; -void RunTest( Application& application ) +int DALI_EXPORT_API main( int argc, char **argv ) { + Application application = Application::New( &argc, &argv, DEMO_THEME_PATH ); SizeNegotiationController test( application ); - application.MainLoop(); -} - -// Entry point for Linux & SLP applications -int main( int argc, char **argv ) -{ - Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); - - RunTest( application ); - return 0; }