Merge "(ArcVisual) Use relative corner radius" into devel/master
[platform/core/uifw/dali-demo.git] / examples / pivot / pivot-example.cpp
index 332fc00..82cfa2f 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.
@@ -16,6 +16,7 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 #include <dali/devel-api/actors/actor-devel.h>
 
 #include <iostream>
@@ -62,12 +63,12 @@ private:
   /**
    * @brief The Init signal is received once (only) during the Application lifetime.
    */
-  void Create( Application& /* application */ )
+  void Create( Application& application )
   {
-    // Get a handle to the stage
-    Stage stage = Stage::GetCurrent();
-    stage.SetBackgroundColor( Color::WHITE );
-    stage.KeyEventSignal().Connect( this, &PivotController::OnKeyEvent );
+    // Get a handle to the window
+    Window window = application.GetWindow();
+    window.SetBackgroundColor( Color::WHITE );
+    window.KeyEventSignal().Connect( this, &PivotController::OnKeyEvent );
 
     // Create a table view.
     TableView tableView = TableView::New( TABLE_VIEW_ROWS, TABLE_VIEW_COLUMNS );
@@ -75,7 +76,7 @@ private:
     tableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     tableView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
     tableView.SetProperty( Actor::Property::SIZE_MODE_FACTOR, TABLE_VIEW_SIZE_MODE_FACTOR );
-    stage.Add( tableView );
+    window.Add( tableView );
 
     // Create a tap detector - we are going to rotate an actor round our anchor-point (pivot) when one of our controls is tapped.
     mTapDetector = TapGestureDetector::New();
@@ -96,7 +97,7 @@ private:
         Control control = Control::New();
         control.SetBackgroundColor( Vector4( Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), 1.0f ) );
         control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-        control.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); // Ensures the position always uses top-left for its calculations.
+        control.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); // Ensures the position always uses top-left for its calculations.
         control.SetProperty( Actor::Property::ANCHOR_POINT, anchorPoint ); // This anchor-point is used for the rotation and the scale.
 
         // Add to the table-view