Remove the usage of deprecated Button APIS
[platform/core/uifw/dali-demo.git] / examples / shadows-and-lights / shadows-and-lights-example.cpp
index 4ae5877..6dac9fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -20,6 +20,7 @@
 
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
 
 #include <iostream>
@@ -80,8 +81,24 @@ public:
    */
   TestApp(Application &app)
   : mApp(app),
-    mPaused(false),
-    mTranslation(22.0f, -1.0f, 0.0f),
+    mView(),
+    mContents(),
+    mSceneActor(),
+    mAnimation(),
+    mSceneAnimation(),
+    mPaused( false ),
+    mShadowView(),
+    mShadowPlaneBg(),
+    mShadowPlane(),
+    mCastingLight(),
+    mLightAnchor(),
+    mImageActor1(),
+    mImageActor2(),
+    mImageActor3(),
+    mPanGestureDetector(),
+    mPinchGestureDetector(),
+    mTapGestureDetector(),
+    mTranslation( 22.0f, -1.0f, 0.0f ),
     mSceneXRotation( Degree(-6.0f) ), // Initial values give a reasonable off-straight view.
     mSceneYRotation( Degree(20.0f) ),
     mLightXRotation( Degree(-1.5f) ),
@@ -90,7 +107,10 @@ public:
     mObjectYRotation(0.0f),
     mPinchScale(0.6f),
     mScaleAtPinchStart(0.6f),
-    mPanState(PAN_LIGHT)
+    mAngle1Index( Property::INVALID_INDEX ),
+    mAngle3Index( Property::INVALID_INDEX ),
+    mTitleActor(),
+    mPanState( PAN_LIGHT )
   {
     app.InitSignal().Connect(this, &TestApp::Create);
     app.TerminateSignal().Connect(this, &TestApp::Terminate);
@@ -147,8 +167,8 @@ public:
 
     // Add an effect-changing button on the right of the tool bar.
     Toolkit::PushButton effectChangeButton = Toolkit::PushButton::New();
-    effectChangeButton.SetUnselectedImage( CHANGE_EFFECT_IMAGE );
-    effectChangeButton.SetSelectedImage( CHANGE_EFFECT_IMAGE_SELECTED );
+    effectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_EFFECT_IMAGE );
+    effectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_EFFECT_IMAGE_SELECTED );
     effectChangeButton.ClickedSignal().Connect( this, &TestApp::OnEffectButtonClicked );
     toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
@@ -161,8 +181,8 @@ public:
 
     //Add a reset button
     Toolkit::PushButton resetButton = Toolkit::PushButton::New();
-    resetButton.SetUnselectedImage( RESET_ICON );
-    resetButton.SetSelectedImage( RESET_ICON_SELECTED );
+    resetButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, RESET_ICON );
+    resetButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, RESET_ICON_SELECTED );
     resetButton.ClickedSignal().Connect( this, &TestApp::OnResetPressed );
     toolBar.AddControl( resetButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );