Changes after TouchedSignal changes
[platform/core/uifw/dali-demo.git] / examples / arc-visual / arc-visual-example.cpp
index 4ae4e23..3a1aa95 100644 (file)
@@ -49,7 +49,8 @@ const Property::Value TEXT_BACKGROUND
 {
   { Visual::Property::TYPE, Visual::COLOR },
   { ColorVisual::Property::MIX_COLOR, Vector4( 0.8f, 0.8f, 0.8f, 1.0f ) },
-  { DevelVisual::Property::CORNER_RADIUS, 10.0f }
+  { DevelVisual::Property::CORNER_RADIUS, 0.5f },
+  { DevelVisual::Property::CORNER_RADIUS_POLICY, Toolkit::Visual::Transform::Policy::RELATIVE }
 };
 
 const Property::Value TRANSITION_ANIMATOR
@@ -98,15 +99,15 @@ private:
   // The Init signal is received once (only) during the Application lifetime
   void Create( Application& application )
   {
-    // Get a handle to the stage
-    Stage stage = Stage::GetCurrent();
-    stage.SetBackgroundColor( Color::WHITE );
+    // Get a handle to the window
+    Window window = application.GetWindow();
+    window.SetBackgroundColor( Color::WHITE );
 
     mControl = Control::New();
     mControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     mControl.SetProperty( Actor::Property::SIZE, Vector2( 300.0f, 300.0f ) );
     mControl.SetProperty( Control::Property::BACKGROUND, BACKGROUND );
-    stage.Add( mControl );
+    window.Add( mControl );
 
     mStartAngleLabel = TextLabel::New( "1" );
     mStartAngleLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
@@ -116,8 +117,8 @@ private:
     mStartAngleLabel.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mStartAngleLabel.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mStartAngleLabel.SetProperty( Control::Property::PADDING, Extents( 20.0f, 20.0f, 10.0f, 10.0f ) );
-    mStartAngleLabel.TouchSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
-    stage.Add( mStartAngleLabel );
+    mStartAngleLabel.TouchedSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
+    window.Add( mStartAngleLabel );
 
     mSweepAngleLabel = TextLabel::New( "2" );
     mSweepAngleLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
@@ -127,8 +128,8 @@ private:
     mSweepAngleLabel.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mSweepAngleLabel.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mSweepAngleLabel.SetProperty( Control::Property::PADDING, Extents( 20.0f, 20.0f, 10.0f, 10.0f ) );
-    mSweepAngleLabel.TouchSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
-    stage.Add( mSweepAngleLabel );
+    mSweepAngleLabel.TouchedSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
+    window.Add( mSweepAngleLabel );
 
     mThicknessLabel = TextLabel::New( "3" );
     mThicknessLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
@@ -138,8 +139,8 @@ private:
     mThicknessLabel.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mThicknessLabel.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mThicknessLabel.SetProperty( Control::Property::PADDING, Extents( 20.0f, 20.0f, 10.0f, 10.0f ) );
-    mThicknessLabel.TouchSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
-    stage.Add( mThicknessLabel );
+    mThicknessLabel.TouchedSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
+    window.Add( mThicknessLabel );
 
     mPlusTextLabel = TextLabel::New( "+" );
     mPlusTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
@@ -149,8 +150,8 @@ private:
     mPlusTextLabel.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mPlusTextLabel.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mPlusTextLabel.SetProperty( Control::Property::PADDING, Extents( 20.0f, 20.0f, 10.0f, 10.0f ) );
-    mPlusTextLabel.TouchSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
-    stage.Add( mPlusTextLabel );
+    mPlusTextLabel.TouchedSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
+    window.Add( mPlusTextLabel );
 
     mMinusTextLabel = TextLabel::New( "-" );
     mMinusTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
@@ -160,17 +161,17 @@ private:
     mMinusTextLabel.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mMinusTextLabel.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE );
     mMinusTextLabel.SetProperty( Control::Property::PADDING, Extents( 25.0f, 25.0f, 10.0f, 10.0f ) );
-    mMinusTextLabel.TouchSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
-    stage.Add( mMinusTextLabel );
+    mMinusTextLabel.TouchedSignal().Connect( this, &ArcVisualExample::OnButtonTouch );
+    window.Add( mMinusTextLabel );
 
-    // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchSignal().Connect( this, &ArcVisualExample::OnTouch );
+    // Respond to a click anywhere on the window
+    window.GetRootLayer().TouchedSignal().Connect( this, &ArcVisualExample::OnTouch );
 
     // Respond to key events
-    stage.KeyEventSignal().Connect( this, &ArcVisualExample::OnKeyEvent );
+    window.KeyEventSignal().Connect( this, &ArcVisualExample::OnKeyEvent );
   }
 
-  bool OnButtonTouch( Actor actor, const TouchData& touch )
+  bool OnButtonTouch( Actor actor, const TouchEvent& touch )
   {
     if( touch.GetState( 0 ) == PointState::UP )
     {
@@ -211,7 +212,7 @@ private:
     return true;
   }
 
-  bool OnTouch( Actor actor, const TouchData& touch )
+  bool OnTouch( Actor actor, const TouchEvent& touch )
   {
     if( touch.GetState( 0 ) == PointState::UP )
     {
@@ -228,7 +229,7 @@ private:
 
   void OnKeyEvent( const KeyEvent& event )
   {
-    if( event.state == KeyEvent::Up )
+    if( event.GetState() == KeyEvent::UP )
     {
       if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
       {