X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fline-mesh%2Fline-mesh-example.cpp;h=b4fd11445070618215ab6c1dc1c20d29e8a9525c;hb=2e182925204bf3ef9f2a36cbfbf998e79fbafaf5;hp=c6740ad56ccad9ff227fc715ed69a2de52aeb077;hpb=8b9c89c6455da22660eb69436a3539b138fd0594;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/line-mesh/line-mesh-example.cpp b/examples/line-mesh/line-mesh-example.cpp index c6740ad..b4fd114 100644 --- a/examples/line-mesh/line-mesh-example.cpp +++ b/examples/line-mesh/line-mesh-example.cpp @@ -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,7 +16,6 @@ */ // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES @@ -195,14 +194,14 @@ public: mMeshActor = Actor::New(); mMeshActor.AddRenderer( mRenderer ); - mMeshActor.SetSize(200, 200); + mMeshActor.SetProperty( Actor::Property::SIZE, Vector2(200, 200) ); Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "uMorphAmount", 0.0f ); mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); - mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); - mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); + mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); stage.Add( mMeshActor ); Animation animation = Animation::New(5); @@ -223,13 +222,13 @@ public: Stage stage = Stage::GetCurrent(); Toolkit::TableView modeSelectTableView = Toolkit::TableView::New( 4, 1 ); - modeSelectTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); - modeSelectTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + modeSelectTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + modeSelectTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); modeSelectTableView.SetFitHeight( 0 ); modeSelectTableView.SetFitHeight( 1 ); modeSelectTableView.SetFitHeight( 2 ); modeSelectTableView.SetCellPadding( Vector2( 6.0f, 0.0f ) ); - modeSelectTableView.SetScale( Vector3( 0.8f, 0.8f, 0.8f )); + modeSelectTableView.SetProperty( Actor::Property::SCALE, Vector3( 0.8f, 0.8f, 0.8f )); const char* labels[] = { @@ -240,16 +239,18 @@ public: for( int i = 0; i < 3; ++i ) { - Property::Map labelMap; - labelMap[ "text" ] = labels[i]; - labelMap[ "textColor" ] = Vector4( 0.8f, 0.8f, 0.8f, 1.0f ); - Dali::Toolkit::RadioButton radio = Dali::Toolkit::RadioButton::New(); - radio.SetProperty( Dali::Toolkit::Button::Property::LABEL, labelMap ); - radio.SetParentOrigin( ParentOrigin::TOP_LEFT ); - radio.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - radio.SetSelected( i == 0 ); + radio.SetProperty( Toolkit::Button::Property::LABEL, + Property::Map() + .Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT ) + .Add( Toolkit::TextVisual::Property::TEXT, labels[i] ) + .Add( Toolkit::TextVisual::Property::TEXT_COLOR, Vector4( 0.8f, 0.8f, 0.8f, 1.0f ) ) + ); + + radio.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + radio.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + radio.SetProperty( Toolkit::Button::Property::SELECTED, i == 0 ); radio.PressedSignal().Connect( this, &ExampleController::OnButtonPressed ); mButtons[i] = radio; modeSelectTableView.AddChild( radio, Toolkit::TableView::CellPosition( i, 0 ) ); @@ -257,28 +258,28 @@ public: Toolkit::TableView elementCountTableView = Toolkit::TableView::New( 1, 3 ); elementCountTableView.SetCellPadding( Vector2( 6.0f, 0.0f ) ); - elementCountTableView.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); - elementCountTableView.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); + elementCountTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); + elementCountTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); elementCountTableView.SetFitHeight( 0 ); elementCountTableView.SetFitWidth( 0 ); elementCountTableView.SetFitWidth( 1 ); elementCountTableView.SetFitWidth( 2 ); mMinusButton = Toolkit::PushButton::New(); - mMinusButton.SetLabelText( "<<" ); - mMinusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mMinusButton.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + mMinusButton.SetProperty( Toolkit::Button::Property::LABEL, "<<" ); + mMinusButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mMinusButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); Toolkit::PushButton mPlusButton = Toolkit::PushButton::New(); - mPlusButton.SetLabelText( ">>" ); - mPlusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mPlusButton.SetAnchorPoint( AnchorPoint::CENTER_RIGHT ); + mPlusButton.SetProperty( Toolkit::Button::Property::LABEL, ">>" ); + mPlusButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mPlusButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_RIGHT ); mMinusButton.ClickedSignal().Connect( this, &ExampleController::OnButtonClicked ); mPlusButton.ClickedSignal().Connect( this, &ExampleController::OnButtonClicked ); mIndicesCountLabel = Toolkit::TextLabel::New(); - mIndicesCountLabel.SetParentOrigin( ParentOrigin::CENTER ); - mIndicesCountLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mIndicesCountLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mIndicesCountLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); std::stringstream str; str << mCurrentIndexCount; @@ -390,20 +391,10 @@ private: int mMaxIndexCount; }; -void RunTest( Application& application ) -{ - ExampleController test( application ); - - application.MainLoop(); -} - -// Entry point for Linux & SLP applications -// int DALI_EXPORT_API main( int argc, char **argv ) { Application application = Application::New( &argc, &argv ); - - RunTest( application ); - + ExampleController test( application ); + application.MainLoop(); return 0; }