Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / popup / popup-example.cpp
index 7c5e468..41471a2 100644 (file)
@@ -210,12 +210,12 @@ public:
       if( policyDimension == Dimension::WIDTH )
       {
         stageDimensionSize = stageSize.x;
-        sizeModeFactor = popup.GetSizeModeFactor().x;
+        sizeModeFactor = popup.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ).x;
       }
       else
       {
         stageDimensionSize = stageSize.y;
-        sizeModeFactor = popup.GetSizeModeFactor().y;
+        sizeModeFactor = popup.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ).y;
       }
 
       bool modifyPolicy = false;
@@ -279,7 +279,7 @@ public:
     if( modifySize )
     {
       // The size is set once at the end.
-      popup.SetSize( Vector2( newSize[ 0 ], newSize[ 1 ] ) );
+      popup.SetProperty( Actor::Property::SIZE, Vector2( newSize[ 0 ], newSize[ 1 ] ) );
     }
   }
 
@@ -337,7 +337,7 @@ public:
     popup.SetProperty( Dali::Actor::Property::NAME, "popup" );
     popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-    popup.SetSize( POPUP_WIDTH_DP, 0.0f );
+    popup.SetProperty( Actor::Property::SIZE, Vector2( POPUP_WIDTH_DP, 0.0f ) );
     popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false );
 
     popup.OutsideTouchedSignal().Connect( this, &PopupExample::HidePopup );
@@ -359,7 +359,7 @@ public:
       // Set up the container's layout.
       footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       footer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
-      footer.SetSize( 0.0f, 130.0f );
+      footer.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 130.0f ) );
       footer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
       footer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
 
@@ -367,7 +367,7 @@ public:
       okButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
       okButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
       okButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
-      okButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) );
+      okButton.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( -20.0f, -20.0f, 0.0 ) );
 
       if( numberOfButtons > 1 )
       {
@@ -380,7 +380,7 @@ public:
         cancelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         cancelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
         cancelButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
-        cancelButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) );
+        cancelButton.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( -20.0f, -20.0f, 0.0 ) );
 
         controlLayout.SetCellPadding( Size( 10.0f, 10.0f ) );
 
@@ -499,7 +499,7 @@ public:
       text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
       text.SetProperty( TextLabel::Property::MULTI_LINE, true );
-      text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
+      text.SetProperty( Actor::Property::PADDING, Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
       mPopup.SetContent( text );
 
       SetupPopup( mPopup, button );
@@ -516,7 +516,7 @@ public:
       text.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
       text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-      text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+      text.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( text );
 
@@ -528,7 +528,7 @@ public:
       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-      image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+      image.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( image );
 
@@ -545,7 +545,7 @@ public:
       text.SetProperty( TextLabel::Property::MULTI_LINE, true );
       text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-      text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+      text.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( text );
 
@@ -560,12 +560,12 @@ public:
       text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" );
       text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
       text.SetProperty( TextLabel::Property::MULTI_LINE, true );
-      text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+      text.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( text );
 
       // Fix the popup's size.
-      mPopup.SetSize( 240.0f, 400.0f );
+      mPopup.SetProperty( Actor::Property::SIZE, Vector2( 240.0f, 400.0f ) );
       mPopup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
 
       SetupPopup( mPopup, button );
@@ -581,7 +581,7 @@ public:
       text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
       text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
       text.SetProperty( TextLabel::Property::MULTI_LINE, true );
-      text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
+      text.SetProperty( Actor::Property::PADDING, Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
 
       mPopup.Add( text );
 
@@ -599,7 +599,7 @@ public:
       content.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
       content.SetFitHeight( 0 );
       content.SetFitHeight( 1 );
-      content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
+      content.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
 
       // Text
       {
@@ -618,7 +618,7 @@ public:
         image.SetProperty( Dali::Actor::Property::NAME, "COMPLEX_IMAGE" );
         image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
         image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-        image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
+        image.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
         content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
       }
 
@@ -629,16 +629,16 @@ public:
         root.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
         root.SetFitHeight( 0 );
         root.SetFitWidth( 0 );
-        root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
+        root.SetProperty( Actor::Property::PADDING, Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
 
         Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
-        checkBox.SetSize( 48, 48 );
+        checkBox.SetProperty( Actor::Property::SIZE, Vector2( 48, 48 ) );
         root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Don't show again" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
         Actor textActor = text;
-        textActor.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
+        textActor.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
 
         root.AddChild( text, Toolkit::TableView::CellPosition( 0, 1 ) );