Remove more public Setter/Getter APIs from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / perf-scroll / perf-scroll.cpp
index beedecf..c0b8c00 100644 (file)
@@ -242,8 +242,11 @@ public:
     // Respond to a click anywhere on the stage
     stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch );
 
+    // Respond to key events
+    stage.KeyEventSignal().Connect( this, &PerfScroll::OnKeyEvent );
+
     mParent = Actor::New();
-    mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
     stage.Add(mParent);
 
     if( gUseMesh )
@@ -368,7 +371,7 @@ public:
         {
           mActor[count].SetPosition( initialPosition );
           mActor[count].SetSize( Vector3(0.0f,0.0f,0.0f) );
-          mActor[count].SetOrientation( Quaternion( Radian( 0.0f ), Vector3::XAXIS ) );
+          mActor[count].SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian( 0.0f ), Vector3::XAXIS ) ) );
           mShow.AnimateTo( Property( mActor[count], Actor::Property::POSITION ), Vector3( xpos+mSize.x*0.5f, ypos+mSize.y*0.5f, 0.0f), AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ) );
           mShow.AnimateTo( Property( mActor[count], Actor::Property::SIZE ), mSize, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ) );
         }
@@ -376,7 +379,7 @@ public:
         {
           mImageView[count].SetPosition( initialPosition );
           mImageView[count].SetSize( Vector3(0.0f,0.0f,0.0f) );
-          mImageView[count].SetOrientation( Quaternion( Radian(0.0f),Vector3::XAXIS ) );
+          mImageView[count].SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian(0.0f), Vector3::XAXIS ) ) );
           mShow.AnimateTo( Property( mImageView[count], Actor::Property::POSITION ), Vector3( xpos+mSize.x*0.5f, ypos+mSize.y*0.5f, 0.0f ), AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ) );
           mShow.AnimateTo( Property( mImageView[count], Actor::Property::SIZE ), mSize, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ) );
         }
@@ -440,6 +443,17 @@ public:
     mHide.FinishedSignal().Connect( this, &PerfScroll::OnAnimationEnd );
   }
 
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
 private:
   Application&  mApplication;