Revert "Changes after TouchData renamed to TouchEvent"
[platform/core/uifw/dali-demo.git] / examples / text-label-emojis / text-label-emojis.cpp
index c98e206..3c96974 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.
@@ -17,6 +17,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 #include <iostream>
 
 // INTERNAL INCLUDES
@@ -55,17 +56,17 @@ public:
   // The Init signal is received once (only) during the Application lifetime
   void Create( Application& application )
   {
-    Stage stage = Stage::GetCurrent();
-    stage.SetBackgroundColor( Color::WHITE );
-    stage.KeyEventSignal().Connect(this, &EmojiExample::OnKeyEvent);
+    Window window = application.GetWindow();
+    window.SetBackgroundColor( Color::WHITE );
+    window.KeyEventSignal().Connect(this, &EmojiExample::OnKeyEvent);
 
     mTableView = Toolkit::TableView::New( NUMBER_OF_EMOJIS, 1 );
     mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
     mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
-    mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+    mTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
     mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch );
-    stage.Add( mTableView );
+    window.Add( mTableView );
 
     for( unsigned int index = 0u; index < NUMBER_OF_EMOJIS; ++index )
     {
@@ -73,8 +74,8 @@ public:
       const std::string text = emoji.mUTF8 + " " + emoji.mDescription;
 
       TextLabel label = TextLabel::New( text );
-      label.SetParentOrigin( ParentOrigin::TOP_CENTER );
-      label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+      label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+      label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
       label.SetProperty( TextLabel::Property::MULTI_LINE, true );
 
       mTableView.SetFitHeight( index );