Revert "Changes after TouchData renamed to TouchEvent"
[platform/core/uifw/dali-demo.git] / examples / compressed-texture-formats / compressed-texture-formats-example.cpp
index 247a523..ec957ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -18,6 +18,7 @@
 // EXTERNAL INCLUDES
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 
 // INTERNAL INCLUDES
 #include "shared/utility.h"
@@ -77,7 +78,7 @@ void AddImage( const char*imagePath, Actor& actor, Geometry& geometry, Shader& s
   renderer.SetTextures( textureSet );
 
   //Set actor size and add the renderer
-  actor.SetSize( texture.GetWidth(), texture.GetHeight() );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( texture.GetWidth(), texture.GetHeight() ) );
   actor.AddRenderer( renderer );
 }
 
@@ -106,9 +107,9 @@ 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 );
 
     // Setup a TableView to hold a grid of images and labels.
     Toolkit::TableView table = Toolkit::TableView::New( 3u, 2u );
@@ -173,11 +174,11 @@ public:
     table.AddChild( actor, Toolkit::TableView::CellPosition( 2u, 1u ) );
     table.SetCellAlignment( Toolkit::TableView::CellPosition( 2u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
 
-    stage.Add( table );
+    window.Add( table );
 
     // Respond to touch and key signals
-    stage.GetRootLayer().TouchSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
-    stage.KeyEventSignal().Connect(this, &CompressedTextureFormatsController::OnKeyEvent);
+    window.GetRootLayer().TouchSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
+    window.KeyEventSignal().Connect(this, &CompressedTextureFormatsController::OnKeyEvent);
   }
 
   bool OnTouch( Actor actor, const TouchData& touch )