Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / text-label / text-label-example.cpp
index 8fd1668..54ce940 100644 (file)
@@ -185,9 +185,9 @@ public:
   void SetUpExpandingStyleButtons( Vector2 position )
   {
     mExpandingButtons = Demo::ExpandingButtons::New();
-    mExpandingButtons.SetPosition( mButtonSize.width, mStageSize.height * STYLE_BUTTON_POSTION_RELATIVE_TO_STAGE );
+    mExpandingButtons.SetProperty( Actor::Property::POSITION, Vector2( mButtonSize.width, mStageSize.height * STYLE_BUTTON_POSTION_RELATIVE_TO_STAGE ));
     mExpandingButtons.CollapsingSignal().Connect( this, &TextLabelExample::OnExpandingButtonCollapsing );
-    mExpandingButtons.SetSize( mButtonSize );
+    mExpandingButtons.SetProperty( Actor::Property::SIZE, mButtonSize );
     // Creates the buttons to be expanded
     CreateStyleButtons();
 
@@ -210,17 +210,17 @@ public:
     mButtonSize = Size( mStageSize.height * 0.1, mStageSize.height * 0.1 ); // Button size 1/10 of stage height
 
     mContainer = Control::New();
-    mContainer.SetName( "Container" );
-    mContainer.SetParentOrigin( ParentOrigin::CENTER );
+    mContainer.SetProperty( Dali::Actor::Property::NAME, "Container" );
+    mContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     mLayoutSize = Vector2(mStageSize.width*0.6f, mStageSize.width*0.6f);
-    mContainer.SetSize( mLayoutSize );
+    mContainer.SetProperty( Actor::Property::SIZE, mLayoutSize );
     stage.Add( mContainer );
 
     // Resize the center layout when the corner is grabbed
     mGrabCorner = ImageView::New( BACKGROUND_IMAGE );
-    mGrabCorner.SetName( "GrabCorner" );
-    mGrabCorner.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-    mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
+    mGrabCorner.SetProperty( Dali::Actor::Property::NAME, "GrabCorner" );
+    mGrabCorner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+    mGrabCorner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
     mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
     mContainer.Add( mGrabCorner );
 
@@ -230,9 +230,9 @@ public:
 
     mLabel = TextLabel::New( "\xF0\x9F\x98\x89 A Quick Brown Fox Jumps Over The Lazy Dog" );
 
-    mLabel.SetName( "TextLabel" );
-    mLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mLabel.SetSize(mLayoutSize);
+    mLabel.SetProperty( Dali::Actor::Property::NAME, "TextLabel" );
+    mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+    mLabel.SetProperty( Actor::Property::SIZE, mLayoutSize );
     mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
     mLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
     mLabel.SetBackgroundColor( Color::WHITE );
@@ -245,7 +245,7 @@ public:
 
     // Add a border for the container so you can see the container is being resized while grabbing the handle.
     mBorder = Control::New();
-    mBorder.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mBorder.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
     mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
 
@@ -255,7 +255,7 @@ public:
     border.Insert( BorderVisual::Property::SIZE,  3.f );
     mBorder.SetProperty( Control::Property::BACKGROUND, border );
     mContainer.Add( mBorder );
-    mBorder.SetVisible(false);
+    mBorder.SetProperty( Actor::Property::VISIBLE,false);
     mGrabCorner.RaiseToTop();
 
     mHueAngleIndex = mLabel.RegisterProperty( "hue", 0.0f );
@@ -446,7 +446,7 @@ public:
       if ( ! mColorButtons[index] )
       {
         mColorButtons[index] = RadioButton::New();
-        mColorButtons[index].SetSize( mButtonSize );
+        mColorButtons[index].SetProperty( Actor::Property::SIZE, mButtonSize );
         mColorButtons[index].ClickedSignal().Connect( this, &TextLabelExample::OnColorSelected );
         mColorButtons[index].SetProperty( Button::Property::TOGGLABLE, true );
         Property::Map propertyMap;
@@ -471,7 +471,7 @@ public:
         // Use a white button with 50% transparency as a clear color button
         if ( Color::WHITE == AVAILABLE_COLORS[ index ] && styleButtonIndex != StyleType::TEXT_COLOR )
         {
-          mColorButtons[index].SetOpacity(0.5f);
+          mColorButtons[index].SetProperty( DevelActor::Property::OPACITY,0.5f);
 
           mColorButtons[index].SetProperty( Toolkit::Button::Property::LABEL,
                                             Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
@@ -489,7 +489,7 @@ public:
       mColorButtons[index].Lower();
 
       // Position button using nice animation
-      mColorButtons[index].SetY( -GAP_BETWEEN_BUTTONS );
+      mColorButtons[index].SetProperty( Actor::Property::POSITION_Y,  -GAP_BETWEEN_BUTTONS );
       float desiredPosition = -( mButtonSize.height + GAP_BETWEEN_BUTTONS ) * (index);
       AlphaFunction focusedAlphaFunction = AlphaFunction( Vector2 ( 0.32f, 0.08f ), Vector2( 0.38f, 1.72f ) );
       mColorButtonsAnimation.AnimateBy( Property( mColorButtons[index], Actor::Property::POSITION_Y ), desiredPosition, focusedAlphaFunction );
@@ -533,7 +533,7 @@ public:
         mStyleButtons[index].SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_IMAGES[ index ] );
         mStyleButtons[index].SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, STYLE_SELECTED_IMAGE );
         mStyleButtons[index].SetProperty( Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-        mStyleButtons[index].SetSize( mButtonSize );
+        mStyleButtons[index].SetProperty( Actor::Property::SIZE, mButtonSize );
         mStyleButtons[index].ClickedSignal().Connect( this, &TextLabelExample::OnStyleButtonClicked );
       }
     }
@@ -585,7 +585,7 @@ public:
       }
 
       // Only show the border during the panning
-      mBorder.SetVisible(true);
+      mBorder.SetProperty( Actor::Property::VISIBLE,true);
 
       HideStyleAndColorButtons();
     }
@@ -603,14 +603,14 @@ public:
       Vector2 clampedSize = Vector2( std::max( ConvertToEven( static_cast<int>( mLayoutSize.x )), 2 ),
                                      std::max( ConvertToEven( static_cast<int>( mLayoutSize.y )), 2 ) );
 
-      mContainer.SetSize( clampedSize );
+      mContainer.SetProperty( Actor::Property::SIZE, clampedSize );
     }
 
     if( gesture.state == Gesture::Cancelled || gesture.state == Gesture::Finished )
     {
       // Resize the text label to match the container size when panning is finished
-      mLabel.SetSize(mLayoutSize);
-      mBorder.SetVisible(false);
+      mLabel.SetProperty( Actor::Property::SIZE, mLayoutSize );
+      mBorder.SetProperty( Actor::Property::VISIBLE,false);
     }
   }