Changes after TouchedSignal changes
[platform/core/uifw/dali-demo.git] / examples / color-visual / color-visual-example.cpp
index 616e3f6..809fdae 100644 (file)
@@ -68,25 +68,25 @@ public:
   // 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 );
 
     mImageView = ImageView::New( IMAGE_FILE );
-    mImageView.SetParentOrigin( ParentOrigin::CENTER );
-    mImageView.SetSize( 200.0f, 200.0f );
+    mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+    mImageView.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
     mImageView.SetProperty( DevelControl::Property::SHADOW, SHADOW );
 
-    stage.Add( mImageView );
+    window.Add( mImageView );
 
-    // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchSignal().Connect( this, &ColorVisualExample::OnTouch );
+    // Respond to a click anywhere on the window
+    window.GetRootLayer().TouchedSignal().Connect( this, &ColorVisualExample::OnTouch );
 
     // Respond to key events
-    stage.KeyEventSignal().Connect( this, &ColorVisualExample::OnKeyEvent );
+    window.KeyEventSignal().Connect( this, &ColorVisualExample::OnKeyEvent );
   }
 
-  bool OnTouch( Actor actor, const TouchData& touch )
+  bool OnTouch( Actor actor, const TouchEvent& touch )
   {
     if( touch.GetState( 0 ) == PointState::UP )
     {
@@ -117,7 +117,7 @@ public:
 
   void OnKeyEvent( const KeyEvent& event )
   {
-    if( event.state == KeyEvent::Down )
+    if( event.GetState() == KeyEvent::DOWN )
     {
       if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
       {