[dali_1.2.61] Merge branch 'devel/master'
[platform/core/uifw/dali-demo.git] / examples / image-view-svg / image-view-svg-example.cpp
index 97ebeba..62cde6e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 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.
@@ -16,6 +16,7 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/actor-devel.h>
 #include <string.h>
 
 using namespace Dali;
@@ -81,7 +82,7 @@ public:
 
     // Push button,  for changing the image set for displaying
     Toolkit::PushButton changeButton = Toolkit::PushButton::New();
-    changeButton.SetLabelText( "Next" );
+    changeButton.SetProperty( Toolkit::Button::Property::LABEL, "Next" );
     changeButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
     changeButton.SetParentOrigin( ParentOrigin::TOP_RIGHT );
     stage.Add( changeButton );
@@ -89,7 +90,7 @@ public:
 
     // Push button, for resetting the actor size and position
     Toolkit::PushButton resetButton = Toolkit::PushButton::New();
-    resetButton.SetLabelText( "Reset" );
+    resetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" );
     resetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     resetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
     stage.Add( resetButton );
@@ -100,6 +101,7 @@ public:
     {
       mSvgActor[i] = Toolkit::ImageView::New(SVG_IMAGES[mIndex+i]);
       mSvgActor[i].SetSize( mActorSize );
+      mSvgActor[i].TranslateBy( Vector3( 0.0, stageSize.height * 0.05, 0.0f ) );
       stage.Add( mSvgActor[i] );
     }
     mSvgActor[0].SetParentOrigin( ParentOrigin::CENTER );
@@ -120,6 +122,9 @@ public:
     mPinchGestureDetector = PinchGestureDetector::New();
     mPinchGestureDetector.Attach( mStageBackground);
     mPinchGestureDetector.DetectedSignal().Connect(this, &ImageSvgController::OnPinch);
+
+    changeButton.RaiseToTop();
+    resetButton.RaiseToTop();
   }
 
   // Callback of push button, for changing image set
@@ -227,20 +232,10 @@ private:
   unsigned int        mIndex;
 };
 
-void RunTest( Application& application )
-{
-  ImageSvgController test( application );
-
-  application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
 int DALI_EXPORT_API main( int argc, char **argv )
 {
   Application application = Application::New( &argc, &argv );
-
-  RunTest( application );
-
+  ImageSvgController test( application );
+  application.MainLoop();
   return 0;
 }