X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fmotion-stretch%2Fmotion-stretch-example.cpp;h=a0597231ce9522f323eecbfd4054dea4b4399dce;hb=5fbb9e39fabb292daf6600dfdd4c637fe52faae2;hp=cdb631fcadcfa240605e92a2475232e555649bd2;hpb=90d6335a8d5a806e166ba218a8f6bc2d794c85c5;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index cdb631f..a059723 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -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. @@ -21,6 +21,7 @@ #include "shared/view.h" #include #include +#include #include using namespace Dali; @@ -110,7 +111,8 @@ public: : mApplication(app), mActorEffectsEnabled(false), mCurrentActorAnimation(0), - mCurrentImage(0) + mCurrentImage(0), + mOrientation( PORTRAIT ) { // Connect to the Application's Init signal app.InitSignal().Connect(this, &MotionStretchExampleApp::OnInit); @@ -141,16 +143,16 @@ public: //Add an slideshow icon on the right of the title mActorEffectsButton = Toolkit::PushButton::New(); - mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON ); - mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED ); + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON ); + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED ); mActorEffectsButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnEffectButtonClicked ); mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); // Creates a mode button. // Create a effect toggle button. (right of toolbar) Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); - layoutButton.SetUnselectedImage( LAYOUT_IMAGE ); - layoutButton.SetSelectedImage( LAYOUT_IMAGE_SELECTED ); + layoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE ); + layoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED ); layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked); layoutButton.SetLeaveRequired( true ); mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); @@ -332,14 +334,14 @@ public: if(!mActorEffectsEnabled) { mActorEffectsEnabled = true; - mActorEffectsButton.SetUnselectedImage( EFFECTS_ON_ICON ); - mActorEffectsButton.SetSelectedImage( EFFECTS_ON_ICON_SELECTED ); + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON ); + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON_SELECTED ); } else { mActorEffectsEnabled = false; - mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON ); - mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED ); + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON ); + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED ); } } @@ -425,20 +427,10 @@ private: }; -void RunTest(Application& app) -{ - MotionStretchExampleApp test(app); - - app.MainLoop(); -} - -// Entry point for Linux & Tizen applications -// int DALI_EXPORT_API main(int argc, char **argv) { Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); - - RunTest(app); - + MotionStretchExampleApp test(app); + app.MainLoop(); return 0; }