Merge "Removing unused variables" into devel/master
[platform/core/uifw/dali-demo.git] / examples / image-view-pixel-area / image-view-pixel-area-example.cpp
index dd33abe..fdbe0a6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,9 +54,9 @@ 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.KeyEventSignal().Connect(this, &ImageViewPixelAreaApp::OnKeyEvent);
+    // Get a handle to the window
+    Window window = application.GetWindow();
+    window.KeyEventSignal().Connect(this, &ImageViewPixelAreaApp::OnKeyEvent);
 
     Toolkit::ToolBar toolBar;
     Toolkit::Control background;
@@ -121,17 +121,17 @@ private:
       {
         mImageView[i][j] = Toolkit::ImageView::New();
         mImageView[i][j].SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap );
-        mImageView[i][j].SetPosition( 50.f*(i-1), 50.f*(j-1) );
+        mImageView[i][j].SetProperty( Actor::Property::POSITION, Vector2( 50.f*(i-1), 50.f*(j-1) ));
       }
 
     mImageView[1][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     mImageView[1][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER );
-    mImageView[1][1].SetScale( 1.f/3.f );
+    mImageView[1][1].SetProperty( Actor::Property::SCALE, 1.f/3.f );
     mContent.Add( mImageView[1][1] );
 
     mImageView[0][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
     mImageView[0][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT );
-    mImageView[0][0].SetPosition( -50.f, -50.f );
+    mImageView[0][0].SetProperty( Actor::Property::POSITION, Vector2( -50.f, -50.f ));
     mImageView[1][1].Add( mImageView[0][0] );
 
     mImageView[1][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
@@ -213,7 +213,7 @@ private:
 
   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) )
       {