Remove use of deprecated Control flag REQUIRES_STYLE_CHANGE_SIGNALS
[platform/core/uifw/dali-demo.git] / examples / transitions / shadow-button-impl.cpp
index 135ea16..51867d6 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.
 
 #include "shadow-button-impl.h"
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/scripting/enum-helper.h>
-#include <dali-toolkit/devel-api/align-enums.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 
 #include <cstdio>
@@ -83,7 +80,7 @@ Toolkit::TransitionData ConvertPropertyToTransition( const Property::Value& valu
 
 
 Internal::ShadowButton::ShadowButton()
-: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mCheckState(false),
   mActiveState(false)
 {
@@ -126,7 +123,7 @@ void ShadowButton::SetCheckState( bool checkState )
 {
   mCheckState = checkState;
   DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true );
-  if( Self().OnStage() )
+  if( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
   {
     if( checkState )
     {
@@ -204,14 +201,14 @@ void ShadowButton::OnInitialize()
   Actor self = Self();
 }
 
-void ShadowButton::OnStageConnection( int depth )
+void ShadowButton::OnSceneConnection( int depth )
 {
-  Control::OnStageConnection( depth );
+  Control::OnSceneConnection( depth );
 }
 
-void ShadowButton::OnStageDisconnection()
+void ShadowButton::OnSceneDisconnection()
 {
-  Control::OnStageDisconnection();
+  Control::OnSceneDisconnection();
 }
 
 void ShadowButton::OnSizeSet( const Vector3& targetSize )
@@ -374,7 +371,7 @@ void ShadowButton::ResetVisual(
     }
 
     // Extract transform maps out of the visual definition and store them
-    Property::Value* value = map->Find( DevelVisual::Property::TRANSFORM, "transform");
+    Property::Value* value = map->Find( Visual::Property::TRANSFORM, "transform");
     if( value )
     {
       Property::Map* transformMap = value->GetMap();
@@ -426,7 +423,7 @@ void ShadowButton::StoreTargetLayouts( TransitionData transitionData )
     if( target )
     {
       // Convert to index
-      Property::Index index;
+      Property::Index index = Property::INVALID_INDEX;
       if( Scripting::GetEnumerationProperty( *target, VISUAL_PROPERTIES_TABLE, VISUAL_PROPERTIES_TABLE_COUNT, index ) )
       {
         ShadowButton::Transforms::iterator iter = FindTransform( index );