X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fanimated-vector-images%2Fanimated-vector-images-example.cpp;h=b7bbd1dbe29fc1ea2bf65785439c49212c91d13d;hb=c70446e9b125ae8bb236b4cbc3fd3f8b548459cd;hp=4e6656a4e04836e232c3abf77602dc18f6cbc616;hpb=99c09ce6497efc357e1a60e0a8e08edc7e7e7fbe;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/animated-vector-images/animated-vector-images-example.cpp b/examples/animated-vector-images/animated-vector-images-example.cpp index 4e6656a..b7bbd1d 100644 --- a/examples/animated-vector-images/animated-vector-images-example.cpp +++ b/examples/animated-vector-images/animated-vector-images-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 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. @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +53,7 @@ enum CellPlacement unsigned int GetControlIndex( Control control ) { - std::string controlName = control.GetName(); + std::string controlName = control.GetProperty< std::string >( Dali::Actor::Property::NAME ); unsigned int index = 0; if ( controlName != "") @@ -83,7 +84,7 @@ class AnimatedVectorImageViewController: public ConnectionTracker // The Init signal is received once (only) during the Application lifetime // Creates a default view with a default tool bar. - // The view is added to the stage. + // The view is added to the window. mContentLayer = DemoHelper::CreateView( application, mView, mToolBar, @@ -94,11 +95,11 @@ class AnimatedVectorImageViewController: public ConnectionTracker // Create a table view to show a pair of buttons above each image. mTable = TableView::New( CellPlacement::NUMBER_OF_ROWS, NUMBER_OF_IMAGES ); - mTable.SetAnchorPoint( AnchorPoint::CENTER ); - mTable.SetParentOrigin( ParentOrigin::CENTER ); + mTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); Vector3 offset( 0.9f, 0.70f, 0.0f ); - mTable.SetSizeModeFactor( offset ); + mTable.SetProperty( Actor::Property::SIZE_MODE_FACTOR, offset ); mTable.SetFitHeight(CellPlacement::TOP_BUTTON); mTable.SetFitHeight(CellPlacement::LOWER_BUTTON); mContentLayer.Add( mTable ); @@ -107,23 +108,23 @@ class AnimatedVectorImageViewController: public ConnectionTracker { mPlayButtons[x] = PushButton::New(); mPlayButtons[x].SetProperty( Button::Property::LABEL, "Play" ); - mPlayButtons[x].SetParentOrigin( ParentOrigin::TOP_CENTER ); - mPlayButtons[x].SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mPlayButtons[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mPlayButtons[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mPlayButtons[x].ClickedSignal().Connect( this, &AnimatedVectorImageViewController::OnPlayButtonClicked ); mPlayButtons[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mPlayButtons[x].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); std::string s = std::to_string(x); - mPlayButtons[x].SetName( s ); + mPlayButtons[x].SetProperty( Dali::Actor::Property::NAME, s ); mTable.AddChild( mPlayButtons[x], TableView::CellPosition( CellPlacement::TOP_BUTTON, x ) ); mStopButtons[x] = PushButton::New(); mStopButtons[x].SetProperty( Button::Property::LABEL, "Stop" ); - mStopButtons[x].SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mStopButtons[x].SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mStopButtons[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mStopButtons[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mStopButtons[x].ClickedSignal().Connect( this, &AnimatedVectorImageViewController::OnStopButtonClicked ); mStopButtons[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mStopButtons[x].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - mStopButtons[x].SetName( s ); + mStopButtons[x].SetProperty( Dali::Actor::Property::NAME, s ); mTable.AddChild( mStopButtons[x], TableView::CellPosition( CellPlacement::LOWER_BUTTON, x ) ); mImageViews[x] = ImageView::New( ); @@ -133,17 +134,17 @@ class AnimatedVectorImageViewController: public ConnectionTracker imagePropertyMap.Insert( DevelImageVisual::Property::LOOP_COUNT, 3 ); mImageViews[x].SetProperty( ImageView::Property::IMAGE, imagePropertyMap ); - mImageViews[x].SetParentOrigin( ParentOrigin::CENTER ); - mImageViews[x].SetAnchorPoint( AnchorPoint::CENTER ); + mImageViews[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mImageViews[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mImageViews[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mImageViews[x].SetName( s ); + mImageViews[x].SetProperty( Dali::Actor::Property::NAME, s ); DevelControl::VisualEventSignal( mImageViews[x] ).Connect( this, &AnimatedVectorImageViewController::OnVisualEvent ); mTable.AddChild( mImageViews[x], TableView::CellPosition( CellPlacement::IMAGE, x ) ); } - Stage::GetCurrent().KeyEventSignal().Connect(this, &AnimatedVectorImageViewController::OnKeyEvent); + application.GetWindow().KeyEventSignal().Connect(this, &AnimatedVectorImageViewController::OnKeyEvent); } private: @@ -200,7 +201,7 @@ private: */ void OnKeyEvent( const KeyEvent& event ) { - if( event.state == KeyEvent::Down ) + if( event.GetState() == KeyEvent::DOWN ) { if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) {