From cc86309efaef5f77c85ece1199f95e08534e4a32 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Tue, 19 May 2020 13:54:44 +0100 Subject: [PATCH] Remove some public Setter/Getter APIs from Dali::Actor Change-Id: I9b00f63593d47fd56c0d97f8cb848912ceed726c --- builder/dali-builder.cpp | 6 +- .../alpha-blending-cpu-example.cpp | 10 +- .../animated-gradient-call-active.cpp | 58 ++++----- .../animated-gradient-card-active.cpp | 30 ++--- .../animated-images/animated-images-example.cpp | 14 +- .../animated-shapes/animated-shapes-example.cpp | 18 +-- .../animated-vector-images-example.cpp | 24 ++-- examples/arc-visual/arc-visual-example.cpp | 2 +- examples/benchmark/benchmark.cpp | 2 +- examples/bezier-curve/bezier-curve-example.cpp | 58 ++++----- examples/blocks/blocks-example.cpp | 30 ++--- examples/bloom-view/bloom-view-example.cpp | 16 +-- examples/bubble-effect/bubble-effect-example.cpp | 2 +- examples/builder/examples.cpp | 14 +- examples/buttons/buttons-example.cpp | 46 +++---- .../clipping-draw-order/clipping-draw-order.cpp | 32 ++--- examples/clipping/clipping-example.cpp | 16 +-- examples/clipping/clipping-item-factory.cpp | 4 +- examples/color-visual/color-visual-example.cpp | 2 +- .../compressed-texture-formats-example.cpp | 28 ++-- examples/contact-cards/clipped-image.cpp | 4 +- examples/contact-cards/contact-card.cpp | 41 +++--- .../cube-transition-effect-example.cpp | 6 +- examples/deferred-shading/deferred-shading.cpp | 6 +- .../dissolve-effect/dissolve-effect-example.cpp | 13 +- examples/drag-and-drop/drag-and-drop-example.cpp | 34 ++--- examples/effects-view/effects-view-example.cpp | 16 +-- examples/flex-container/flex-container-example.cpp | 38 +++--- examples/focus-integration/focus-integration.cpp | 8 +- examples/fpp-game/fpp-game-tutorial-controller.cpp | 8 +- examples/fpp-game/game-camera.cpp | 14 +- examples/fpp-game/game-entity.cpp | 2 +- examples/fpp-game/game-scene.cpp | 8 +- examples/frame-callback/frame-callback-example.cpp | 8 +- .../gaussian-blur-view-example.cpp | 28 ++-- examples/gestures/gesture-example.cpp | 25 ++-- examples/gradients/gradients-example.cpp | 4 +- examples/hello-world/hello-world-example.cpp | 4 +- .../homescreen-benchmark/homescreen-benchmark.cpp | 38 +++--- examples/image-policies/image-policies-example.cpp | 42 +++--- .../image-scaling-and-filtering-example.cpp | 81 ++++++------ .../image-scaling-irregular-grid-example.cpp | 26 ++-- .../image-view-alpha-blending-example.cpp | 8 +- .../image-view-pixel-area-example.cpp | 44 +++---- examples/image-view-svg/image-view-svg-example.cpp | 28 ++-- examples/image-view-url/image-view-url-example.cpp | 8 +- examples/image-view/image-view-example.cpp | 30 ++--- examples/item-view/item-view-example.cpp | 90 ++++++------- examples/line-mesh/line-mesh-example.cpp | 28 ++-- examples/magnifier/magnifier-example.cpp | 6 +- examples/mesh-morph/mesh-morph-example.cpp | 4 +- examples/mesh-visual/mesh-visual-example.cpp | 62 ++++----- .../metaball-explosion-example.cpp | 8 +- .../metaball-refrac/metaball-refrac-example.cpp | 8 +- examples/model3d-view/model3d-view-example.cpp | 26 ++-- examples/motion-blur/motion-blur-example.cpp | 4 +- examples/motion-stretch/motion-stretch-example.cpp | 6 +- .../native-image-source-example.cpp | 52 ++++---- examples/page-turn-view/page-turn-view-example.cpp | 4 +- examples/perf-scroll/perf-scroll.cpp | 2 +- examples/pivot/pivot-example.cpp | 6 +- examples/point-mesh/point-mesh-example.cpp | 4 +- examples/popup/popup-example.cpp | 78 +++++------ .../pre-render-callback-example.cpp | 22 ++-- .../primitive-shapes/primitive-shapes-example.cpp | 52 ++++---- examples/progress-bar/progress-bar-example.cpp | 8 +- examples/ray-marching/ray-marching-example.cpp | 4 +- examples/reflection-demo/reflection-example.cpp | 18 +-- .../refraction-effect-example.cpp | 2 +- .../remote-image-loading-example.cpp | 44 +++---- .../renderer-stencil/renderer-stencil-example.cpp | 28 ++-- .../rendering-basic-light-example.cpp | 20 +-- examples/rendering-basic-pbr/model-pbr.cpp | 4 +- examples/rendering-basic-pbr/model-skybox.cpp | 4 +- .../rendering-basic-pbr-example.cpp | 16 +-- examples/rendering-cube/rendering-cube.cpp | 4 +- examples/rendering-line/rendering-line.cpp | 6 +- .../rendering-radial-progress/radial-progress.cpp | 4 +- examples/rendering-skybox/look-camera.cpp | 14 +- examples/rendering-skybox/rendering-skybox.cpp | 12 +- .../rendering-textured-cube.cpp | 4 +- examples/rendering-triangle/rendering-triangle.cpp | 6 +- examples/scroll-view/scroll-view-example.cpp | 18 +-- .../shadows-and-lights-example.cpp | 38 +++--- .../simple-text-label-example.cpp | 16 +-- .../simple-scroll-view-example.cpp | 8 +- examples/simple-text-field/simple-text-field.cpp | 2 +- .../simple-text-label-example.cpp | 6 +- .../simple-text-renderer-example.cpp | 6 +- .../simple-text-visual-example.cpp | 2 +- .../simple-visuals-application.cpp | 10 +- .../size-negotiation/size-negotiation-example.cpp | 110 ++++++++-------- examples/sparkle/sparkle-effect-example.cpp | 6 +- examples/styling/image-channel-control-impl.cpp | 2 +- examples/styling/styling-application.cpp | 145 +++++++++++---------- .../super-blur-view/super-blur-view-example.cpp | 8 +- examples/text-editor/text-editor-example.cpp | 28 ++-- examples/text-field/text-field-example.cpp | 10 +- examples/text-fonts/text-fonts-example.cpp | 16 +-- examples/text-label-emojis/text-label-emojis.cpp | 8 +- .../text-label-multi-language-example.cpp | 4 +- examples/text-label/text-label-example.cpp | 24 ++-- .../text-memory-profiling-example.cpp | 20 +-- examples/text-overlap/text-overlap-example.cpp | 20 +-- examples/text-scrolling/text-scrolling-example.cpp | 36 ++--- examples/textured-mesh/textured-mesh-example.cpp | 8 +- examples/tilt/tilt-example.cpp | 6 +- examples/tooltip/tooltip-example.cpp | 8 +- examples/transitions/transition-application.cpp | 18 +-- examples/video-view/video-view-example.cpp | 52 ++++---- .../visual-transitions/transition-application.cpp | 22 ++-- examples/web-view/web-view-example.cpp | 6 +- shared/dali-table-view.cpp | 53 ++++---- shared/view.h | 22 ++-- 114 files changed, 1194 insertions(+), 1188 deletions(-) diff --git a/builder/dali-builder.cpp b/builder/dali-builder.cpp index 5445fd1..a688f58 100644 --- a/builder/dali-builder.cpp +++ b/builder/dali-builder.cpp @@ -215,9 +215,9 @@ private: if(!layer) { layer = Layer::New(); - layer.SetParentOrigin(ParentOrigin::CENTER); - layer.SetAnchorPoint(AnchorPoint::CENTER); - layer.SetSize( stage.GetRootLayer().GetCurrentSize() ); + layer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); + layer.SetSize( stage.GetRootLayer().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) ); stage.GetRootLayer().Add(layer); // render tasks may have been setup last load so remove them diff --git a/examples/alpha-blending-cpu/alpha-blending-cpu-example.cpp b/examples/alpha-blending-cpu/alpha-blending-cpu-example.cpp index f58e33f..280259a 100644 --- a/examples/alpha-blending-cpu/alpha-blending-cpu-example.cpp +++ b/examples/alpha-blending-cpu/alpha-blending-cpu-example.cpp @@ -61,19 +61,19 @@ private: mImageView = Toolkit::ImageView::New(); mImageView.SetSize(200, 200); - mImageView.SetParentOrigin( ParentOrigin::CENTER ); + mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); stage.Add(mImageView); mImageLabel = Toolkit::TextLabel::New(); - mImageLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mImageLabel.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER ); + mImageLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mImageLabel.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER ); mImageLabel.SetPosition( Vector3( 0.0f, -50.0f, 0.0f ) ); mImageLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK ); stage.Add(mImageLabel); mMaskLabel = Toolkit::TextLabel::New(); - mMaskLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mMaskLabel.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER ); + mMaskLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mMaskLabel.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER ); mMaskLabel.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) ); mMaskLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK ); stage.Add(mMaskLabel); diff --git a/examples/animated-gradient-call-active/animated-gradient-call-active.cpp b/examples/animated-gradient-call-active/animated-gradient-call-active.cpp index 49fdd43..7bb03e1 100644 --- a/examples/animated-gradient-call-active/animated-gradient-call-active.cpp +++ b/examples/animated-gradient-call-active/animated-gradient-call-active.cpp @@ -147,8 +147,8 @@ public: FONT_SCALE = 0.25f * STAGE_SIZE.y / STAGE_SIZE.x; mBackground = Control::New(); - mBackground.SetParentOrigin( ParentOrigin::CENTER ); - mBackground.SetAnchorPoint( AnchorPoint::CENTER ); + mBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mBackground.SetSize( STAGE_SIZE ); mStage.Add( mBackground ); @@ -190,21 +190,21 @@ private: { mButtonIconDecall = ImageView::New(); mButtonIconDecall.SetImage( ICON_DECALL_IMAGE ); - mButtonIconDecall.SetParentOrigin( ParentOrigin::CENTER ); - mButtonIconDecall.SetAnchorPoint( AnchorPoint::CENTER ); + mButtonIconDecall.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mButtonIconDecall.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mButtonIconDecall.SetSize( ICON_DECALL_SIZE * SCALED_WIDTH ); mButtonIconDecall.SetPosition( ICON_DECALL_POSITION * SCALED_WIDTH ); mButtonIconBattery = ImageView::New(); mButtonIconBattery.SetImage( ICON_BATTERY_IMAGE ); - mButtonIconBattery.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mButtonIconBattery.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mButtonIconBattery.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mButtonIconBattery.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mButtonIconBattery.SetSize( ICON_BATTERY_SIZE * SCALED_WIDTH ); mButtonIconBattery.SetPosition( ICON_BATTERY_POSITION * SCALED_WIDTH ); mCallStartButton = PushButton::New(); - mCallStartButton.SetParentOrigin( ParentOrigin::CENTER ); - mCallStartButton.SetAnchorPoint( AnchorPoint::CENTER ); + mCallStartButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mCallStartButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mCallStartButton.SetSize( BUTTON_CALL_START_SIZE * SCALED_WIDTH ); mCallStartButton.SetPosition( BUTTON_CALL_START_POSITION * SCALED_WIDTH ); mCallStartButton.ClickedSignal().Connect( this, &CallController::OnButtonClicked ); @@ -218,44 +218,44 @@ private: mStage.Add( mButtonIconBattery ); mLabelIncoming = TextLabel::New( LABEL_INCOMING_STR ); - mLabelIncoming.SetParentOrigin( ParentOrigin::CENTER ); - mLabelIncoming.SetAnchorPoint( AnchorPoint::CENTER ); + mLabelIncoming.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLabelIncoming.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLabelIncoming.SetSize( LABEL_INCOMING_SIZE * SCALED_STAGE_SIZE ); mLabelIncoming.SetPosition( LABEL_INCOMING_POSITION * SCALED_STAGE_SIZE_3 ); - mLabelIncoming.SetVisible( true ); + mLabelIncoming.SetProperty( Actor::Property::VISIBLE, true ); mLabelIncoming.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_INCOMING_FONT_COLOR ); mLabelIncoming.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_INCOMING_FONT_SIZE * FONT_SCALE ); mLabelIncoming.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mLabelIncoming.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabelName = TextLabel::New( LABEL_NAME_STR ); - mLabelName.SetParentOrigin( ParentOrigin::CENTER ); - mLabelName.SetAnchorPoint( AnchorPoint::CENTER ); + mLabelName.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLabelName.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLabelName.SetSize( LABEL_NAME_SIZE * SCALED_STAGE_SIZE ); mLabelName.SetPosition( LABEL_NAME_POSITION * SCALED_STAGE_SIZE_3 ); - mLabelName.SetVisible( true ); + mLabelName.SetProperty( Actor::Property::VISIBLE, true ); mLabelName.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_NAME_FONT_COLOR ); mLabelName.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_NAME_FONT_SIZE * FONT_SCALE ); mLabelName.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mLabelName.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabelNumber = TextLabel::New( LABEL_NUMBER_STR ); - mLabelNumber.SetParentOrigin( ParentOrigin::CENTER ); - mLabelNumber.SetAnchorPoint( AnchorPoint::CENTER ); + mLabelNumber.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLabelNumber.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLabelNumber.SetSize( LABEL_NUMBER_SIZE * SCALED_STAGE_SIZE ); mLabelNumber.SetPosition( LABEL_NUMBER_POSITION * SCALED_STAGE_SIZE_3 ); - mLabelNumber.SetVisible( true ); + mLabelNumber.SetProperty( Actor::Property::VISIBLE, true ); mLabelNumber.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_NUMBER_FONT_COLOR ); mLabelNumber.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_NUMBER_FONT_SIZE * FONT_SCALE ); mLabelNumber.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mLabelNumber.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabelDecline = TextLabel::New( LABEL_DECLINE_STR ); - mLabelDecline.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mLabelDecline.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mLabelDecline.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mLabelDecline.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mLabelDecline.SetSize( LABEL_DECLINE_SIZE * SCALED_STAGE_SIZE ); mLabelDecline.SetPosition( LABEL_DECLINE_POSITION * SCALED_WIDTH ); - mLabelDecline.SetVisible( true ); + mLabelDecline.SetProperty( Actor::Property::VISIBLE, true ); mLabelDecline.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_DECLINE_FONT_COLOR ); mLabelDecline.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_DECLINE_FONT_SIZE * FONT_SCALE ); mLabelDecline.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -271,21 +271,21 @@ private: void SetupActiveActors() { mButtonClip = Control::New(); - mButtonClip.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mButtonClip.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER ); + mButtonClip.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mButtonClip.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER ); mButtonClip.SetSize( BUTTON_DECALL_SIZE * SCALED_WIDTH ); mButtonClip.SetPosition( BUTTON_DECALL_CLIP_POSITION * SCALED_WIDTH ); mButtonIcon = ImageView::New(); mButtonIcon.SetImage( BUTTON_DECALL_ICON_IMAGE ); - mButtonIcon.SetParentOrigin( ParentOrigin::CENTER ); - mButtonIcon.SetAnchorPoint( AnchorPoint::CENTER ); + mButtonIcon.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mButtonIcon.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mButtonIcon.SetSize( BUTTON_DECALL_ICON_SIZE * SCALED_WIDTH ); mButtonIcon.SetPosition( BUTTON_DECALL_ICON_POSITION * SCALED_WIDTH ); mCallEndButton = PushButton::New(); - mCallEndButton.SetParentOrigin( ParentOrigin::CENTER ); - mCallEndButton.SetAnchorPoint( AnchorPoint::CENTER ); + mCallEndButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mCallEndButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mCallEndButton.SetSize( BUTTON_DECALL_SIZE * SCALED_WIDTH ); mCallEndButton.SetPosition( BUTTON_DECALL_POSITION * SCALED_WIDTH ); mCallEndButton.ClickedSignal().Connect( this, &CallController::OnButtonClicked ); @@ -298,11 +298,11 @@ private: mButtonClip.Add( mButtonIcon ); mLabelTime = TextLabel::New( LABEL_TIME_STR ); - mLabelTime.SetParentOrigin( ParentOrigin::CENTER ); - mLabelTime.SetAnchorPoint( AnchorPoint::CENTER ); + mLabelTime.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLabelTime.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLabelTime.SetSize( LABEL_TIME_SIZE * SCALED_STAGE_SIZE ); mLabelTime.SetPosition( LABEL_TIME_POSITION * SCALED_STAGE_SIZE_3 ); - mLabelTime.SetVisible( false ); + mLabelTime.SetProperty( Actor::Property::VISIBLE, false ); mLabelTime.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_TIME_FONT_COLOR ); mLabelTime.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_TIME_FONT_SIZE * FONT_SCALE ); mLabelTime.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); diff --git a/examples/animated-gradient-card-active/animated-gradient-card-active.cpp b/examples/animated-gradient-card-active/animated-gradient-card-active.cpp index 2678b19..f2e7c13 100644 --- a/examples/animated-gradient-card-active/animated-gradient-card-active.cpp +++ b/examples/animated-gradient-card-active/animated-gradient-card-active.cpp @@ -151,8 +151,8 @@ public: mCard[k].SetProperty(Toolkit::ImageView::Property::IMAGE, propertyMap); } - mCard[k].SetParentOrigin( ParentOrigin::CENTER ); - mCard[k].SetAnchorPoint( AnchorPoint::CENTER ); + mCard[k].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mCard[k].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mCard[k].SetSize( mSize.x, mSize.y ); mCard[k].SetPosition( mPosition[k].x, mPosition[k].y ); @@ -295,8 +295,8 @@ public: FONT_SCALE = 0.25f * STAGE_SIZE.y / STAGE_SIZE.x; mBackground = Control::New(); - mBackground.SetParentOrigin( ParentOrigin::CENTER ); - mBackground.SetAnchorPoint( AnchorPoint::CENTER ); + mBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mBackground.SetSize( STAGE_SIZE ); mStage.Add( mBackground ); @@ -592,39 +592,39 @@ private: { mAddButton = ImageView::New(); mAddButton.SetImage( BUTTON_ADD_IMAGE ); - mAddButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mAddButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mAddButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mAddButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mAddButton.SetSize( BUTTON_ADD_SIZE * SCALED_WIDTH ); mAddButton.SetPosition( BUTTON_ADD_POSITION * SCALED_WIDTH ); mLabel1 = TextLabel::New( LABEL_TICKET_STR ); - mLabel1.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mLabel1.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mLabel1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mLabel1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mLabel1.SetSize( LABEL_TICKET_SIZE * SCALED_WIDTH ); mLabel1.SetPosition( LABEL_TICKET_POSITION * SCALED_WIDTH ); - mLabel1.SetVisible( true ); + mLabel1.SetProperty( Actor::Property::VISIBLE, true ); mLabel1.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_TICKET_FONT_COLOR ); mLabel1.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_TICKET_FONT_SIZE * FONT_SCALE ); mLabel1.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mLabel1.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabel2 = TextLabel::New( LABEL_HOLD_STR ); - mLabel2.SetParentOrigin( ParentOrigin::CENTER ); - mLabel2.SetAnchorPoint( AnchorPoint::CENTER ); + mLabel2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLabel2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLabel2.SetSize( LABEL_HOLD_SIZE * SCALED_WIDTH ); mLabel2.SetPosition( LABEL_HOLD_POSITION * SCALED_WIDTH ); - mLabel2.SetVisible( false ); + mLabel2.SetProperty( Actor::Property::VISIBLE, false ); mLabel2.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_HOLD_FONT_COLOR ); mLabel2.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_HOLD_FONT_SIZE * FONT_SCALE ); mLabel2.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mLabel2.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabel3 = TextLabel::New( LABEL_TERMINAL_STR ); - mLabel3.SetParentOrigin( ParentOrigin::CENTER ); - mLabel3.SetAnchorPoint( AnchorPoint::CENTER ); + mLabel3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLabel3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLabel3.SetSize( LABEL_TERMINAL_SIZE * SCALED_WIDTH ); mLabel3.SetPosition( LABEL_TERMINAL_POSITION * SCALED_WIDTH ); - mLabel3.SetVisible( false ); + mLabel3.SetProperty( Actor::Property::VISIBLE, false ); mLabel3.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_TERMINAL_FONT_COLOR ); mLabel3.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_TERMINAL_FONT_SIZE * FONT_SCALE ); mLabel3.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); diff --git a/examples/animated-images/animated-images-example.cpp b/examples/animated-images/animated-images-example.cpp index 3d83326..0264a89 100644 --- a/examples/animated-images/animated-images-example.cpp +++ b/examples/animated-images/animated-images-example.cpp @@ -131,11 +131,11 @@ private: mArrayButton = CreateRadioButton( ARRAY_RADIO_BUTTON_NAME, false ); Toolkit::TableView radioButtonLayout = Toolkit::TableView::New( 1, 2 ); - radioButtonLayout.SetName( "RadioButtonsLayout" ); + radioButtonLayout.SetProperty( Dali::Actor::Property::NAME, "RadioButtonsLayout" ); radioButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); radioButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - radioButtonLayout.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - radioButtonLayout.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + radioButtonLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + radioButtonLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); radioButtonLayout.SetFitHeight( 0 ); radioButtonLayout.AddChild( mGifButton, TableView::CellPosition( 0, 0 ) ); radioButtonLayout.AddChild( mArrayButton, TableView::CellPosition( 0, 1 ) ); @@ -183,8 +183,8 @@ private: // Create and lay out the image view according to the index control = Toolkit::ImageView::New(); control.SetProperty( Toolkit::ImageView::Property::IMAGE, SetupViewProperties( mImageType, index ) ); - control.SetAnchorPoint( IMAGE_LAYOUT_INFO[ index ].anchorPoint ); - control.SetParentOrigin( IMAGE_LAYOUT_INFO[ index ].parentOrigin ); + control.SetProperty( Actor::Property::ANCHOR_POINT, IMAGE_LAYOUT_INFO[ index ].anchorPoint ); + control.SetProperty( Actor::Property::PARENT_ORIGIN, IMAGE_LAYOUT_INFO[ index ].parentOrigin ); control.SetY( IMAGE_LAYOUT_INFO[ index ].yPosition ); // We do not want the animated image playing when it's added to the stage. @@ -229,8 +229,8 @@ private: Toolkit::PushButton animateButton = Toolkit::PushButton::New(); animateButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON_UNSELECTED ); animateButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED ); - animateButton.SetParentOrigin( ParentOrigin::CENTER ); - animateButton.SetAnchorPoint( AnchorPoint::CENTER ); + animateButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + animateButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); animateButton.ClickedSignal().Connect( this, &AnimatedImageController::OnPlayButtonClicked ); control.Add( animateButton ); diff --git a/examples/animated-shapes/animated-shapes-example.cpp b/examples/animated-shapes/animated-shapes-example.cpp index b4b8a39..7f4d9a0 100644 --- a/examples/animated-shapes/animated-shapes-example.cpp +++ b/examples/animated-shapes/animated-shapes-example.cpp @@ -110,8 +110,8 @@ public: // Creates the background gradient Toolkit::Control background = Dali::Toolkit::Control::New(); - background.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - background.SetParentOrigin( Dali::ParentOrigin::CENTER ); + background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + background.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); Dali::Property::Map map; map.Insert( Toolkit::Visual::Property::TYPE, Visual::GRADIENT ); @@ -132,8 +132,8 @@ public: // Create a TextLabel for the application title. Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE ); - label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - label.SetParentOrigin( Vector3( 0.5f, 0.0f, 0.5f ) ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.0f, 0.5f ) ); label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); @@ -213,8 +213,8 @@ public: Actor actor = Actor::New(); actor.SetSize( 400.0f, 400.0f ); actor.SetPosition( center ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetColor(Vector4(1.0f,1.0f,0.0f,1.0f) ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::COLOR,Vector4(1.0f,1.0f,0.0f,1.0f) ); actor.AddRenderer( renderer ); Stage stage = Stage::GetCurrent(); @@ -305,7 +305,7 @@ public: Actor actor = Actor::New(); actor.SetSize( 400.0f, 400.0f ); actor.SetPosition( center ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); actor.AddRenderer( renderer ); Stage stage = Stage::GetCurrent(); @@ -406,8 +406,8 @@ public: Actor actor = Actor::New(); actor.SetSize( 400.0f, 400.0f ); actor.SetPosition( center ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetColor(Vector4(1.0f,0.0f,0.0f,1.0f) ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::COLOR,Vector4(1.0f,0.0f,0.0f,1.0f) ); actor.AddRenderer( renderer ); Stage stage = Stage::GetCurrent(); diff --git a/examples/animated-vector-images/animated-vector-images-example.cpp b/examples/animated-vector-images/animated-vector-images-example.cpp index 4e6656a..1d72654 100644 --- a/examples/animated-vector-images/animated-vector-images-example.cpp +++ b/examples/animated-vector-images/animated-vector-images-example.cpp @@ -52,7 +52,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 != "") @@ -94,8 +94,8 @@ 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 ); @@ -107,23 +107,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,10 +133,10 @@ 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 ); diff --git a/examples/arc-visual/arc-visual-example.cpp b/examples/arc-visual/arc-visual-example.cpp index 24ecb42..a397ba3 100644 --- a/examples/arc-visual/arc-visual-example.cpp +++ b/examples/arc-visual/arc-visual-example.cpp @@ -72,7 +72,7 @@ private: stage.SetBackgroundColor( Color::WHITE ); mControl = Control::New(); - mControl.SetParentOrigin( ParentOrigin::CENTER ); + mControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mControl.SetSize( 200.0f, 200.0f ); mControl.SetProperty( Control::Property::BACKGROUND, BACKGROUND ); diff --git a/examples/benchmark/benchmark.cpp b/examples/benchmark/benchmark.cpp index cd36e29..abdb5d5 100644 --- a/examples/benchmark/benchmark.cpp +++ b/examples/benchmark/benchmark.cpp @@ -417,7 +417,7 @@ public: unsigned int totalColumns = mColumnsPerPage * mPageCount; - float finalZ = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0).GetCameraActor().GetCurrentWorldPosition().z; + float finalZ = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0).GetCameraActor().GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).z; float totalDuration( 5.0f); float durationPerActor( 0.5f ); float delayBetweenActors = ( totalDuration - durationPerActor) / (mRowsPerPage*mColumnsPerPage); diff --git a/examples/bezier-curve/bezier-curve-example.cpp b/examples/bezier-curve/bezier-curve-example.cpp index 20ce083..cf31616 100644 --- a/examples/bezier-curve/bezier-curve-example.cpp +++ b/examples/bezier-curve/bezier-curve-example.cpp @@ -162,16 +162,16 @@ public: mContentLayer = Layer::New(); mContentLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mContentLayer.TouchSignal().Connect(this, &BezierCurveExample::OnTouchLayer); - mContentLayer.SetParentOrigin( ParentOrigin::CENTER ); + mContentLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); stage.Add( mContentLayer ); // 6 rows: title, grid, coords, play, anim1, anim2 TableView contentLayout = TableView::New(5, 1); - contentLayout.SetName("contentLayout"); + contentLayout.SetProperty( Dali::Actor::Property::NAME,"contentLayout"); contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); contentLayout.SetCellPadding( Size( 30, 30 ) ); - contentLayout.SetParentOrigin(ParentOrigin::TOP_CENTER); - contentLayout.SetAnchorPoint(AnchorPoint::TOP_CENTER); + contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_CENTER); + contentLayout.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mContentLayer.Add( contentLayout ); // Create a TextLabel for the application title. @@ -187,8 +187,8 @@ public: mGrid.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); mGrid.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); - mGrid.SetParentOrigin(ParentOrigin::CENTER); - mGrid.SetAnchorPoint(AnchorPoint::CENTER); + mGrid.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mGrid.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); mGrid.SetBackgroundColor(GRID_BACKGROUND_COLOR); contentLayout.Add( mGrid ); @@ -201,7 +201,7 @@ public: mCoefficientLabel.SetProperty( TextLabel::Property::ENABLE_MARKUP, true ); mCoefficientLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mCoefficientLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); - mCoefficientLabel.SetParentOrigin(ParentOrigin::CENTER); + mCoefficientLabel.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); contentLayout.Add( mCoefficientLabel ); SetLabel( Vector2(0,0), Vector2(1,1)); @@ -211,8 +211,8 @@ public: // Setup Play button and 2 icons to show off current anim and linear anim PushButton play = PushButton::New(); - play.SetName("Play"); - play.SetParentOrigin(ParentOrigin::CENTER); + play.SetProperty( Dali::Actor::Property::NAME,"Play"); + play.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); play.SetProperty( Button::Property::LABEL, "Play"); play.ClickedSignal().Connect( this, &BezierCurveExample::OnPlayClicked ); @@ -221,8 +221,8 @@ public: contentLayout.SetFitHeight(3); auto animContainer = Control::New(); - animContainer.SetName("AnimationContainer"); - animContainer.SetParentOrigin( ParentOrigin::CENTER ); + animContainer.SetProperty( Dali::Actor::Property::NAME,"AnimationContainer"); + animContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); animContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); auto animRail = Control::New(); @@ -231,15 +231,15 @@ public: .Add( ImageVisual::Property::URL, ANIMATION_BACKGROUND ) ); animRail.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); animRail.SetSizeModeFactor( Vector3( 0.666f, 0.2f, 1.0f ) ); - animRail.SetParentOrigin( ParentOrigin::CENTER ); + animRail.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); animContainer.Add( animRail ); contentLayout.Add( animContainer ); contentLayout.SetFixedHeight(4, 150 ); mAnimIcon1 = ImageView::New( CIRCLE1_IMAGE ); - mAnimIcon1.SetParentOrigin( ParentOrigin::CENTER ); - mAnimIcon1.SetAnchorPoint( AnchorPoint::CENTER ); + mAnimIcon1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mAnimIcon1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); // Would like some means of setting and animating position as a percentage of // parent size without using constraints, but this will have to suffice for the moment. @@ -280,8 +280,8 @@ public: void CreateBackground( Stage stage ) { Toolkit::Control background = Dali::Toolkit::Control::New(); - background.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - background.SetParentOrigin( Dali::ParentOrigin::CENTER ); + background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + background.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); Property::Map map; @@ -296,7 +296,7 @@ public: // Create a mesh to draw the cubic as a single line mCurve = Actor::New(); mCurve.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mCurve.SetParentOrigin( ParentOrigin::CENTER ); + mCurve.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Shader shader = Shader::New( CURVE_VERTEX_SHADER, CURVE_FRAGMENT_SHADER ); @@ -319,7 +319,7 @@ public: { Actor actor = ImageView::New( url ); actor.SetScale( mControlPointScale); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); // Curve and line drawing works off current value (i.e. last update frame's value). Need to animate to ensure // initial position is baked to both frames before initially drawing the curve. auto positionAnimation = Animation::New( 0.01f ); @@ -340,7 +340,7 @@ public: { Actor line = Actor::New(); line.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - line.SetParentOrigin( ParentOrigin::CENTER ); + line.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Shader shader = Shader::New( CURVE_VERTEX_SHADER, CURVE_FRAGMENT_SHADER ); Geometry geometry = Geometry::New(); @@ -383,14 +383,14 @@ public: TextLabel progressionLabel = TextLabel::New( "Progression" ); progressionLabel.SetProperty( TextLabel::Property::POINT_SIZE, AXIS_LABEL_POINT_SIZE ); progressionLabel.SetOrientation( Degree(-90.0f), Vector3::ZAXIS ); - progressionLabel.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); - progressionLabel.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + progressionLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); + progressionLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); CreateLine( progressionLabel, ParentOrigin::BOTTOM_LEFT ); TextLabel timeLabel = TextLabel::New( "Time" ); timeLabel.SetProperty( TextLabel::Property::POINT_SIZE, AXIS_LABEL_POINT_SIZE ); - timeLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - timeLabel.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + timeLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + timeLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); CreateLine( timeLabel, ParentOrigin::TOP_LEFT ); parent.Add( progressionLabel ); @@ -400,8 +400,8 @@ public: void CreateLine( Actor parent, const Vector3& parentOrigin ) { Control control = Control::New(); - control.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - control.SetParentOrigin( parentOrigin ); + control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + control.SetProperty( Actor::Property::PARENT_ORIGIN, parentOrigin ); control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); control.SetProperty( Actor::Property::SIZE_HEIGHT, AXIS_LINE_SIZE ); control.SetBackgroundColor( Color::BLACK ); @@ -431,8 +431,8 @@ public: { Vector3 gridSize = mGrid.GetProperty( Actor::Property::SIZE ); // Get target value - pt1 = AlignToGrid( mControlPoint1.GetCurrentPosition(), gridSize ); - pt2 = AlignToGrid( mControlPoint2.GetCurrentPosition(), gridSize ); + pt1 = AlignToGrid( mControlPoint1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), gridSize ); + pt2 = AlignToGrid( mControlPoint2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), gridSize ); } /** @@ -443,7 +443,7 @@ public: void GetPoint( Actor actor, Vector2& point, Vector2& position) { auto gridSize = mGrid.GetProperty( Actor::Property::SIZE ); // Get target value - auto currentPosition = actor.GetCurrentPosition(); // Get constrained current value + auto currentPosition = actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ); // Get constrained current value position = Vector2( floor( currentPosition.x ), floor( currentPosition.y ) ); @@ -502,7 +502,7 @@ public: { Vector2 screenPoint = event.GetScreenPosition( 0 ); mRelativeDragPoint = screenPoint; - mRelativeDragPoint -= Vector2(controlPoint.GetCurrentPosition()); + mRelativeDragPoint -= Vector2(controlPoint.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); mDragActor = controlPoint; mDragAnimation = Animation::New(0.25f); mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3( mControlPointZoomScale, mControlPointZoomScale, 1.0f), AlphaFunction::EASE_OUT); diff --git a/examples/blocks/blocks-example.cpp b/examples/blocks/blocks-example.cpp index 7cadbe2..1c41546 100644 --- a/examples/blocks/blocks-example.cpp +++ b/examples/blocks/blocks-example.cpp @@ -296,13 +296,13 @@ private: mPaddleImage = CreateImage(PADDLE_IMAGE); mPaddle.Add( mPaddleHandle ); mPaddle.Add( mPaddleImage ); - mPaddleHandle.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mPaddleHandle.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mPaddleHandle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mPaddleHandle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mPaddleHandle.SetPosition( 0.0f, stageSize.width * 0.0125f ); - mPaddleImage.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mPaddleImage.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - mPaddle.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mPaddle.SetAnchorPoint( AnchorPoint::CENTER ); + mPaddleImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mPaddleImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + mPaddle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mPaddle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mPaddleFullSize = PADDLE_SIZE * stageSize.width; mPaddle.SetSize( mPaddleFullSize + mPaddleHitMargin ); mPaddleHandle.SetSize( PADDLE_HANDLE_SIZE * stageSize.width ); @@ -380,8 +380,8 @@ private: } mLevelContainer = Actor::New(); - mLevelContainer.SetAnchorPoint( AnchorPoint::CENTER ); - mLevelContainer.SetParentOrigin( ParentOrigin::CENTER ); + mLevelContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mLevelContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mLevelContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mContentLayer.Add( mLevelContainer ); @@ -559,8 +559,8 @@ private: mBrickImageMap["url"] = BRICK_IMAGE_PATH[type]; ImageView brick = ImageView::New(); brick.SetProperty( ImageView::Property::IMAGE, mBrickImageMap ); - brick.SetParentOrigin(ParentOrigin::TOP_LEFT); - brick.SetAnchorPoint(AnchorPoint::CENTER); + brick.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + brick.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); brick.SetPosition( Vector3( position ) ); // Add a constraint on the brick between it and the ball generating a collision-property @@ -593,8 +593,8 @@ private: propertyMap.Insert(DevelVisual::Property::VISUAL_FITTING_MODE, DevelVisual::FILL); ImageView actor = ImageView::New(); actor.SetProperty(Toolkit::ImageView::Property::IMAGE, propertyMap); - actor.SetParentOrigin(ParentOrigin::TOP_LEFT); - actor.SetAnchorPoint(AnchorPoint::CENTER); + actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); return actor; } @@ -627,7 +627,7 @@ private: // Get point where user touched paddle (relative to paddle's center) Vector2 screenPoint = event.GetScreenPosition( 0 ); mRelativeDragPoint = screenPoint; - mRelativeDragPoint -= actor.GetCurrentPosition(); + mRelativeDragPoint -= actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ); mDragActor = actor; mDragAnimation = Animation::New(0.25f); @@ -730,7 +730,7 @@ private: { // Reposition Ball in start position, and make ball appear. mBall.SetPosition( mBallStartPosition ); - mBall.SetColor( Vector4(1.0f, 1.0f, 1.0f, 0.1f) ); + mBall.SetProperty( Actor::Property::COLOR, Vector4(1.0f, 1.0f, 1.0f, 0.1f) ); Animation appear = Animation::New(0.5f); appear.AnimateTo( Property(mBall, Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, 1.0f) ); appear.Play(); @@ -749,7 +749,7 @@ private: { Actor delegate = Actor::DownCast(source.GetTarget()); Vector3 collisionVector = delegate.GetCurrentProperty< Vector3 >( source.GetTargetProperty() ); - Vector3 ballRelativePosition(mBall.GetCurrentPosition() - mPaddle.GetCurrentPosition()); + Vector3 ballRelativePosition(mBall.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) - mPaddle.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); ballRelativePosition.Normalize(); collisionVector.x += ballRelativePosition.x * 0.5f; diff --git a/examples/bloom-view/bloom-view-example.cpp b/examples/bloom-view/bloom-view-example.cpp index 7c856c1..f376277 100644 --- a/examples/bloom-view/bloom-view-example.cpp +++ b/examples/bloom-view/bloom-view-example.cpp @@ -77,46 +77,46 @@ public: Vector2 viewSize( stageSize ); mRootActor = Actor::New(); - mRootActor.SetParentOrigin( ParentOrigin::CENTER ); + mRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mRootActor.SetSize( stageSize ); stage.Add( mRootActor ); // Create the object that will perform the blooming work mBloomView = Dali::Toolkit::BloomView::New(); - mBloomView.SetParentOrigin( ParentOrigin::CENTER ); + mBloomView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mBloomView.SetSize( viewSize ); mRootActor.Add( mBloomView ); mBloomView.Activate(); Layer backgroundLayer = Layer::New(); backgroundLayer.SetSize( viewSize ); - backgroundLayer.SetParentOrigin( ParentOrigin::CENTER ); + backgroundLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mBloomView.Add( backgroundLayer ); // Create the background image ImageView backgroundImage = ImageView::New( BACKGROUND_IMAGE_PATH ); - backgroundImage.SetParentOrigin( ParentOrigin::CENTER ); + backgroundImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); backgroundImage.SetSize( viewSize ); backgroundLayer.Add( backgroundImage ); Layer foregroundLayer = Layer::New(); foregroundLayer.SetSize( viewSize ); - foregroundLayer.SetParentOrigin( ParentOrigin::CENTER ); + foregroundLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mBloomView.Add( foregroundLayer ); // Create visible actors mObjectRootActor = Actor::New(); - mObjectRootActor.SetParentOrigin( ParentOrigin::CENTER ); + mObjectRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mObjectRootActor.SetSize( viewSize ); foregroundLayer.Add( mObjectRootActor ); ImageView imageView = ImageView::New( UI_DIFFUSE_IMAGE ); - imageView.SetParentOrigin( ParentOrigin::CENTER ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView.SetSize( viewSize ); mObjectRootActor.Add( imageView ); imageView = ImageView::New( UI_DIFFUSE_IMAGE ); - imageView.SetParentOrigin( ParentOrigin::CENTER ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView.SetSize( stageSize * 0.5f ); imageView.SetPosition( 0.0f, 0.0f, 100.0f ); mObjectRootActor.Add( imageView ); diff --git a/examples/bubble-effect/bubble-effect-example.cpp b/examples/bubble-effect/bubble-effect-example.cpp index de1f14d..c4f6d40 100644 --- a/examples/bubble-effect/bubble-effect-example.cpp +++ b/examples/bubble-effect/bubble-effect-example.cpp @@ -135,7 +135,7 @@ private: // Get the root actor of all bubbles, and add it to stage. Actor bubbleRoot = mBubbleEmitter.GetRootActor(); - bubbleRoot.SetParentOrigin(ParentOrigin::CENTER); + bubbleRoot.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); bubbleRoot.SetZ(0.1f); // Make sure the bubbles displayed on top og the background. content.Add( bubbleRoot ); diff --git a/examples/builder/examples.cpp b/examples/builder/examples.cpp index d4549b8..9a7b8b3 100644 --- a/examples/builder/examples.cpp +++ b/examples/builder/examples.cpp @@ -275,8 +275,8 @@ public: mItemView = ItemView::New(*this); - mItemView.SetParentOrigin(ParentOrigin::CENTER); - mItemView.SetAnchorPoint(AnchorPoint::CENTER); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST ); mLayout->SetItemSize( Vector3( stage.GetSize().width, 50, 1 ) ); @@ -450,9 +450,9 @@ public: { ReloadJsonFile( name, mBuilder, mBuilderLayer ); - mBuilderLayer.SetParentOrigin(ParentOrigin::BOTTOM_CENTER); - mBuilderLayer.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER); - Dali::Vector3 size = Stage::GetCurrent().GetRootLayer().GetCurrentSize(); + mBuilderLayer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_CENTER); + mBuilderLayer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER); + Dali::Vector3 size = Stage::GetCurrent().GetRootLayer().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ); size.y -= DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight; mBuilderLayer.SetSize( size ); @@ -481,12 +481,12 @@ public: backButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE ); backButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED ); backButton.ClickedSignal().Connect( this, &ExampleApp::OnBackButtonPressed); - backButton.SetLeaveRequired( true ); + backButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); mNavigationView = Toolkit::NavigationView::New(); mNavigationView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mNavigationView.SetAnchorPoint( AnchorPoint::TOP_LEFT); + mNavigationView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); stage.Add( mNavigationView ); diff --git a/examples/buttons/buttons-example.cpp b/examples/buttons/buttons-example.cpp index ce59368..509e93f 100644 --- a/examples/buttons/buttons-example.cpp +++ b/examples/buttons/buttons-example.cpp @@ -105,8 +105,8 @@ class ButtonsController: public ConnectionTracker Toolkit::TableView contentTable = Toolkit::TableView::New( 4, 1 ); contentTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); contentTable.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT ); + contentTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + contentTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) ); for( unsigned int i = 0; i < contentTable.GetRows(); ++i ) @@ -161,8 +161,8 @@ class ButtonsController: public ConnectionTracker image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( "1" ); - mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mRadioButtonImage1.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mRadioButtonImage1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mRadioButtonImage1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mRadioButtonImage1.SetPosition( 0, DP(radioY) ); mRadioButtonImage1.SetProperty( Toolkit::Button::Property::SELECTED, true ); @@ -178,8 +178,8 @@ class ButtonsController: public ConnectionTracker image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( "2" ); - mRadioButtonImage2.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mRadioButtonImage2.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mRadioButtonImage2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mRadioButtonImage2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mRadioButtonImage2.SetPosition( 0, DP(radioY) ); imageSelectTableView.AddChild( mRadioButtonImage2, Toolkit::TableView::CellPosition( 1, 0 ) ); @@ -194,8 +194,8 @@ class ButtonsController: public ConnectionTracker image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( "3" ); - mRadioButtonImage3.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mRadioButtonImage3.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mRadioButtonImage3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mRadioButtonImage3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mRadioButtonImage3.SetPosition( 0, DP(radioY) ); imageSelectTableView.AddChild( mRadioButtonImage3, Toolkit::TableView::CellPosition( 2, 0 ) ); @@ -205,7 +205,7 @@ class ButtonsController: public ConnectionTracker // Create select button mUpdateButton = Toolkit::PushButton::New(); mUpdateButton.SetProperty( Toolkit::Button::Property::LABEL, "Select" ); - mUpdateButton.SetName( "selectButton" ); + mUpdateButton.SetProperty( Dali::Actor::Property::NAME, "selectButton" ); mUpdateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mUpdateButton.ClickedSignal().Connect( this, &ButtonsController::OnButtonClicked ); @@ -263,9 +263,9 @@ class ButtonsController: public ConnectionTracker // First radio button { Toolkit::RadioButton radioButton = Dali::Toolkit::RadioButton::New( "Select enabled" ); - radioButton.SetName( "radioSelectEnable" ); - radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + radioButton.SetProperty( Dali::Actor::Property::NAME, "radioSelectEnable" ); + radioButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + radioButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); radioButton.SetPosition( 0, 0 ); radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true ); @@ -277,9 +277,9 @@ class ButtonsController: public ConnectionTracker // Second radio button { Toolkit::RadioButton radioButton = Dali::Toolkit::RadioButton::New( "Select disabled" ); - radioButton.SetName( "radioSelectDisable" ); - radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + radioButton.SetProperty( Dali::Actor::Property::NAME, "radioSelectDisable" ); + radioButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + radioButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); radioButton.SetPosition( 0, DP(50) ); radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton ); @@ -303,7 +303,7 @@ class ButtonsController: public ConnectionTracker { mCheckboxButton1 = Toolkit::CheckBoxButton::New(); - mCheckboxButton1.SetName( "checkbox1" ); + mCheckboxButton1.SetProperty( Dali::Actor::Property::NAME, "checkbox1" ); mCheckboxButton1.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is unselected" ); mCheckboxButton1.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); mCheckboxButton1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); @@ -313,7 +313,7 @@ class ButtonsController: public ConnectionTracker { mCheckboxButton2 = Toolkit::CheckBoxButton::New(); - mCheckboxButton2.SetName( "checkbox2" ); + mCheckboxButton2.SetProperty( Dali::Actor::Property::NAME, "checkbox2" ); mCheckboxButton2.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is selected" ); mCheckboxButton2.SetProperty( Toolkit::Button::Property::SELECTED, true ); mCheckboxButton2.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); @@ -324,7 +324,7 @@ class ButtonsController: public ConnectionTracker { mCheckboxButton3 = Toolkit::CheckBoxButton::New(); - mCheckboxButton3.SetName( "checkbox3" ); + mCheckboxButton3.SetProperty( Dali::Actor::Property::NAME, "checkbox3" ); mCheckboxButton3.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is unselected" ); mCheckboxButton3.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); mCheckboxButton3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); @@ -395,7 +395,7 @@ class ButtonsController: public ConnectionTracker return true; } - if( button.GetName() == "radioSelectEnable" ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "radioSelectEnable" ) { mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, false ); @@ -409,7 +409,7 @@ class ButtonsController: public ConnectionTracker mToggleButton.SetProperty( Toolkit::Button::Property::DISABLED, false ); } - else if( button.GetName() == "radioSelectDisable" ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "radioSelectDisable" ) { mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, true ); @@ -447,7 +447,7 @@ class ButtonsController: public ConnectionTracker bool OnCheckBoxesSelected( Toolkit::Button button ) { bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get(); - if( button.GetName() == "checkbox1" ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "checkbox1" ) { if( isSelected ) { @@ -459,7 +459,7 @@ class ButtonsController: public ConnectionTracker } } - if( button.GetName() == "checkbox2" ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "checkbox2" ) { if( isSelected ) { @@ -471,7 +471,7 @@ class ButtonsController: public ConnectionTracker } } - if( button.GetName() == "checkbox3" ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "checkbox3" ) { if( isSelected ) { diff --git a/examples/clipping-draw-order/clipping-draw-order.cpp b/examples/clipping-draw-order/clipping-draw-order.cpp index 68ca7df..7d08b63 100644 --- a/examples/clipping-draw-order/clipping-draw-order.cpp +++ b/examples/clipping-draw-order/clipping-draw-order.cpp @@ -59,15 +59,15 @@ public: TextLabel title = TextLabel::New( "Clipping draw order verification" ); title.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); title.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); - title.SetAnchorPoint( AnchorPoint::CENTER ); - title.SetParentOrigin( ParentOrigin::CENTER ); + title.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + title.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); // Create the description label. TextLabel description = TextLabel::New( "The bottom tree should have the same draw order as the top tree.\nThey should look identical except \"C\" is clipped on the bottom tree." ); description.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); description.SetProperty( TextLabel::Property::MULTI_LINE, true ); - description.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - description.SetParentOrigin( Vector3( 0.5f, 1.0f, 0.5f ) ); + description.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); + description.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 1.0f, 0.5f ) ); stage.Add( description ); /* @@ -89,8 +89,8 @@ public: * +---------------+ */ TableView view = TableView::New( 4, 1 ); - view.SetAnchorPoint( AnchorPoint::CENTER ); - view.SetParentOrigin( ParentOrigin::CENTER ); + view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); view.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); view.SetCellAlignment( Toolkit::TableView::CellPosition( 0, 0 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); @@ -129,8 +129,8 @@ public: for( int tree = 0; tree < 2; ++tree ) { Control container = Control::New(); - container.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - container.SetParentOrigin( ParentOrigin::TOP_CENTER ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); container.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Vector4 backgroundColor = tree == 0 ? Vector4( 0.77f, 1.0f, 0.77f, 1.0f ) : Vector4( 0.8f, 0.8f, 1.0f, 1.0f ); container.SetProperty( Control::Property::BACKGROUND, backgroundColor ); @@ -142,24 +142,24 @@ public: std::stringstream labelStream; labelStream << static_cast( static_cast( i ) + 'A' ); TextLabel textLabel = TextLabel::New( labelStream.str() ); - textLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); image[i] = ImageView::New( images[i] ); - image[i].SetAnchorPoint( AnchorPoint::TOP_CENTER ); + image[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); // Calculate the relative positioning for the images and labels. float depth = static_cast( i == 0 ? 0 : ( ( i - 1 ) % 2 ) + 1 ); if( i == 0 ) { - image[i].SetParentOrigin( Vector3( 0.5f, treeYStart, 0.5f ) ); - textLabel.SetParentOrigin( Vector3( 1.0f, 0.05f * depth, 0.5f ) ); + image[i].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, treeYStart, 0.5f ) ); + textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 1.0f, 0.05f * depth, 0.5f ) ); } else { float b = i > 2 ? 1.0f : -1.0f; - image[i].SetParentOrigin( Vector3( 0.5f + ( 0.2f * b ), depthGap, 0.5f ) ); - textLabel.SetParentOrigin( Vector3( 0.98f + 0.215f * b + ( 0.04f * b * depth ), treeYStart + 0.02f + ( 0.16f * depth ), 0.5f ) ); + image[i].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f + ( 0.2f * b ), depthGap, 0.5f ) ); + textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.98f + 0.215f * b + ( 0.04f * b * depth ), treeYStart + 0.02f + ( 0.16f * depth ), 0.5f ) ); } container.Add( textLabel ); @@ -170,8 +170,8 @@ public: TextLabel treeLabel = TextLabel::New( treeText ); treeLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); treeLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "BOTTOM" ); - treeLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - treeLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + treeLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); + treeLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); container.Add( treeLabel ); // Enable clipping for the 2nd tree. diff --git a/examples/clipping/clipping-example.cpp b/examples/clipping/clipping-example.cpp index 884bc18..9f37db8 100644 --- a/examples/clipping/clipping-example.cpp +++ b/examples/clipping/clipping-example.cpp @@ -83,8 +83,8 @@ private: // Create a TextLabel for the application title. Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE ); - label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - label.SetParentOrigin( APPLICATION_TITLE_PARENT_ORIGIN ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, APPLICATION_TITLE_PARENT_ORIGIN ); label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); @@ -92,8 +92,8 @@ private: // Create an item-view which clips its children. mItemView = ItemView::New( mClippingItemFactory ); - mItemView.SetParentOrigin( ParentOrigin::CENTER ); - mItemView.SetAnchorPoint( AnchorPoint::CENTER ); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mItemView.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); // Enable clipping. No need to create any renderers. stage.Add( mItemView ); @@ -116,8 +116,8 @@ private: // Create a border around item-view (as item-view is clipping its children, we should NOT add this as a child of item-view). Control border = Control::New(); - border.SetParentOrigin( ParentOrigin::CENTER ); - border.SetAnchorPoint( AnchorPoint::CENTER ); + border.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + border.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); border.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::BORDER ) .Add( BorderVisual::Property::COLOR, Color::WHITE ) @@ -133,8 +133,8 @@ private: // Create a button to toggle the clipping mode PushButton button = Toolkit::PushButton::New(); - button.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - button.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); diff --git a/examples/clipping/clipping-item-factory.cpp b/examples/clipping/clipping-item-factory.cpp index 9d3b886..7ec1082 100644 --- a/examples/clipping/clipping-item-factory.cpp +++ b/examples/clipping/clipping-item-factory.cpp @@ -113,8 +113,8 @@ Actor ClippingItemFactory::NewItem( unsigned int itemId ) // Add a border image child actor ImageView borderActor = ImageView::New(); - borderActor.SetParentOrigin( ParentOrigin::CENTER ); - borderActor.SetAnchorPoint( AnchorPoint::CENTER ); + borderActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + borderActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) ); borderActor.SetColorMode( USE_PARENT_COLOR ); diff --git a/examples/color-visual/color-visual-example.cpp b/examples/color-visual/color-visual-example.cpp index 616e3f6..92f0d89 100644 --- a/examples/color-visual/color-visual-example.cpp +++ b/examples/color-visual/color-visual-example.cpp @@ -73,7 +73,7 @@ public: stage.SetBackgroundColor( Color::WHITE ); mImageView = ImageView::New( IMAGE_FILE ); - mImageView.SetParentOrigin( ParentOrigin::CENTER ); + mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mImageView.SetSize( 200.0f, 200.0f ); mImageView.SetProperty( DevelControl::Property::SHADOW, SHADOW ); diff --git a/examples/compressed-texture-formats/compressed-texture-formats-example.cpp b/examples/compressed-texture-formats/compressed-texture-formats-example.cpp index 606f8cd..247a523 100644 --- a/examples/compressed-texture-formats/compressed-texture-formats-example.cpp +++ b/examples/compressed-texture-formats/compressed-texture-formats-example.cpp @@ -112,8 +112,8 @@ public: // Setup a TableView to hold a grid of images and labels. Toolkit::TableView table = Toolkit::TableView::New( 3u, 2u ); - table.SetAnchorPoint( AnchorPoint::CENTER ); - table.SetParentOrigin( ParentOrigin::CENTER ); + table.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + table.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); table.SetRelativeWidth( 0u, 0.5f ); table.SetRelativeWidth( 1u, 0.5f ); @@ -124,24 +124,24 @@ public: // Add text labels. TextLabel textLabel = TextLabel::New( "ETC1 (KTX):" ); - textLabel.SetAnchorPoint( AnchorPoint::CENTER ); - textLabel.SetParentOrigin( ParentOrigin::CENTER ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); table.AddChild( textLabel, Toolkit::TableView::CellPosition( 0u, 0u ) ); table.SetCellAlignment( Toolkit::TableView::CellPosition( 0u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); textLabel = TextLabel::New( "ASTC (KTX) 4x4 linear:" ); - textLabel.SetAnchorPoint( AnchorPoint::CENTER ); - textLabel.SetParentOrigin( ParentOrigin::CENTER ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); table.AddChild( textLabel, Toolkit::TableView::CellPosition( 1u, 0u ) ); table.SetCellAlignment( Toolkit::TableView::CellPosition( 1u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); textLabel = TextLabel::New( "ASTC (Native) 4x4 linear:" ); - textLabel.SetAnchorPoint( AnchorPoint::CENTER ); - textLabel.SetParentOrigin( ParentOrigin::CENTER ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); table.AddChild( textLabel, Toolkit::TableView::CellPosition( 2u, 0u ) ); @@ -153,22 +153,22 @@ public: // Add images. Actor actor = Actor::New(); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); AddImage( IMAGE_FILENAME_ETC, actor, geometry, shader ); table.AddChild( actor, Toolkit::TableView::CellPosition( 0u, 1u ) ); table.SetCellAlignment( Toolkit::TableView::CellPosition( 0u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); actor = Actor::New(); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); AddImage( IMAGE_FILENAME_ASTC_LINEAR, actor, geometry, shader ); table.AddChild( actor, Toolkit::TableView::CellPosition( 1u, 1u ) ); table.SetCellAlignment( Toolkit::TableView::CellPosition( 1u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); actor = Actor::New(); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); AddImage( IMAGE_FILENAME_ASTC_LINEAR_NATIVE, actor, geometry, shader ); table.AddChild( actor, Toolkit::TableView::CellPosition( 2u, 1u ) ); table.SetCellAlignment( Toolkit::TableView::CellPosition( 2u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); diff --git a/examples/contact-cards/clipped-image.cpp b/examples/contact-cards/clipped-image.cpp index c27a5f6..a4adbd3 100644 --- a/examples/contact-cards/clipped-image.cpp +++ b/examples/contact-cards/clipped-image.cpp @@ -211,8 +211,8 @@ Dali::Toolkit::Control Create( const std::string& imagePath, Property::Index& pr // Add the actual image to the control Control image = ImageView::New( imagePath ); image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - image.SetParentOrigin( ParentOrigin::CENTER ); - image.SetAnchorPoint( AnchorPoint::CENTER ); + image.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + image.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); clippedImage.Add( image ); return clippedImage; diff --git a/examples/contact-cards/contact-card.cpp b/examples/contact-cards/contact-card.cpp index 92c97d2..01ff791 100644 --- a/examples/contact-cards/contact-card.cpp +++ b/examples/contact-cards/contact-card.cpp @@ -19,6 +19,7 @@ #include "contact-card.h" // EXTERNAL INCLUDES +#include #include #include @@ -115,8 +116,8 @@ ContactCard::ContactCard( Property::Map{ { Toolkit::Visual::Property::TYPE, Visual::COLOR }, { ColorVisual::Property::MIX_COLOR, Color::WHITE } } ); mContactCard.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - mContactCard.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mContactCard.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mContactCard.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mContactCard.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mContactCard.SetPosition( foldedPosition.x, foldedPosition.y ); mContactCard.SetSize( mContactCardLayoutInfo.foldedSize ); stage.Add( mContactCard ); @@ -127,32 +128,32 @@ ContactCard::ContactCard( mHeader.SetProperty( Control::Property::BACKGROUND, Property::Map{ { Toolkit::Visual::Property::TYPE, Visual::COLOR }, { ColorVisual::Property::MIX_COLOR, HEADER_COLOR } } ); - mHeader.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mHeader.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mHeader.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mHeader.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mHeader.SetPosition( mContactCardLayoutInfo.headerFoldedPosition.x, mContactCardLayoutInfo.headerFoldedPosition.y ); // Create a clipped image (whose clipping can be animated) mClippedImage = ClippedImage::Create( imagePath, mClippedImagePropertyIndex ); mClippedImage.SetSize( mContactCardLayoutInfo.imageSize ); - mClippedImage.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mClippedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mClippedImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mClippedImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mClippedImage.SetPosition( mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y ); - mClippedImage.SetVisible( false ); // Hide image as we only want to display it if we are animating or unfolded + mClippedImage.SetProperty( Actor::Property::VISIBLE, false ); // Hide image as we only want to display it if we are animating or unfolded mContactCard.Add( mClippedImage ); // Create an image with a mask which is to be used when the contact is folded mMaskedImage = MaskedImage::Create( imagePath ); mMaskedImage.SetSize( mContactCardLayoutInfo.imageSize ); - mMaskedImage.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mMaskedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mMaskedImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mMaskedImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mMaskedImage.SetPosition( mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y ); mContactCard.Add( mMaskedImage ); // Add the text label for just the name mNameText = TextLabel::New( contactName ); mNameText.SetStyleName( "ContactNameTextLabel" ); - mNameText.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mNameText.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mNameText.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mNameText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mNameText.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mNameText.SetPosition( mContactCardLayoutInfo.textFoldedPosition.x, mContactCardLayoutInfo.textFoldedPosition.y ); mContactCard.Add( mNameText ); @@ -164,11 +165,11 @@ ContactCard::ContactCard( mDetailText = TextLabel::New( detailString ); mDetailText.SetStyleName( "ContactDetailTextLabel" ); - mDetailText.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mDetailText.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mDetailText.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mDetailText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mDetailText.SetPosition( mContactCardLayoutInfo.textFoldedPosition.x, mContactCardLayoutInfo.textFoldedPosition.y ); mDetailText.SetSize( Vector2( mContactCardLayoutInfo.unfoldedSize.width - mContactCardLayoutInfo.textFoldedPosition.x * 2.0f, 0.0f ) ); - mDetailText.SetOpacity( 0.0f ); + mDetailText.SetProperty( DevelActor::Property::OPACITY, 0.0f ); // Attach tap detection to the overall clip control mTapDetector = TapGestureDetector::New(); @@ -207,8 +208,8 @@ void ContactCard::Animate() mContactCard.Add( mDetailText ); // Show clipped-image to animate geometry and hide the masked-image - mClippedImage.SetVisible( true ); - mMaskedImage.SetVisible( false ); + mClippedImage.SetProperty( Actor::Property::VISIBLE, true ); + mMaskedImage.SetProperty( Actor::Property::VISIBLE, false ); // Animate the size of the control (and clipping area) mAnimation.AnimateTo( Property( mContactCard, Actor::Property::POSITION_X ), mContactCardLayoutInfo.unfoldedPosition.x, ALPHA_FUNCTION_UNFOLD, TIME_PERIOD_UNFOLD_X ); @@ -243,7 +244,7 @@ void ContactCard::Animate() if( sibling != mContactCard ) { mAnimation.AnimateTo( Property( sibling, Actor::Property::COLOR_ALPHA ), 0.0f, ALPHA_FUNCTION_UNFOLD, TIME_PERIOD_UNFOLD_SIBLING_OPACITY ); - sibling.SetSensitive( false ); + sibling.SetProperty( Actor::Property::SENSITIVE, false ); } } @@ -290,7 +291,7 @@ void ContactCard::Animate() if( sibling != mContactCard ) { mAnimation.AnimateTo( Property( sibling, Actor::Property::COLOR_ALPHA ), 1.0f, ALPHA_FUNCTION_FOLD, TIME_PERIOD_FOLD_SIBLING_OPACITY ); - sibling.SetSensitive( true ); + sibling.SetProperty( Actor::Property::SENSITIVE, true ); } } @@ -312,8 +313,8 @@ void ContactCard::OnAnimationFinished( Animation& animation ) mDetailText.Unparent(); // Hide the clipped-image as we have finished animating the geometry and show the masked-image again - mClippedImage.SetVisible( false ); - mMaskedImage.SetVisible( true ); + mClippedImage.SetProperty( Actor::Property::VISIBLE, false ); + mMaskedImage.SetProperty( Actor::Property::VISIBLE, true ); } else { diff --git a/examples/cube-transition-effect/cube-transition-effect-example.cpp b/examples/cube-transition-effect/cube-transition-effect-example.cpp index b2f860e..8ee466c 100644 --- a/examples/cube-transition-effect/cube-transition-effect-example.cpp +++ b/examples/cube-transition-effect/cube-transition-effect-example.cpp @@ -253,7 +253,7 @@ void CubeTransitionApp::OnInit( Application& application ) mCubeWaveEffect.TransitionCompletedSignal().Connect(this, &CubeTransitionApp::OnTransitionCompleted); mCubeWaveEffect.SetSize( mViewSize ); - mCubeWaveEffect.SetParentOrigin( ParentOrigin::CENTER ); + mCubeWaveEffect.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCubeWaveEffect.SetCurrentTexture( mCurrentTexture ); // use big cubes @@ -263,7 +263,7 @@ void CubeTransitionApp::OnInit( Application& application ) mCubeCrossEffect.TransitionCompletedSignal().Connect(this, &CubeTransitionApp::OnTransitionCompleted); mCubeCrossEffect.SetSize( mViewSize ); - mCubeCrossEffect.SetParentOrigin( ParentOrigin::CENTER ); + mCubeCrossEffect.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCubeCrossEffect.SetCurrentTexture( mCurrentTexture ); mCubeFoldEffect = Toolkit::CubeTransitionFoldEffect::New( NUM_ROWS_FOLD, NUM_COLUMNS_FOLD ); @@ -271,7 +271,7 @@ void CubeTransitionApp::OnInit( Application& application ) mCubeFoldEffect.TransitionCompletedSignal().Connect(this, &CubeTransitionApp::OnTransitionCompleted); mCubeFoldEffect.SetSize( mViewSize ); - mCubeFoldEffect.SetParentOrigin( ParentOrigin::CENTER ); + mCubeFoldEffect.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCubeFoldEffect.SetCurrentTexture( mCurrentTexture ); mViewTimer = Timer::New( VIEWINGTIME ); diff --git a/examples/deferred-shading/deferred-shading.cpp b/examples/deferred-shading/deferred-shading.cpp index 72ca6c5..dcc4262 100644 --- a/examples/deferred-shading/deferred-shading.cpp +++ b/examples/deferred-shading/deferred-shading.cpp @@ -445,8 +445,8 @@ Renderer CreateRenderer(TextureSet textures, Geometry geometry, Shader shader, u //============================================================================= void CenterActor(Actor actor) { - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); } //============================================================================= @@ -585,7 +585,7 @@ private: Vector3 size{ Vector3::ONE * scale * unit * 2.f }; a.SetSize(size); - a.SetColor(Color::WHITE * .25f + + a.SetProperty( Actor::Property::COLOR,Color::WHITE * .25f + (Color::RED * (v.x + c) / (c * 2.f) + Color::GREEN * (v.y + c) / (c * 2.f) + Color::BLUE * (v.z + c) / (c * 2.f)) * .015625f); diff --git a/examples/dissolve-effect/dissolve-effect-example.cpp b/examples/dissolve-effect/dissolve-effect-example.cpp index 8b1b6eb..2cb8874 100644 --- a/examples/dissolve-effect/dissolve-effect-example.cpp +++ b/examples/dissolve-effect/dissolve-effect-example.cpp @@ -22,6 +22,7 @@ #include "shared/view.h" #include +#include #include #include @@ -248,12 +249,12 @@ void DissolveEffectApp::OnInit( Application& application ) // Set size to stage size to avoid seeing a black border on transition mParent = Actor::New(); mParent.SetSize( Stage::GetCurrent().GetSize() ); - mParent.SetParentOrigin( ParentOrigin::CENTER ); + mParent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mContent.Add( mParent ); // show the first image mCurrentImage = CreateStageFillingImageView( IMAGES[mIndex] ); - mCurrentImage.SetParentOrigin( ParentOrigin::CENTER ); + mCurrentImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); mParent.Add( mCurrentImage ); @@ -286,12 +287,12 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture ) } mNextImage = CreateStageFillingImageView( IMAGES[ mIndex ] ); - mNextImage.SetParentOrigin( ParentOrigin::CENTER ); + mNextImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); mNextImage.SetZ(INITIAL_DEPTH); mParent.Add( mNextImage ); - Vector2 size = Vector2( mCurrentImage.GetCurrentSize() ); + Vector2 size = Vector2( mCurrentImage.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) ); StartTransition( gesture.position / size, gesture.displacement * Vector2(1.0, size.x/size.y)); } } @@ -304,7 +305,7 @@ void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement) mCurrentImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mDissolveEffect ); mAnimation.AnimateTo( Property( mCurrentImage, "uPercentage" ), 1.0f, AlphaFunction::LINEAR ); - mNextImage.SetOpacity(0.0f); + mNextImage.SetProperty( DevelActor::Property::OPACITY,0.0f); mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::LINEAR ); if(mUseHighPrecision) @@ -401,7 +402,7 @@ bool DissolveEffectApp::OnTimerTick() { mIndex = (mIndex + 1)%NUM_IMAGES; mNextImage = CreateStageFillingImageView( IMAGES[ mIndex ] ); - mNextImage.SetParentOrigin( ParentOrigin::CENTER ); + mNextImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); mNextImage.SetZ(INITIAL_DEPTH); diff --git a/examples/drag-and-drop/drag-and-drop-example.cpp b/examples/drag-and-drop/drag-and-drop-example.cpp index 07556bf..91202fc 100755 --- a/examples/drag-and-drop/drag-and-drop-example.cpp +++ b/examples/drag-and-drop/drag-and-drop-example.cpp @@ -81,8 +81,8 @@ public: TextLabel hintText = TextLabel::New("please drag one textlabel, move and drop on other textlabel"); hintText.SetPosition(0.0f, 700.0f); - hintText.SetParentOrigin(ParentOrigin::TOP_LEFT); - hintText.SetAnchorPoint(AnchorPoint::TOP_LEFT); + hintText.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + hintText.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); hintText.SetProperty(TextLabel::Property::MULTI_LINE, true); stage.Add(hintText); @@ -90,10 +90,10 @@ public: { std::string str = "textlabel "; mTextLabel[i] = TextLabel::New(str + std::to_string(i)); - mTextLabel[i].SetParentOrigin(ParentOrigin::TOP_LEFT); - mTextLabel[i].SetAnchorPoint(AnchorPoint::TOP_LEFT); - mTextLabel[i].SetName("textlabel " + std::to_string(i)); - mTextLabel[i].SetLeaveRequired(true); + mTextLabel[i].SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mTextLabel[i].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + mTextLabel[i].SetProperty( Dali::Actor::Property::NAME,"textlabel " + std::to_string(i)); + mTextLabel[i].SetProperty( Actor::Property::LEAVE_REQUIRED,true); mTextLabel[i].SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER"); mTextLabel[i].SetProperty(TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER"); mTextLabel[i].SetBackgroundColor(TEXT_LABEL_COLOR[i]); @@ -130,9 +130,9 @@ public: void OnStart(Control control, Dali::Toolkit::DragAndDropDetector detector) { DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnStart---\n"); - DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str()); + DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); - control.SetOpacity(0.1f); + control.SetProperty( DevelActor::Property::OPACITY,0.1f); Vector2 screenPos = detector.GetCurrentScreenPosition(); control.ScreenToLocal(mDragLocalPos.x, mDragLocalPos.y,screenPos.x, screenPos.y ); Rect targetRect(screenPos.x, screenPos.y, 0.0f, 0.0f); @@ -151,26 +151,26 @@ public: void OnEnter(Control control, Dali::Toolkit::DragAndDropDetector detector) { DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnEnter---\n"); - DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str()); + DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); } void OnExit(Control control, Dali::Toolkit::DragAndDropDetector detector) { DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnExit---\n"); - DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str()); + DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); } void OnMoved(Control control, Dali::Toolkit::DragAndDropDetector detector) { DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---OnMoved---\n"); - DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---control name is %s---\n", control.GetName().c_str()); + DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---coordinate is (%f, %f)---\n", detector.GetCurrentScreenPosition().x, detector.GetCurrentScreenPosition().y); } void OnDropped(Control control, Dali::Toolkit::DragAndDropDetector detector) { DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnDropped---\n"); - DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str()); + DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); Vector2 screenPos = detector.GetCurrentScreenPosition(); Rect targetRect(screenPos.x, screenPos.y, 0.0f, 0.0f); @@ -189,7 +189,7 @@ public: { for(int i = mDragIndex + 1; i <= droppedIndex; i++) { - float y = mTextLabel[mOrder[i]].GetCurrentPosition().y; + float y = mTextLabel[mOrder[i]].GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y; mAnimation.AnimateTo(Property(mTextLabel[mOrder[i]], Actor::Property::POSITION), Vector3(TEXT_LABEL_POSITION_X, y - TEXT_LABEL_HEIGHT, 0.0f), AlphaFunction::EASE_OUT); mAnimation.Play(); } @@ -207,7 +207,7 @@ public: for(int i = mDragIndex - 1; i >= droppedIndex; i--) { - float y = mTextLabel[mOrder[i]].GetCurrentPosition().y; + float y = mTextLabel[mOrder[i]].GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y; mAnimation.AnimateTo(Property(mTextLabel[mOrder[i]], Actor::Property::POSITION), Vector3(TEXT_LABEL_POSITION_X, y + TEXT_LABEL_HEIGHT, 0.0f), AlphaFunction::EASE_OUT); mAnimation.Play(); } @@ -229,7 +229,7 @@ public: KeyFrames k0 = KeyFrames::New(); k0.Add(0.0f, Vector3(localPos.x - mDragLocalPos.x, localPos.y - mDragLocalPos.y, 0.0f)); - k0.Add(1.0f, Vector3(control.GetCurrentPosition().x, control.GetCurrentPosition().y, 0.0f)); + k0.Add(1.0f, Vector3(control.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, control.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, 0.0f)); KeyFrames k1 = KeyFrames::New(); k1.Add(0.0f, 0.1f); @@ -252,9 +252,9 @@ public: void OnEnd(Control control, Dali::Toolkit::DragAndDropDetector detector) { DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnEnd---\n"); - DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str()); + DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); - control.SetOpacity(1.0f); + control.SetProperty( DevelActor::Property::OPACITY,1.0f); } private: diff --git a/examples/effects-view/effects-view-example.cpp b/examples/effects-view/effects-view-example.cpp index 4e00b84..d280f46 100644 --- a/examples/effects-view/effects-view-example.cpp +++ b/examples/effects-view/effects-view-example.cpp @@ -140,14 +140,14 @@ void EffectsViewApp::OnAppInitialize( Application& application ) Vector2 effectsViewSize( mStageSize.width, mStageSize.height * 0.25f ); mDropShadowView = CreateEffectsView( EffectsView::DROP_SHADOW, effectsViewSize, mEffectSize ); - mDropShadowView.SetParentOrigin( ParentOrigin::CENTER ); - mDropShadowView.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mDropShadowView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mDropShadowView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mDropShadowView.SetZ( -mStageSize.height * 0.1f ); mContents.Add( mDropShadowView ); mEmbossView = CreateEffectsView( EffectsView::EMBOSS, effectsViewSize, mEffectSize ); - mEmbossView.SetParentOrigin( ParentOrigin::CENTER ); - mEmbossView.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mEmbossView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mEmbossView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mEmbossView.SetZ( mStageSize.height * 0.1f ); mContents.Add( mEmbossView ); @@ -167,8 +167,8 @@ EffectsView EffectsViewApp::CreateEffectsView( EffectsView::EffectType type, con // text std::string text = ( type == EffectsView::DROP_SHADOW) ? "Drop Shadow" : "Emboss"; TextLabel textActor( TextLabel::New( text ) ); - textActor.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - textActor.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + textActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + textActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); textActor.SetSize( viewSize ); textActor.SetPosition( viewSize.width*0.4f, viewSize.height*0.3f ); textActor.SetProperty( TextLabel::Property::POINT_SIZE, DemoHelper::ScalePointSize(14.f) ); @@ -176,8 +176,8 @@ EffectsView EffectsViewApp::CreateEffectsView( EffectsView::EffectType type, con // image ImageView icon = ImageView::New( TEST_IMAGE ); - icon.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - icon.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + icon.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + icon.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); icon.SetX( viewSize.width*0.1f ); icon.SetSize( viewSize.height*0.8f, viewSize.height*0.8f ); effectsView.Add( icon ); diff --git a/examples/flex-container/flex-container-example.cpp b/examples/flex-container/flex-container-example.cpp index 71bc408..3a5a099 100644 --- a/examples/flex-container/flex-container-example.cpp +++ b/examples/flex-container/flex-container-example.cpp @@ -136,62 +136,62 @@ public: // Create a flex direction toggle button. (left of toolbar) mFlexDirectionButton = Toolkit::PushButton::New(); - mFlexDirectionButton.SetName("mFlexDirectionButton"); + mFlexDirectionButton.SetProperty( Dali::Actor::Property::NAME,"mFlexDirectionButton"); mFlexDirectionButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change.png" ); mFlexDirectionButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change-selected.png" ); mFlexDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexDirectionButtonClicked); - mFlexDirectionButton.SetLeaveRequired( true ); + mFlexDirectionButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mFlexDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a flex wrap toggle button. (left of toolbar) mFlexWrapButton = Toolkit::PushButton::New(); - mFlexWrapButton.SetName("mFlexWrapButton"); + mFlexWrapButton.SetProperty( Dali::Actor::Property::NAME,"mFlexWrapButton"); mFlexWrapButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit.png" ); mFlexWrapButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit-selected.png" ); mFlexWrapButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexWrapButtonClicked); - mFlexWrapButton.SetLeaveRequired( true ); + mFlexWrapButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mFlexWrapButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a content direction toggle button. (left of toolbar) mContentDirectionButton = Toolkit::PushButton::New(); - mContentDirectionButton.SetName("mContentDirectionButton"); + mContentDirectionButton.SetProperty( Dali::Actor::Property::NAME,"mContentDirectionButton"); mContentDirectionButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace.png" ); mContentDirectionButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace-selected.png" ); mContentDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnContentDirectionButtonClicked); - mContentDirectionButton.SetLeaveRequired( true ); + mContentDirectionButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mContentDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a justify content toggle button. (right of toolbar) mJustifyContentButton = Toolkit::PushButton::New(); - mJustifyContentButton.SetName("mJustifyContentButton"); + mJustifyContentButton.SetProperty( Dali::Actor::Property::NAME,"mJustifyContentButton"); mJustifyContentButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset.png" ); mJustifyContentButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset-selected.png" ); mJustifyContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnJustifyContentButtonClicked); - mJustifyContentButton.SetLeaveRequired( true ); + mJustifyContentButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mJustifyContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a align items toggle button. (right of toolbar) mAlignItemsButton = Toolkit::PushButton::New(); - mAlignItemsButton.SetName("mAlignItemsButton"); + mAlignItemsButton.SetProperty( Dali::Actor::Property::NAME,"mAlignItemsButton"); mAlignItemsButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp.png" ); mAlignItemsButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp-selected.png" ); mAlignItemsButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignItemsButtonClicked); - mAlignItemsButton.SetLeaveRequired( true ); + mAlignItemsButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mAlignItemsButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a align content toggle button. (right of toolbar) mAlignContentButton = Toolkit::PushButton::New(); - mAlignContentButton.SetName("mAlignContentButton"); + mAlignContentButton.SetProperty( Dali::Actor::Property::NAME,"mAlignContentButton"); mAlignContentButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross.png" ); mAlignContentButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross-selected.png" ); mAlignContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignContentButtonClicked); - mAlignContentButton.SetLeaveRequired( true ); + mAlignContentButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mAlignContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create the base flex container mFlexContainer = FlexContainer::New(); - mFlexContainer.SetParentOrigin(ParentOrigin::TOP_LEFT); - mFlexContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT); + mFlexContainer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mFlexContainer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); mFlexContainer.SetSize( stageSize.width, stageSize.height - VIEW_STYLE.mToolBarHeight ); mFlexContainer.SetY(VIEW_STYLE.mToolBarHeight); mFlexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::COLUMN); // column as main axis @@ -207,8 +207,8 @@ public: // Create the flex container for the flex items and add it to the base flex container mFlexItemContainer = FlexContainer::New(); - mFlexItemContainer.SetParentOrigin(ParentOrigin::TOP_LEFT); - mFlexItemContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT); + mFlexItemContainer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mFlexItemContainer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); mFlexItemContainer.SetBackgroundColor( Color::YELLOW ); mFlexItemContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, mCurrentFlexDirection); mFlexItemContainer.SetProperty(FlexContainer::Property::FLEX_WRAP, mCurrentFlexWrap); @@ -219,8 +219,8 @@ public: for (int i = 0; i < NUM_FLEX_ITEMS; i++) { PushButton flexItem = PushButton::New(); - flexItem.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - flexItem.SetParentOrigin( ParentOrigin::TOP_LEFT ); + flexItem.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + flexItem.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); // Set different background colour to help to identify different items flexItem.SetBackgroundColor(Vector4(static_cast(i) / NUM_FLEX_ITEMS, static_cast(NUM_FLEX_ITEMS - i) / NUM_FLEX_ITEMS, 1.0f, 1.0f)); @@ -231,7 +231,7 @@ public: std::ostringstream index; index << i + 1; flexItem.SetProperty( Toolkit::Button::Property::LABEL, index.str() ); - flexItem.SetName("FlexItem " + index.str()); + flexItem.SetProperty( Dali::Actor::Property::NAME,"FlexItem " + index.str()); // Set a fixed size to the items so that we can wrap the line and test these // flex properties that only work when there are multiple lines in the layout diff --git a/examples/focus-integration/focus-integration.cpp b/examples/focus-integration/focus-integration.cpp index f2d2bf0..be23648 100644 --- a/examples/focus-integration/focus-integration.cpp +++ b/examples/focus-integration/focus-integration.cpp @@ -63,8 +63,8 @@ public: TableView contentTable = TableView::New(2, 1); contentTable.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH); contentTable.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT); - contentTable.SetAnchorPoint(AnchorPoint::TOP_LEFT); - contentTable.SetParentOrigin(ParentOrigin::TOP_LEFT); + contentTable.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + contentTable.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); contentTable.SetCellPadding(Size(MARGIN_SIZE, MARGIN_SIZE * 0.5f)); contentTable.SetKeyboardFocusable(true); @@ -135,7 +135,7 @@ public: { Control control = Control::DownCast( mContainer.GetChildAt( TableView::CellPosition( (i/3)*2+1, i%3 ) ) ); control.SetKeyboardFocusable(true); - control.SetName(ITEMNAME[i]); + control.SetProperty( Dali::Actor::Property::NAME,ITEMNAME[i]); control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); control.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnControlKeyEvent ); } @@ -160,7 +160,7 @@ public: // Display current control name. bool OnControlKeyEvent( Control control, const KeyEvent& event ) { - std::string controlName = control.GetName(); + std::string controlName = control.GetProperty< std::string >( Dali::Actor::Property::NAME ); mEventLabel.SetProperty( TextLabel::Property::TEXT, controlName+"'s KeyEvent works\n" ); return false; diff --git a/examples/fpp-game/fpp-game-tutorial-controller.cpp b/examples/fpp-game/fpp-game-tutorial-controller.cpp index 8141986..d692285 100644 --- a/examples/fpp-game/fpp-game-tutorial-controller.cpp +++ b/examples/fpp-game/fpp-game-tutorial-controller.cpp @@ -110,8 +110,8 @@ void FppGameTutorialController::DisplayTutorial() // left tutorial text label mLeftLabel = Toolkit::TextLabel::New("Touch here to walk"); - mLeftLabel.SetParentOrigin( ParentOrigin::CENTER ); - mLeftLabel.SetAnchorPoint( AnchorPoint::CENTER ); + mLeftLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mLeftLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLeftLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mLeftLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) ); mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND, @@ -123,8 +123,8 @@ void FppGameTutorialController::DisplayTutorial() // right tutorial text label mRightLabel = Toolkit::TextLabel::New("Touch here to look around"); - mRightLabel.SetParentOrigin( ParentOrigin::CENTER ); - mRightLabel.SetAnchorPoint( AnchorPoint::CENTER ); + mRightLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mRightLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mRightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mRightLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) ); mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND, diff --git a/examples/fpp-game/game-camera.cpp b/examples/fpp-game/game-camera.cpp index 7215c5a..bb23ea5 100644 --- a/examples/fpp-game/game-camera.cpp +++ b/examples/fpp-game/game-camera.cpp @@ -180,9 +180,9 @@ void GameCamera::InitialiseDefaultCamera() { Stage stage = Stage::GetCurrent(); mCameraActor = stage.GetRenderTaskList().GetTask(0).GetCameraActor(); - mCameraActor.SetName( "GameCamera" ); - mCameraActor.SetAnchorPoint( AnchorPoint::CENTER ); - mCameraActor.SetParentOrigin( ParentOrigin::CENTER ); + mCameraActor.SetProperty( Dali::Actor::Property::NAME, "GameCamera" ); + mCameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCameraActor.SetFieldOfView( Radian( Degree( mFovY ) ) ); // should be read from file @@ -190,7 +190,7 @@ void GameCamera::InitialiseDefaultCamera() mCameraActor.SetFarClippingPlane( mFar ); mCameraActor.SetPosition( CAMERA_DEFAULT_POSITION ); - // Camera position is shadowed in order to avoid using GetCurrentPosition() + // Camera position is shadowed in order to avoid using.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) mCameraPosition = CAMERA_DEFAULT_POSITION; } @@ -199,11 +199,11 @@ void GameCamera::CreateInterceptorActor() Stage stage = Stage::GetCurrent(); mInterceptorActor = Actor::New(); - mInterceptorActor.SetName( "GameInputInterceptor" ); + mInterceptorActor.SetProperty( Dali::Actor::Property::NAME, "GameInputInterceptor" ); mInterceptorActor.SetSize( Vector3( stage.GetSize().x, stage.GetSize().y, 1 ) ); mInterceptorActor.SetPosition( Vector3( 0.0, 0.0, 1.0 ) ); - mInterceptorActor.SetAnchorPoint( AnchorPoint::CENTER ); - mInterceptorActor.SetParentOrigin( ParentOrigin::CENTER ); + mInterceptorActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mInterceptorActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCameraActor.Add( mInterceptorActor ); // Connect TouchSignal to interceptor actor diff --git a/examples/fpp-game/game-entity.cpp b/examples/fpp-game/game-entity.cpp index fed76a1..1f5621c 100644 --- a/examples/fpp-game/game-entity.cpp +++ b/examples/fpp-game/game-entity.cpp @@ -21,7 +21,7 @@ GameEntity::GameEntity( const char* name ) { mActor = Dali::Actor::New(); - mActor.SetName( name ); + mActor.SetProperty( Dali::Actor::Property::NAME, name ); } GameEntity::~GameEntity() diff --git a/examples/fpp-game/game-scene.cpp b/examples/fpp-game/game-scene.cpp index 03b8e05..5418b43 100644 --- a/examples/fpp-game/game-scene.cpp +++ b/examples/fpp-game/game-scene.cpp @@ -153,8 +153,8 @@ bool GameScene::Load(const char *filename) // add all to the stage Stage stage = Stage::GetCurrent(); mRootActor = Actor::New(); - mRootActor.SetAnchorPoint( AnchorPoint::CENTER ); - mRootActor.SetParentOrigin( ParentOrigin::CENTER ); + mRootActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); stage.GetRootLayer().Add( mRootActor ); mRootActor.SetScale( -1.0, 1.0, 1.0 ); mRootActor.SetPosition( 0.0, 0.0, 0.0 ); @@ -162,8 +162,8 @@ bool GameScene::Load(const char *filename) for( size_t i = 0; i < mEntities.Size(); ++i ) { Actor actor( mEntities[i]->GetActor() ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mRootActor.Add( actor ); mEntities[i]->UpdateRenderer(); } diff --git a/examples/frame-callback/frame-callback-example.cpp b/examples/frame-callback/frame-callback-example.cpp index 978d087..4041d76 100644 --- a/examples/frame-callback/frame-callback-example.cpp +++ b/examples/frame-callback/frame-callback-example.cpp @@ -106,8 +106,8 @@ private: for( int i = 0; yPos < stageSize.height; ++i ) { ImageView imageView = ImageView::New( IMAGE_NAME ); - imageView.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - imageView.SetParentOrigin( ParentOrigin::TOP_CENTER ); + imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); imageView.SetY( yPos ); yPos += imageView.GetNaturalSize().height; @@ -129,8 +129,8 @@ private: mTextLabel = TextLabel::New( TEXT_ENABLED ); mTextLabel.SetProperty( TextLabel::Property::TEXT_COLOR, TEXT_COLOR_ENABLED ); mTextLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); - mTextLabel.SetAnchorPoint( AnchorPoint::CENTER ); - mTextLabel.SetParentOrigin( ParentOrigin::CENTER ); + mTextLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mStage.Add( mTextLabel ); // Set the FrameCallbackInterface on the root layer. diff --git a/examples/gaussian-blur-view/gaussian-blur-view-example.cpp b/examples/gaussian-blur-view/gaussian-blur-view-example.cpp index 6c68f69..d30bddb 100644 --- a/examples/gaussian-blur-view/gaussian-blur-view-example.cpp +++ b/examples/gaussian-blur-view/gaussian-blur-view-example.cpp @@ -58,8 +58,8 @@ private: stage.KeyEventSignal().Connect(this, &GaussianBlurViewExample::OnKeyEvent); mImageView = Toolkit::ImageView::New( BACKGROUND_IMAGE ); - mImageView.SetParentOrigin( ParentOrigin::CENTER ); - mImageView.SetAnchorPoint( AnchorPoint::CENTER ); + mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); stage.Add( mImageView ); @@ -84,22 +84,22 @@ private: } Layer onTop = Layer::New(); - onTop.SetParentOrigin( ParentOrigin::CENTER ); - onTop.SetAnchorPoint( AnchorPoint::CENTER ); + onTop.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + onTop.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); onTop.SetSize( stageSize ); stage.Add( onTop ); onTop.RaiseToTop(); mOnLabel = TextLabel::New( "Blur ON" ); - mOnLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mOnLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mOnLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN ); - mOnLabel.SetVisible( false ); + mOnLabel.SetProperty( Actor::Property::VISIBLE, false ); onTop.Add( mOnLabel ); mOffLabel = TextLabel::New( "Blur OFF" ); - mOffLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mOffLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mOffLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE ); - mOffLabel.SetVisible( true ); + mOffLabel.SetProperty( Actor::Property::VISIBLE, true ); onTop.Add( mOffLabel ); stage.GetRootLayer().TouchSignal().Connect( this, &GaussianBlurViewExample::OnTouch ); @@ -118,8 +118,8 @@ private: if( !mGaussianBlurView ) { mGaussianBlurView = GaussianBlurView::New( 30, 8.0f, Pixel::RGBA8888, 0.5f, 0.5f, false ); - mGaussianBlurView.SetParentOrigin( ParentOrigin::CENTER ); - mGaussianBlurView.SetAnchorPoint( AnchorPoint::CENTER ); + mGaussianBlurView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mGaussianBlurView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mGaussianBlurView.SetSize( stage.GetSize() ); stage.Add( mGaussianBlurView ); @@ -128,8 +128,8 @@ private: mGaussianBlurView.SetProperty( mGaussianBlurView.GetBlurStrengthPropertyIndex(), mStrength ); - mOnLabel.SetVisible( true ); - mOffLabel.SetVisible( false ); + mOnLabel.SetProperty( Actor::Property::VISIBLE, true ); + mOffLabel.SetProperty( Actor::Property::VISIBLE, false ); } else { @@ -137,8 +137,8 @@ private: UnparentAndReset( mGaussianBlurView ); - mOnLabel.SetVisible( false ); - mOffLabel.SetVisible( true ); + mOnLabel.SetProperty( Actor::Property::VISIBLE, false ); + mOffLabel.SetProperty( Actor::Property::VISIBLE, true ); } } diff --git a/examples/gestures/gesture-example.cpp b/examples/gestures/gesture-example.cpp index 2cca96d..0e165fe 100644 --- a/examples/gestures/gesture-example.cpp +++ b/examples/gestures/gesture-example.cpp @@ -18,6 +18,7 @@ // EXTERNAL INCLUDES #include #include +#include #include #include @@ -85,10 +86,10 @@ void AddHelpInfo( const std::string&& string, Actor parent, Animation animation, Actor text = TextLabel::New( std::move( string ) ); Vector3 position( Stage::GetCurrent().GetSize() * HELP_TEXT_POSITION_MULTIPLIER ); - text.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - text.SetParentOrigin( ParentOrigin::TOP_CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); text.SetPosition( position ); - text.SetOpacity( 0.0f ); + text.SetProperty( DevelActor::Property::OPACITY, 0.0f ); text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, Text::HorizontalAlignment::CENTER ); text.SetProperty( TextLabel::Property::MULTI_LINE, true ); parent.Add( text ); @@ -147,20 +148,20 @@ private: // Create a background with a linear gradient which matches parent size & is placed in the center. Actor background = Control::New(); background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - background.SetParentOrigin( ParentOrigin::CENTER ); + background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); background.SetProperty( Control::Property::BACKGROUND, BACKGROUND ); stage.Add( background ); // Create a control with a circular gradient that we'll use for the gestures and be a quarter of the size of the stage. Actor touchControl = Control::New(); touchControl.SetSize( stage.GetSize() * 0.25f ); - touchControl.SetParentOrigin( ParentOrigin::CENTER ); + touchControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); touchControl.SetProperty( Control::Property::BACKGROUND, CONTROL_BACKGROUND ); background.Add( touchControl ); // Connect to the touch signal touchControl.TouchSignal().Connect( this, &GestureExample::OnTouch ); - touchControl.SetLeaveRequired( true ); + touchControl.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); // Create a long press gesture detector, attach the actor & connect mLongPressDetector = LongPressGestureDetector::New(); @@ -274,7 +275,7 @@ private: // Do a small animation to indicate to the user that we are in pan mode. Animation anim = Animation::New( PAN_MODE_CHANGE_ANIMATION_DURATION ); - anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentScale() * PAN_MODE_START_ANIMATION_SCALE, AlphaFunction::BOUNCE ); + anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) * PAN_MODE_START_ANIMATION_SCALE, AlphaFunction::BOUNCE ); anim.Play(); // Start the shake animation so the user knows when they are in pan mode. @@ -296,7 +297,7 @@ private: // As the displacement is in local actor coords, we will have to multiply the displacement by the // actor's scale so that it moves the correct amount in the parent's coordinate system. Vector3 scaledDisplacement( pan.displacement ); - scaledDisplacement *= actor.GetCurrentScale(); + scaledDisplacement *= actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ); Vector3 currentPosition; actor.GetProperty( Actor::Property::POSITION ).Get( currentPosition ); @@ -319,7 +320,7 @@ private: Animation anim = Animation::New( PAN_MODE_CHANGE_ANIMATION_DURATION ); anim.AnimateTo( Property( actor, Actor::Property::COLOR ), Vector4::ONE ); - anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentScale() * PAN_MODE_END_ANIMATION_SCALE, AlphaFunction::BOUNCE ); + anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) * PAN_MODE_END_ANIMATION_SCALE, AlphaFunction::BOUNCE ); // Move actor back to center if we're out of bounds Vector2 halfStageSize = Stage::GetCurrent().GetSize() * 0.5f; @@ -375,14 +376,14 @@ private: case Gesture::Started: { // Starting scale is required so that we know what to multiply the pinch.scale by. - mStartingScale = actor.GetCurrentScale(); + mStartingScale = actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ); break; } case Gesture::Finished: case Gesture::Cancelled: { - Vector3 scale( actor.GetCurrentScale() ); + Vector3 scale( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) ); // Ensure the actor sizes itself to be within the limits defined. if ( scale.x < MINIMUM_SCALE.x ) @@ -423,7 +424,7 @@ private: case Gesture::Started: { // Starting orientation is required so that we know what to multiply the rotation.rotation by. - mStartingOrientation = actor.GetCurrentOrientation(); + mStartingOrientation = actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ); break; } diff --git a/examples/gradients/gradients-example.cpp b/examples/gradients/gradients-example.cpp index 210beae..7d0adc5 100644 --- a/examples/gradients/gradients-example.cpp +++ b/examples/gradients/gradients-example.cpp @@ -92,8 +92,8 @@ public: DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); mGradientControl = Control::New(); - mGradientControl.SetAnchorPoint( AnchorPoint::CENTER ); - mGradientControl.SetParentOrigin( ParentOrigin::CENTER ); + mGradientControl.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mGradientControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mGradientControl.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); Vector3 offset( 0.9f, 0.7f, 0.0f ); mGradientControl.SetSizeModeFactor( offset ); diff --git a/examples/hello-world/hello-world-example.cpp b/examples/hello-world/hello-world-example.cpp index ad70d0d..f0f830e 100644 --- a/examples/hello-world/hello-world-example.cpp +++ b/examples/hello-world/hello-world-example.cpp @@ -46,8 +46,8 @@ public: stage.SetBackgroundColor( Color::WHITE ); TextLabel textLabel = TextLabel::New( "Hello World" ); - textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - textLabel.SetName( "helloWorldLabel" ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + textLabel.SetProperty( Dali::Actor::Property::NAME, "helloWorldLabel" ); stage.Add( textLabel ); // Respond to a click anywhere on the stage diff --git a/examples/homescreen-benchmark/homescreen-benchmark.cpp b/examples/homescreen-benchmark/homescreen-benchmark.cpp index c32aaf7..2493d3e 100644 --- a/examples/homescreen-benchmark/homescreen-benchmark.cpp +++ b/examples/homescreen-benchmark/homescreen-benchmark.cpp @@ -168,15 +168,15 @@ public: mScrollParent = Actor::New(); mScrollParent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mScrollParent.SetAnchorPoint( AnchorPoint::CENTER ); - mScrollParent.SetParentOrigin( ParentOrigin::CENTER ); + mScrollParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mScrollParent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); // create background Toolkit::ImageView background = Toolkit::ImageView::New( BACKGROUND_IMAGE ); Stage::GetCurrent().Add( background ); background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - background.SetAnchorPoint( AnchorPoint::CENTER ); - background.SetParentOrigin( ParentOrigin::CENTER ); + background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); PopulatePages(); @@ -211,8 +211,8 @@ public: } pageActor.SetBackgroundColor( Vector4( 0.0f, 0.0f, 0.0f, 0.5f ) ); - pageActor.SetParentOrigin( ParentOrigin::CENTER ); - pageActor.SetAnchorPoint( AnchorPoint::CENTER ); + pageActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + pageActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); pageActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); pageActor.SetSizeModeFactor( Vector3( PAGE_SCALE_FACTOR_X, PAGE_SCALE_FACTOR_Y, 1.0f ) ); return pageActor; @@ -232,8 +232,8 @@ public: imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map ); imageView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); imageView.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); - imageView.SetAnchorPoint( AnchorPoint::CENTER ); - imageView.SetParentOrigin( ParentOrigin::CENTER ); + imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView.SetSizeModeFactor( Vector3( IMAGE_AREA, IMAGE_AREA, 1.0f ) ); return imageView; @@ -244,8 +244,8 @@ public: Toolkit::CheckBoxButton button = Toolkit::CheckBoxButton::New(); button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); button.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); - button.SetAnchorPoint( AnchorPoint::CENTER ); - button.SetParentOrigin( ParentOrigin::CENTER ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); button.SetProperty( Toolkit::Button::Property::SELECTED, ( currentIconIndex % 2 == 0 ) ); // Select half the button return button; @@ -270,8 +270,8 @@ public: { // Create parent icon view Toolkit::Control iconView = Toolkit::Control::New(); - iconView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - iconView.SetParentOrigin( ParentOrigin::TOP_LEFT ); + iconView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + iconView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); if( !mConfig.mTableViewEnabled ) { @@ -308,8 +308,8 @@ public: if( useTextLabel ) { Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( DEMO_APPS_NAMES[currentIconIndex] ); - textLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - textLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White. textLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, ( ( static_cast( ROW_HEIGHT * LABEL_AREA ) * 72.0f ) / dpi.y ) * 0.25f ); @@ -329,8 +329,8 @@ public: Toolkit::Control control = Toolkit::Control::New(); control.SetProperty( Toolkit::Control::Property::BACKGROUND, map ); - control.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - control.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); icon.Add( control ); } } @@ -383,13 +383,13 @@ public: AddIconsToPage( page, mConfig.mUseTextLabel ); // Move page 'a little bit up'. - page.SetParentOrigin( ParentOrigin::CENTER ); - page.SetAnchorPoint( AnchorPoint::CENTER ); + page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); page.SetPosition( Vector3( stageSize.x * i, 0.0f, 0.0f ) ); mScrollParent.Add( page ); } - mScrollParent.SetOpacity( 1.0f ); + mScrollParent.SetProperty( DevelActor::Property::OPACITY, 1.0f ); mScrollParent.SetScale( Vector3::ONE ); // Fade in. diff --git a/examples/image-policies/image-policies-example.cpp b/examples/image-policies/image-policies-example.cpp index 65de171..f213236 100644 --- a/examples/image-policies/image-policies-example.cpp +++ b/examples/image-policies/image-policies-example.cpp @@ -114,8 +114,8 @@ class ImagePolicies: public ConnectionTracker } imageView.SetProperty(ImageView::Property::IMAGE , imagePropertyMap ); - imageView.SetParentOrigin( ParentOrigin::CENTER ); - imageView.SetAnchorPoint( AnchorPoint::CENTER ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); imageView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); return imageView; @@ -172,9 +172,9 @@ class ImagePolicies: public ConnectionTracker mTable.RemoveChildAt( TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) ); mInstructions.SetProperty( TextLabel::Property::TEXT, "Loading Image before staging, press next to see it in right column"); TableView dualImageViewTable = TableView::New( 1, 2 ); - dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER ); - dualImageViewTable.SetName("dualTable"); - dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + dualImageViewTable.SetProperty( Dali::Actor::Property::NAME,"dualTable"); + dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) ); TextLabel attached = TextLabel::New("ATTACHED loaded image \nWill appear here"); @@ -201,9 +201,9 @@ class ImagePolicies: public ConnectionTracker mTable.RemoveChildAt( TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) ); TableView dualImageViewTable = TableView::New( 2, 2 ); - dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER ); - dualImageViewTable.SetName("dualTable"); - dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + dualImageViewTable.SetProperty( Dali::Actor::Property::NAME,"dualTable"); + dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) ); @@ -232,8 +232,8 @@ class ImagePolicies: public ConnectionTracker mInstructions.SetProperty( TextLabel::Property::TEXT, "ReleasePolicy::DESTROYED shown in first column, press next to destroy it."); DisableButtonWhilstLoading(); TableView dualImageViewTable = TableView::New( 1, 2 ); - dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER ); - dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) ); @@ -255,8 +255,8 @@ class ImagePolicies: public ConnectionTracker mTable.RemoveChildAt( TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) ); DisableButtonWhilstLoading(); TableView dualImageViewTable = TableView::New( 1, 2 ); - dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER ); - dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) ); @@ -278,8 +278,8 @@ class ImagePolicies: public ConnectionTracker mInstructions.SetProperty( TextLabel::Property::TEXT, "Image with ReleasePolicy::DESTROYED shown in first column, Image will be detached, reusing it will be fast"); DisableButtonWhilstLoading(); TableView dualImageViewTable = TableView::New( 1, 2 ); - dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER ); - dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) ); @@ -318,8 +318,8 @@ class ImagePolicies: public ConnectionTracker mInstructions.SetProperty( TextLabel::Property::TEXT, "Image with ReleasePolicy::DETACHED shown in first column, will be detached and reloaded"); DisableButtonWhilstLoading(); TableView dualImageViewTable = TableView::New( 1, 2 ); - dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER ); - dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) ); @@ -386,16 +386,16 @@ class ImagePolicies: public ConnectionTracker // Create default View. Toolkit::Control view = Toolkit::Control::New(); - view.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - view.SetParentOrigin( Dali::ParentOrigin::CENTER ); + view.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + view.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); view.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); view.SetProperty( Toolkit::Control::Property::BACKGROUND , gradientBackground ); stage.Add( view ); // Create a table view to show a pair of buttons above each image. mTable = TableView::New( TableRowPlacement::NUMBER_OF_ROWS, 1 ); - 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.90f, 0.0f ); mTable.SetSizeModeFactor( offset ); @@ -415,7 +415,7 @@ class ImagePolicies: public ConnectionTracker mNextButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, imagePropertyMap ); mNextButton.SetProperty( Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, LOADING_IMAGE ); mNextButton.SetProperty( Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, NEXT_BUTTON_DISABLED_IMAGE ); - mNextButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + mNextButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); mNextButton.SetY( -50.0f ); mNextButton.SetSize( 100.0f, 100.0f ); mNextButton.ClickedSignal().Connect( this, &ImagePolicies::ChangeImageClicked ); diff --git a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp index cdd8ee6..f79667b 100644 --- a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp +++ b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp @@ -16,6 +16,7 @@ */ #include +#include #include #include #include "shared/view.h" @@ -189,7 +190,7 @@ public: Toolkit::ImageView background = Toolkit::ImageView::New(); background.SetProperty( Toolkit::ImageView::Property::IMAGE, backgroundImage ); - background.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); background.SetSize( stage.GetSize() ); stage.Add( background ); @@ -206,34 +207,34 @@ public: widthPixel[2] = 0x4f; mHeightBox = Toolkit::ImageView::New( heightBackground ); - mHeightBox.SetOpacity( 0.2f ); + mHeightBox.SetProperty( DevelActor::Property::OPACITY, 0.2f ); background.Add( mHeightBox ); mWidthBox = Toolkit::ImageView::New( widthBackground ); - mWidthBox.SetOpacity( 0.2f ); + mWidthBox.SetProperty( DevelActor::Property::OPACITY, 0.2f ); background.Add( mWidthBox ); mDesiredBox = Toolkit::ImageView::New( BORDER_IMAGE ); background.Add( mDesiredBox ); mDesiredBox.SetSize( stage.GetSize() * mImageStageScale ); - mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); - mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); + mDesiredBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mDesiredBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); - mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); - mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); + mHeightBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mHeightBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); - mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); - mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); + mWidthBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mWidthBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); // Initialize the actor mImageView = Toolkit::ImageView::New( IMAGE_PATHS[ 0 ] ); // Reposition the actor - mImageView.SetParentOrigin( ParentOrigin::CENTER ); - mImageView.SetAnchorPoint( AnchorPoint::CENTER ); + mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); // Display the actor on the stage mDesiredBox.Add( mImageView ); @@ -247,15 +248,15 @@ public: mGrabCorner = Toolkit::ImageView::New( RESIZE_HANDLE_IMAGE ); mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - mGrabCorner.SetName( "GrabCorner" ); - mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); - mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); + mGrabCorner.SetProperty( Dali::Actor::Property::NAME, "GrabCorner" ); + mGrabCorner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + mGrabCorner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT ); mGrabCorner.SetPosition( -BORDER_WIDTH, -BORDER_WIDTH ); - mGrabCorner.SetOpacity( 0.6f ); + mGrabCorner.SetProperty( DevelActor::Property::OPACITY, 0.6f ); Layer grabCornerLayer = Layer::New(); - grabCornerLayer.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); - grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); + grabCornerLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + grabCornerLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT ); grabCornerLayer.Add( mGrabCorner ); mDesiredBox.Add( grabCornerLayer ); @@ -281,8 +282,8 @@ public: Dali::Layer controlsLayer = Dali::Layer::New(); controlsLayer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); controlsLayer.SetSizeModeFactor( Vector3( 1.0f, 1.0f, 1.0f ) ); - controlsLayer.SetAnchorPoint( AnchorPoint::TOP_LEFT); - controlsLayer.SetParentOrigin( ParentOrigin::TOP_LEFT); + controlsLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + controlsLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); stage.Add( controlsLayer ); // Back and next image buttons in corners of stage: @@ -290,23 +291,23 @@ public: Toolkit::ImageView imagePrevious = Toolkit::ImageView::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ) ); // Last image button: - imagePrevious.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + imagePrevious.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); imagePrevious.RotateBy( Radian(3.14159265358979323846f), Vector3( 0, 1.0f, 0 ) ); imagePrevious.SetY( playWidth * 0.5f ); imagePrevious.SetX( playWidth + playWidth * 0.5f ); - imagePrevious.SetOpacity( 0.6f ); + imagePrevious.SetProperty( DevelActor::Property::OPACITY, 0.6f ); controlsLayer.Add( imagePrevious ); - imagePrevious.SetName( PREVIOUS_BUTTON_ID ); + imagePrevious.SetProperty( Dali::Actor::Property::NAME, PREVIOUS_BUTTON_ID ); imagePrevious.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); // Next image button: Toolkit::ImageView imageNext = Toolkit::ImageView::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ) ); - imageNext.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + imageNext.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); imageNext.SetY( playWidth * 0.5f ); imageNext.SetX( stage.GetSize().x - playWidth * 0.5f ); - imageNext.SetOpacity( 0.6f ); + imageNext.SetProperty( DevelActor::Property::OPACITY, 0.6f ); controlsLayer.Add( imageNext ); - imageNext.SetName( NEXT_BUTTON_ID ); + imageNext.SetProperty( Dali::Actor::Property::NAME, NEXT_BUTTON_ID ); imageNext.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); // Buttons to popup selectors for fitting and sampling modes: @@ -319,8 +320,8 @@ public: modesGroupBackground.SetCellPadding( Size( MARGIN_SIZE * 0.5f, MARGIN_SIZE ) ); modesGroupBackground.SetFitHeight( 0 ); - modesGroupBackground.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); - modesGroupBackground.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + modesGroupBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); + modesGroupBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); modesGroupBackground.SetPosition( 0.0f, 0.0f ); controlsLayer.Add( modesGroupBackground ); @@ -372,7 +373,7 @@ public: { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetStyleName( STYLE_BUTTON_TEXT ); - button.SetName( id ); + button.SetProperty( Dali::Actor::Property::NAME, id ); button.SetProperty( Toolkit::Button::Property::LABEL, label ); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); @@ -386,9 +387,9 @@ public: const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f; Toolkit::Popup popup = Toolkit::Popup::New(); - popup.SetName( "POPUP" ); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( AnchorPoint::CENTER ); + popup.SetProperty( Dali::Actor::Property::NAME, "POPUP" ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); popup.SetSize( POPUP_WIDTH_DP, 0.0f ); popup.OutsideTouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnPopupOutsideTouched ); @@ -399,11 +400,11 @@ public: Toolkit::PushButton CreatePopupButton( Actor parent, const char* id ) { Toolkit::PushButton button = Toolkit::PushButton::New(); - button.SetName( id ); + button.SetProperty( Dali::Actor::Property::NAME, id ); button.SetProperty( Toolkit::Button::Property::LABEL, id ); - button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - button.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); @@ -415,7 +416,7 @@ public: bool OnButtonClicked( Toolkit::Button button ) { - if( button.GetName() == FITTING_BUTTON_ID ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == FITTING_BUTTON_ID ) { mPopup = CreatePopup(); @@ -438,7 +439,7 @@ public: Stage::GetCurrent().Add( mPopup ); mPopup.SetDisplayState( Toolkit::Popup::SHOWN ); } - else if( button.GetName() == SAMPLING_BUTTON_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == SAMPLING_BUTTON_ID ) { mPopup = CreatePopup(); @@ -486,7 +487,7 @@ public: bool CheckFittingModeButton( Actor &button, FittingMode::Type mode ) { const char * const modeName = StringFromScalingMode( mode ); - if( button.GetName() == modeName ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == modeName ) { mFittingMode = mode; mFittingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName ); @@ -501,7 +502,7 @@ public: bool CheckSamplingModeButton( Actor &button, SamplingMode::Type mode ) { const char * const modeName = StringFromFilterMode( mode ); - if( button.GetName() == modeName ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == modeName ) { mSamplingMode = mode; mSamplingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName ); @@ -530,7 +531,7 @@ public: { case PointState::UP: { - const std::string & name = actor.GetName(); + const std::string & name = actor.GetProperty< std::string >( Dali::Actor::Property::NAME ); if( name == NEXT_BUTTON_ID ) { mCurrentPath = mCurrentPath + 1; @@ -596,7 +597,7 @@ public: { if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) { - if( mPopup && mPopup.IsVisible() ) + if( mPopup && mPopup.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ) { mPopup.SetDisplayState( Toolkit::Popup::HIDDEN ); mPopup.Reset(); diff --git a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp index c152052..05bfccd 100644 --- a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp +++ b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp @@ -189,9 +189,9 @@ ImageView CreateImageView(const std::string& filename, int width, int height, Da map[Toolkit::ImageVisual::Property::FITTING_MODE] = fittingMode; imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map ); - imageView.SetName( filename ); - imageView.SetParentOrigin(ParentOrigin::CENTER); - imageView.SetAnchorPoint(AnchorPoint::CENTER); + imageView.SetProperty( Dali::Actor::Property::NAME, filename ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + imageView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); return imageView; } @@ -323,8 +323,8 @@ public: SetTitle( APPLICATION_TITLE ); mOffStageImageViews = Actor::New(); - mOffStageImageViews.SetAnchorPoint( AnchorPoint::CENTER ); - mOffStageImageViews.SetParentOrigin(ParentOrigin::CENTER); + mOffStageImageViews.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mOffStageImageViews.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mOffStageImageViews.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Build the main content of the widow: @@ -347,8 +347,8 @@ public: mScrollView.ScrollStartedSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollStarted ); mScrollView.ScrollCompletedSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollCompleted ); - mScrollView.SetAnchorPoint(AnchorPoint::CENTER); - mScrollView.SetParentOrigin(ParentOrigin::CENTER); + mScrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); + mScrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -371,15 +371,15 @@ public: // Create the scroll bar mScrollBarVertical = ScrollBar::New(Toolkit::ScrollBar::Vertical); - mScrollBarVertical.SetParentOrigin(ParentOrigin::TOP_RIGHT); - mScrollBarVertical.SetAnchorPoint(AnchorPoint::TOP_RIGHT); + mScrollBarVertical.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_RIGHT); + mScrollBarVertical.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_RIGHT); mScrollBarVertical.SetResizePolicy(Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT); mScrollBarVertical.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH); mScrollView.Add(mScrollBarVertical); mScrollBarHorizontal = ScrollBar::New(Toolkit::ScrollBar::Horizontal); - mScrollBarHorizontal.SetParentOrigin(ParentOrigin::BOTTOM_LEFT); - mScrollBarHorizontal.SetAnchorPoint(AnchorPoint::TOP_LEFT); + mScrollBarHorizontal.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_LEFT); + mScrollBarHorizontal.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); mScrollBarHorizontal.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH); mScrollBarHorizontal.SetOrientation(Quaternion(Radian( 1.5f * Math::PI ), Vector3::ZAXIS)); mScrollView.Add(mScrollBarHorizontal); @@ -453,8 +453,8 @@ public: Actor gridActor = Actor::New(); gridActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - gridActor.SetParentOrigin( ParentOrigin::CENTER ); - gridActor.SetAnchorPoint( AnchorPoint::CENTER ); + gridActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + gridActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); // Work out the constants of the grid and cell dimensions and positions: const float cellWidth = fieldWidth / gridWidth; diff --git a/examples/image-view-alpha-blending/image-view-alpha-blending-example.cpp b/examples/image-view-alpha-blending/image-view-alpha-blending-example.cpp index bf6067c..df0b523 100644 --- a/examples/image-view-alpha-blending/image-view-alpha-blending-example.cpp +++ b/examples/image-view-alpha-blending/image-view-alpha-blending-example.cpp @@ -58,21 +58,21 @@ private: Toolkit::ImageView imageView0 = CreateImageView( IMAGE_PATH ); imageView0.SetSize(imageSize, imageSize); - imageView0.SetParentOrigin( ParentOrigin::CENTER ); + imageView0.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView0.SetY( -imageSize*0.5f ); stage.Add(imageView0); Toolkit::ImageView imageView1 = CreateImageView( redGreen0 ); - imageView1.SetParentOrigin( ParentOrigin::CENTER ); + imageView1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView1.SetSize(imageSize, imageSize); imageView0.Add(imageView1); Toolkit::ImageView imageView2 = CreateImageView( IMAGE_PATH ); imageView2.SetSize(imageSize, imageSize); - imageView2.SetParentOrigin( ParentOrigin::CENTER ); + imageView2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView2.SetY( imageSize*0.5f ); stage.Add(imageView2); Toolkit::ImageView imageView3 = CreateImageView( redGreen1); - imageView3.SetParentOrigin( ParentOrigin::CENTER ); + imageView3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageView3.SetSize(imageSize, imageSize); imageView2.Add(imageView3); diff --git a/examples/image-view-pixel-area/image-view-pixel-area-example.cpp b/examples/image-view-pixel-area/image-view-pixel-area-example.cpp index 5b69e13..dd33abe 100644 --- a/examples/image-view-pixel-area/image-view-pixel-area-example.cpp +++ b/examples/image-view-pixel-area/image-view-pixel-area-example.cpp @@ -98,16 +98,16 @@ private: CreateScene( visualPropertyMap[0] ); mWrapLabel = Toolkit::TextLabel::New(" Automatic atlasing\n WrapMode: CLAMP_TO_EDGE, MIRRORED_REPEAT"); - mWrapLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mWrapLabel.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER ); + mWrapLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mWrapLabel.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER ); mWrapLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mWrapLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); mWrapLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); mContent.Add( mWrapLabel ); mPixelAreaLabel = Toolkit::TextLabel::New( " Use ImageVisual::Property::PIXEL_AREA\n " ); - mPixelAreaLabel.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mPixelAreaLabel.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER ); + mPixelAreaLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mPixelAreaLabel.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER ); mPixelAreaLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mPixelAreaLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); mPixelAreaLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); @@ -124,42 +124,42 @@ private: mImageView[i][j].SetPosition( 50.f*(i-1), 50.f*(j-1) ); } - mImageView[1][1].SetParentOrigin( ParentOrigin::CENTER ); - mImageView[1][1].SetAnchorPoint(AnchorPoint::CENTER ); + mImageView[1][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mImageView[1][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER ); mImageView[1][1].SetScale( 1.f/3.f ); mContent.Add( mImageView[1][1] ); - mImageView[0][0].SetParentOrigin( ParentOrigin::TOP_LEFT ); - mImageView[0][0].SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT ); + mImageView[0][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mImageView[0][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT ); mImageView[0][0].SetPosition( -50.f, -50.f ); mImageView[1][1].Add( mImageView[0][0] ); - mImageView[1][0].SetParentOrigin( ParentOrigin::TOP_CENTER ); - mImageView[1][0].SetAnchorPoint(AnchorPoint::BOTTOM_CENTER ); + mImageView[1][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mImageView[1][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER ); mImageView[1][1].Add( mImageView[1][0] ); - mImageView[2][0].SetParentOrigin( ParentOrigin::TOP_RIGHT ); - mImageView[2][0].SetAnchorPoint(AnchorPoint::BOTTOM_LEFT ); + mImageView[2][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + mImageView[2][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_LEFT ); mImageView[1][1].Add( mImageView[2][0] ); - mImageView[0][1].SetParentOrigin( ParentOrigin::CENTER_LEFT ); - mImageView[0][1].SetAnchorPoint(AnchorPoint::CENTER_RIGHT ); + mImageView[0][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + mImageView[0][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_RIGHT ); mImageView[1][1].Add( mImageView[0][1] ); - mImageView[2][1].SetParentOrigin( ParentOrigin::CENTER_RIGHT ); - mImageView[2][1].SetAnchorPoint(AnchorPoint::CENTER_LEFT ); + mImageView[2][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_RIGHT ); + mImageView[2][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_LEFT ); mImageView[1][1].Add( mImageView[2][1] ); - mImageView[0][2].SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); - mImageView[0][2].SetAnchorPoint(AnchorPoint::TOP_RIGHT ); + mImageView[0][2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); + mImageView[0][2].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_RIGHT ); mImageView[1][1].Add( mImageView[0][2] ); - mImageView[1][2].SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mImageView[1][2].SetAnchorPoint(AnchorPoint::TOP_CENTER ); + mImageView[1][2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mImageView[1][2].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER ); mImageView[1][1].Add( mImageView[1][2] ); - mImageView[2][2].SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); - mImageView[2][2].SetAnchorPoint(AnchorPoint::TOP_LEFT ); + mImageView[2][2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT ); + mImageView[2][2].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT ); mImageView[1][1].Add( mImageView[2][2] ); } diff --git a/examples/image-view-svg/image-view-svg-example.cpp b/examples/image-view-svg/image-view-svg-example.cpp index 13ba31d..30eb58f 100644 --- a/examples/image-view-svg/image-view-svg-example.cpp +++ b/examples/image-view-svg/image-view-svg-example.cpp @@ -76,24 +76,24 @@ public: // Background, for receiving gestures mStageBackground = Actor::New(); - mStageBackground.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - mStageBackground.SetParentOrigin( ParentOrigin::TOP_CENTER ); + mStageBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + mStageBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); mStageBackground.SetSize( stageSize.x, stageSize.y ); stage.Add(mStageBackground); // Push button, for changing the image set for displaying Toolkit::PushButton changeButton = Toolkit::PushButton::New(); changeButton.SetProperty( Toolkit::Button::Property::LABEL, "Next" ); - changeButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); - changeButton.SetParentOrigin( ParentOrigin::TOP_RIGHT ); + changeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); + changeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); stage.Add( changeButton ); changeButton.ClickedSignal().Connect( this, &ImageSvgController::OnChangeButtonClicked ); // Push button, for resetting the actor size and position Toolkit::PushButton resetButton = Toolkit::PushButton::New(); resetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" ); - resetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - resetButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); + resetButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + resetButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); stage.Add( resetButton ); resetButton.ClickedSignal().Connect( this, &ImageSvgController::OnResetButtonClicked ); @@ -105,14 +105,14 @@ public: mSvgActor[i].TranslateBy( Vector3( 0.0, stageSize.height * 0.05, 0.0f ) ); stage.Add( mSvgActor[i] ); } - mSvgActor[0].SetParentOrigin( ParentOrigin::CENTER ); - mSvgActor[0].SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); - mSvgActor[1].SetParentOrigin( ParentOrigin::CENTER ); - mSvgActor[1].SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); - mSvgActor[2].SetParentOrigin( ParentOrigin::CENTER ); - mSvgActor[2].SetAnchorPoint( AnchorPoint::TOP_RIGHT ); - mSvgActor[3].SetParentOrigin( ParentOrigin::CENTER ); - mSvgActor[3].SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mSvgActor[0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mSvgActor[0].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + mSvgActor[1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mSvgActor[1].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); + mSvgActor[2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mSvgActor[2].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); + mSvgActor[3].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mSvgActor[3].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); // Connect pan gesture for moving the actors mPanGestureDetector = PanGestureDetector::New(); diff --git a/examples/image-view-url/image-view-url-example.cpp b/examples/image-view-url/image-view-url-example.cpp index 58d0910..73226fb 100644 --- a/examples/image-view-url/image-view-url-example.cpp +++ b/examples/image-view-url/image-view-url-example.cpp @@ -110,14 +110,14 @@ private: auto rootActor = Stage::GetCurrent().GetRootLayer(); auto cameraActor = CameraActor::New(TARGET_SIZE); - cameraActor.SetParentOrigin(ParentOrigin::CENTER); + cameraActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); cameraActor.SetInvertYAxis(true); rootActor.Add(cameraActor); { // create actor to render input with applied shader mActorForInput = Toolkit::ImageView::New( url ); - mActorForInput.SetParentOrigin(ParentOrigin::CENTER); + mActorForInput.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mActorForInput.SetSize(TARGET_SIZE); Property::Map customShader; customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = FILTER_FRAGMENT_SOURCE; @@ -166,8 +166,8 @@ private: auto url = Dali::Toolkit::TextureManager::AddTexture(mOutputTexture); mImageView = Toolkit::ImageView::New(url); - mImageView.SetParentOrigin(ParentOrigin::CENTER); - mImageView.SetAnchorPoint(AnchorPoint::CENTER); + mImageView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mImageView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); mContent.Add(mImageView); } diff --git a/examples/image-view/image-view-example.cpp b/examples/image-view/image-view-example.cpp index d9fbe33..3ca6dd6 100644 --- a/examples/image-view/image-view-example.cpp +++ b/examples/image-view/image-view-example.cpp @@ -54,7 +54,7 @@ enum CellPlacement unsigned int GetButtonIndex( Toolkit::Button button ) { - std::string buttonName = button.GetName(); + std::string buttonName = button.GetProperty< std::string >( Dali::Actor::Property::NAME ); unsigned int index = 0; if ( buttonName != "") @@ -109,8 +109,8 @@ class ImageViewController: public ConnectionTracker // Create a table view to show a pair of buttons above each image. mTable = Toolkit::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 ); @@ -121,7 +121,7 @@ class ImageViewController: public ConnectionTracker Toolkit::TextLabel instructions = Toolkit::TextLabel::New( EXAMPLE_INSTRUCTIONS ); instructions.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); - instructions.SetParentOrigin(ParentOrigin::BOTTOM_CENTER); + instructions.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_CENTER); instructions.SetY(-50.0f); instructions.SetProperty( Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, true ); instructions.SetProperty( Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 10 ); @@ -131,33 +131,33 @@ class ImageViewController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetProperty( Toolkit::Button::Property::LABEL, "on/off" ); - button.SetParentOrigin( ParentOrigin::TOP_CENTER ); - button.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); button.ClickedSignal().Connect( this, &ImageViewController::ToggleImageOnStage ); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); std::string s = std::to_string(x); - button.SetName( s ); + button.SetProperty( Dali::Actor::Property::NAME, s ); mTable.AddChild( button, Toolkit::TableView::CellPosition( CellPlacement::TOP_BUTTON, x ) ); Toolkit::PushButton button2 = Toolkit::PushButton::New(); button2.SetProperty( Toolkit::Button::Property::LABEL, "Change" ); - button2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - button2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + button2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + button2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); button2.ClickedSignal().Connect( this, &ImageViewController::ChangeImageClicked ); button2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - button2.SetName( s ); + button2.SetProperty( Dali::Actor::Property::NAME, s ); mTable.AddChild( button2, Toolkit::TableView::CellPosition( CellPlacement::MID_BUTTON, x ) ); Toolkit::PushButton button3 = Toolkit::PushButton::New(); button3.SetProperty( Toolkit::Button::Property::LABEL, "Round" ); - button3.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - button3.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + button3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + button3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); button3.ClickedSignal().Connect( this, &ImageViewController::RoundedCornerClicked ); button3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - button3.SetName( s ); + button3.SetProperty( Dali::Actor::Property::NAME, s ); mTable.AddChild( button3, Toolkit::TableView::CellPosition( CellPlacement::LOWER_BUTTON, x ) ); mImageViews[x] = Toolkit::ImageView::New( ); @@ -167,8 +167,8 @@ class ImageViewController: public ConnectionTracker mImageViews[x].SetProperty(Toolkit::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 ); mTable.AddChild( mImageViews[x], Toolkit::TableView::CellPosition( CellPlacement::IMAGE, x ) ); diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index ae285e4..ccb74e2 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -217,7 +217,7 @@ public: editButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE ); editButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED ); editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked); - editButton.SetLeaveRequired( true ); + editButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a layout toggle button. (right of toolbar) @@ -225,13 +225,13 @@ public: mLayoutButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE ); mLayoutButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE_SELECTED ); mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked); - mLayoutButton.SetLeaveRequired( true ); + mLayoutButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a delete button (bottom right of screen) mDeleteButton = Toolkit::PushButton::New(); - mDeleteButton.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT); - mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); + mDeleteButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT); + mDeleteButton.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT); mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); mDeleteButton.SetDrawMode( DrawMode::OVERLAY_2D ); mDeleteButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DELETE_IMAGE ); @@ -239,14 +239,14 @@ public: mDeleteButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE ); mDeleteButton.SetSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) ); mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked); - mDeleteButton.SetLeaveRequired( true ); - mDeleteButton.SetVisible( false ); + mDeleteButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); + mDeleteButton.SetProperty( Actor::Property::VISIBLE, false ); stage.Add( mDeleteButton ); // Create an insert button (bottom right of screen) mInsertButton = Toolkit::PushButton::New(); - mInsertButton.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT); - mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); + mInsertButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT); + mInsertButton.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT); mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); mInsertButton.SetDrawMode( DrawMode::OVERLAY_2D ); mInsertButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, INSERT_IMAGE ); @@ -254,14 +254,14 @@ public: mInsertButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE ); mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked); - mInsertButton.SetLeaveRequired( true ); - mInsertButton.SetVisible( false ); + mInsertButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); + mInsertButton.SetProperty( Actor::Property::VISIBLE, false ); stage.Add( mInsertButton ); // Create an replace button (bottom right of screen) mReplaceButton = Toolkit::PushButton::New(); - mReplaceButton.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT); - mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); + mReplaceButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT); + mReplaceButton.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT); mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); mReplaceButton.SetDrawMode( DrawMode::OVERLAY_2D ); mReplaceButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, REPLACE_IMAGE ); @@ -269,14 +269,14 @@ public: mReplaceButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE ); mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked); - mReplaceButton.SetLeaveRequired( true ); - mReplaceButton.SetVisible( false ); + mReplaceButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); + mReplaceButton.SetProperty( Actor::Property::VISIBLE, false ); stage.Add( mReplaceButton ); // Create the item view actor mItemView = ItemView::New(*this); - mItemView.SetParentOrigin(ParentOrigin::CENTER); - mItemView.SetAnchorPoint(AnchorPoint::CENTER); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); // Display item view on the stage stage.Add( mItemView ); @@ -495,7 +495,7 @@ public: { SetTitle("Edit: Remove Many"); - mDeleteButton.SetVisible( true ); + mDeleteButton.SetProperty( Actor::Property::VISIBLE, true ); mTapDetector = TapGestureDetector::New(); @@ -507,7 +507,7 @@ public: if( box ) { mTapDetector.Attach( child ); - box.SetVisible( true ); + box.SetProperty( Actor::Property::VISIBLE, true ); } } @@ -523,19 +523,19 @@ public: if( box ) { - box.SetVisible( false ); + box.SetProperty( Actor::Property::VISIBLE, false ); Actor tick = box.FindChildByName( "Tick" ); if( tick ) { - tick.SetVisible( false ); + tick.SetProperty( Actor::Property::VISIBLE, false ); } } } mTapDetector.Reset(); - mDeleteButton.SetVisible( false ); + mDeleteButton.SetProperty( Actor::Property::VISIBLE, false ); } void SelectOnTap( Actor actor, const TapGesture& tap ) @@ -543,7 +543,7 @@ public: Actor tick = actor.FindChildByName( "Tick" ); if( tick ) { - tick.SetVisible( !tick.IsVisible() ); + tick.SetProperty( Actor::Property::VISIBLE, !tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); } } @@ -585,7 +585,7 @@ public: Actor child = mItemView.GetChildAt( i ); Actor tick = child.FindChildByName( "Tick" ); - if( tick && tick.IsVisible() ) + if( tick && tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ) { removeList.push_back( mItemView.GetItemId(child) ); } @@ -631,7 +631,7 @@ public: { SetTitle("Edit: Insert Many"); - mInsertButton.SetVisible( true ); + mInsertButton.SetProperty( Actor::Property::VISIBLE, true ); mTapDetector = TapGestureDetector::New(); @@ -643,7 +643,7 @@ public: if( box ) { mTapDetector.Attach( child ); - box.SetVisible( true ); + box.SetProperty( Actor::Property::VISIBLE, true ); } } @@ -659,19 +659,19 @@ public: if( box ) { - box.SetVisible( false ); + box.SetProperty( Actor::Property::VISIBLE, false ); Actor tick = box.FindChildByName( "Tick" ); if( tick ) { - tick.SetVisible( false ); + tick.SetProperty( Actor::Property::VISIBLE, false ); } } } mTapDetector.Reset(); - mInsertButton.SetVisible( false ); + mInsertButton.SetProperty( Actor::Property::VISIBLE, false ); } bool OnInsertButtonClicked( Toolkit::Button button ) @@ -683,7 +683,7 @@ public: Actor child = mItemView.GetChildAt( i ); Actor tick = child.FindChildByName( "Tick" ); - if( tick && tick.IsVisible() ) + if( tick && tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ) { insertList.push_back( Item( mItemView.GetItemId(child), NewItem(rand()) ) ); } @@ -725,7 +725,7 @@ public: { SetTitle("Edit: Replace Many"); - mReplaceButton.SetVisible( true ); + mReplaceButton.SetProperty( Actor::Property::VISIBLE, true ); mTapDetector = TapGestureDetector::New(); @@ -737,7 +737,7 @@ public: if( box ) { mTapDetector.Attach( child ); - box.SetVisible( true ); + box.SetProperty( Actor::Property::VISIBLE, true ); } } @@ -753,19 +753,19 @@ public: if( box ) { - box.SetVisible( false ); + box.SetProperty( Actor::Property::VISIBLE, false ); Actor tick = box.FindChildByName( "Tick" ); if( tick ) { - tick.SetVisible( false ); + tick.SetProperty( Actor::Property::VISIBLE, false ); } } } mTapDetector.Reset(); - mReplaceButton.SetVisible( false ); + mReplaceButton.SetProperty( Actor::Property::VISIBLE, false ); } bool OnReplaceButtonClicked( Toolkit::Button button ) @@ -777,7 +777,7 @@ public: Actor child = mItemView.GetChildAt( i ); Actor tick = child.FindChildByName( "Tick" ); - if( tick && tick.IsVisible() ) + if( tick && tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ) { replaceList.push_back( Item( mItemView.GetItemId(child), NewItem(rand()) ) ); } @@ -877,8 +877,8 @@ public: // From ItemFactory // Add a border image child actor ImageView borderActor = ImageView::New(); - borderActor.SetParentOrigin( ParentOrigin::CENTER ); - borderActor.SetAnchorPoint( AnchorPoint::CENTER ); + borderActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + borderActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) ); borderActor.SetColorMode( USE_PARENT_COLOR ); @@ -899,10 +899,10 @@ public: // From ItemFactory // Add a checkbox child actor; invisible until edit-mode is enabled ImageView checkbox = ImageView::New(); - checkbox.SetName( "CheckBox" ); + checkbox.SetProperty( Dali::Actor::Property::NAME, "CheckBox" ); checkbox.SetColorMode( USE_PARENT_COLOR ); - checkbox.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - checkbox.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + checkbox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + checkbox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); checkbox.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f ); checkbox.SetPosition( -SELECTION_BORDER_WIDTH, SELECTION_BORDER_WIDTH ); checkbox.SetZ( 0.1f ); @@ -916,18 +916,18 @@ public: // From ItemFactory MODE_INSERT_MANY != mMode && MODE_REPLACE_MANY != mMode ) { - checkbox.SetVisible( false ); + checkbox.SetProperty( Actor::Property::VISIBLE, false ); } borderActor.Add( checkbox ); ImageView tick = ImageView::New( SELECTED_IMAGE ); - tick.SetName( "Tick" ); + tick.SetProperty( Dali::Actor::Property::NAME, "Tick" ); tick.SetColorMode( USE_PARENT_COLOR ); - tick.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - tick.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + tick.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + tick.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); tick.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f ); tick.SetZ( 0.2f ); - tick.SetVisible( false ); + tick.SetProperty( Actor::Property::VISIBLE, false ); checkbox.Add( tick ); // Connect new items for various editing modes diff --git a/examples/line-mesh/line-mesh-example.cpp b/examples/line-mesh/line-mesh-example.cpp index 24d1504..6dc82ff 100644 --- a/examples/line-mesh/line-mesh-example.cpp +++ b/examples/line-mesh/line-mesh-example.cpp @@ -200,8 +200,8 @@ public: 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); @@ -222,8 +222,8 @@ 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 ); @@ -248,8 +248,8 @@ public: .Add( Toolkit::TextVisual::Property::TEXT_COLOR, Vector4( 0.8f, 0.8f, 0.8f, 1.0f ) ) ); - radio.SetParentOrigin( ParentOrigin::TOP_LEFT ); - radio.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + 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; @@ -258,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.SetProperty( Toolkit::Button::Property::LABEL, "<<" ); - mMinusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mMinusButton.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + 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.SetProperty( Toolkit::Button::Property::LABEL, ">>" ); - mPlusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mPlusButton.SetAnchorPoint( AnchorPoint::CENTER_RIGHT ); + 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; diff --git a/examples/magnifier/magnifier-example.cpp b/examples/magnifier/magnifier-example.cpp index d319540..dca210d 100644 --- a/examples/magnifier/magnifier-example.cpp +++ b/examples/magnifier/magnifier-example.cpp @@ -213,13 +213,13 @@ public: TOOLBAR_IMAGE, APPLICATION_TITLE ); - mContent.SetLeaveRequired(true); + mContent.SetProperty( Actor::Property::LEAVE_REQUIRED,true); mContent.TouchSignal().Connect( this, &ExampleController::OnTouched ); // Create magnifier (controlled by human touch) Layer overlay = Layer::New(); - overlay.SetSensitive(false); - overlay.SetParentOrigin( ParentOrigin::CENTER ); + overlay.SetProperty( Actor::Property::SENSITIVE,false); + overlay.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); overlay.SetSize(mStageSize); Stage::GetCurrent().Add(overlay); diff --git a/examples/mesh-morph/mesh-morph-example.cpp b/examples/mesh-morph/mesh-morph-example.cpp index 4fa17bb..aa18a4d 100644 --- a/examples/mesh-morph/mesh-morph-example.cpp +++ b/examples/mesh-morph/mesh-morph-example.cpp @@ -302,8 +302,8 @@ public: 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(10); diff --git a/examples/mesh-visual/mesh-visual-example.cpp b/examples/mesh-visual/mesh-visual-example.cpp index 4a039df..37d5450 100644 --- a/examples/mesh-visual/mesh-visual-example.cpp +++ b/examples/mesh-visual/mesh-visual-example.cpp @@ -132,13 +132,13 @@ public: //Main, central model mContainers[0].SetSizeModeFactor( Vector3( MODEL_SCALE, MODEL_SCALE, 0.0f ) ); - mContainers[0].SetParentOrigin( ParentOrigin::CENTER ); - mContainers[0].SetAnchorPoint( AnchorPoint::CENTER ); + mContainers[0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mContainers[0].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); //Top left model mContainers[1].SetSizeModeFactor( Vector3( MODEL_SCALE / 3.0f, MODEL_SCALE / 3.0f, 0.0f ) ); - mContainers[1].SetParentOrigin( Vector3( 0.05, 0.03, 0.5 ) ); //Offset from top left - mContainers[1].SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mContainers[1].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.05, 0.03, 0.5 ) ); //Offset from top left + mContainers[1].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); //Set up models for( int i = 0; i < NUM_MESHES; i++ ) @@ -146,8 +146,8 @@ public: //Create control to display model Control control = Control::New(); control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - control.SetParentOrigin( ParentOrigin::CENTER ); - control.SetAnchorPoint( AnchorPoint::CENTER ); + control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mContainers[i].Add( control ); //Make model spin to demonstrate 3D @@ -174,16 +174,16 @@ public: { //Actor for positioning model and shading mode buttons. Actor positionActorModel = Actor::New(); - positionActorModel.SetParentOrigin( Vector3( BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); - positionActorModel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + positionActorModel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); + positionActorModel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); layer.Add( positionActorModel ); //Create button for model changing. PushButton modelButton = Toolkit::PushButton::New(); modelButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); modelButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeModelClicked ); - modelButton.SetParentOrigin( ParentOrigin::TOP_CENTER ); - modelButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + modelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + modelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); modelButton.SetProperty( Toolkit::Button::Property::LABEL, "Model" ); positionActorModel.Add( modelButton ); @@ -191,8 +191,8 @@ public: PushButton shadingModeButton = Toolkit::PushButton::New(); shadingModeButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); shadingModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeShadingModeClicked ); - shadingModeButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - shadingModeButton.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + shadingModeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + shadingModeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); shadingModeButton.SetProperty( Toolkit::Button::Property::LABEL, "Shading Mode" ); positionActorModel.Add( shadingModeButton ); @@ -200,31 +200,31 @@ public: TextLabel changeTitleLabel = TextLabel::New( "Change" ); changeTitleLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); changeTitleLabel.SetProperty( TextLabel::Property::UNDERLINE, "{\"thickness\":\"2.0\"}" ); - changeTitleLabel.SetParentOrigin( ParentOrigin::TOP_CENTER ); - changeTitleLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + changeTitleLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + changeTitleLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); modelButton.Add( changeTitleLabel ); //Create button for pausing animations. PushButton pauseButton = Toolkit::PushButton::New(); pauseButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); pauseButton.ClickedSignal().Connect( this, &MeshVisualController::OnPauseClicked ); - pauseButton.SetParentOrigin( Vector3( 0.5, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); - pauseButton.SetAnchorPoint( AnchorPoint::CENTER ); + pauseButton.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); + pauseButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); pauseButton.SetProperty( Toolkit::Button::Property::LABEL, PAUSE ); layer.Add( pauseButton ); //Actor for positioning light position buttons. Actor positionActorLight = Actor::New(); - positionActorLight.SetParentOrigin( Vector3( 1.0 - BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); - positionActorLight.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + positionActorLight.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 1.0 - BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); + positionActorLight.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); layer.Add( positionActorLight ); //Create button for switching between manual and fixed light position. PushButton lightModeButton = Toolkit::PushButton::New(); lightModeButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); lightModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightModeClicked ); - lightModeButton.SetParentOrigin( ParentOrigin::TOP_CENTER ); - lightModeButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + lightModeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + lightModeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); lightModeButton.SetProperty( Toolkit::Button::Property::LABEL, FIXED ); positionActorLight.Add( lightModeButton ); @@ -232,8 +232,8 @@ public: PushButton lightSideButton = Toolkit::PushButton::New(); lightSideButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); lightSideButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightSideClicked ); - lightSideButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - lightSideButton.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + lightSideButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + lightSideButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); lightSideButton.SetProperty( Toolkit::Button::Property::LABEL, FRONT ); positionActorLight.Add( lightSideButton ); @@ -241,8 +241,8 @@ public: TextLabel lightTitleLabel = TextLabel::New( "Light Position" ); lightTitleLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); lightTitleLabel.SetProperty( TextLabel::Property::UNDERLINE, "{\"thickness\":\"2.0\"}" ); - lightTitleLabel.SetParentOrigin( ParentOrigin::TOP_CENTER ); - lightTitleLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + lightTitleLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + lightTitleLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); lightModeButton.Add( lightTitleLabel ); } @@ -271,8 +271,8 @@ public: } //Set position relative to top left, as the light source property is also relative to the top left. - mLightSource.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mLightSource.SetAnchorPoint( AnchorPoint::CENTER ); + mLightSource.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mLightSource.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLightSource.SetPosition( Stage::GetCurrent().GetSize().x * 0.85f, Stage::GetCurrent().GetSize().y * 0.125 ); //Supply an image to represent the light. @@ -284,8 +284,8 @@ public: //Place the light source on a layer above the base, so that it is rendered above everything else. Layer upperLayer = Layer::New(); upperLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - upperLayer.SetParentOrigin( ParentOrigin::CENTER ); - upperLayer.SetAnchorPoint( AnchorPoint::CENTER ); + upperLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + upperLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); baseLayer.Add( upperLayer ); upperLayer.Add( mLightSource ); @@ -352,7 +352,7 @@ public: void UseFixedLight() { //Hide draggable source - mLightSource.SetVisible( false ); + mLightSource.SetProperty( Actor::Property::VISIBLE, false ); //Use stage dimensions to place light at center, offset in z axis. Stage stage = Stage::GetCurrent(); @@ -372,7 +372,7 @@ public: void UseManualLight() { //Show draggable source - mLightSource.SetVisible( true ); + mLightSource.SetProperty( Actor::Property::VISIBLE, true ); //Update to switch light position of models to that of the source. UpdateLight(); @@ -382,7 +382,7 @@ public: void UpdateLight() { //Set light position to the x and y of the light control, offset into/out of the screen. - Vector3 controlPosition = mLightSource.GetCurrentPosition(); + Vector3 controlPosition = mLightSource.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ); Vector3 lightPosition = Vector3( controlPosition.x, controlPosition.y, ( mLightFront ? 1 : -1 ) * Stage::GetCurrent().GetSize().x / 2.0f ); diff --git a/examples/metaball-explosion/metaball-explosion-example.cpp b/examples/metaball-explosion/metaball-explosion-example.cpp index d5332d7..1e65c5f 100644 --- a/examples/metaball-explosion/metaball-explosion-example.cpp +++ b/examples/metaball-explosion/metaball-explosion-example.cpp @@ -443,9 +443,9 @@ void MetaballExplosionController::CreateMetaballActors() mMetaballs[i].radius = mMetaballs[i].initRadius = Random::Range(0.05f,0.07f); mMetaballs[i].actor = Actor::New( ); - mMetaballs[i].actor.SetName( "Metaball" ); + mMetaballs[i].actor.SetProperty( Dali::Actor::Property::NAME, "Metaball" ); mMetaballs[i].actor.SetScale( 1.0f ); - mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER ); + mMetaballs[i].actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mMetaballs[i].actor.AddRenderer( renderer ); mMetaballs[i].positionIndex = mMetaballs[i].actor.RegisterProperty( "uPositionMetaball", mMetaballs[i].position ); @@ -459,7 +459,7 @@ void MetaballExplosionController::CreateMetaballActors() // Root creation mMetaballRoot = Actor::New(); - mMetaballRoot.SetParentOrigin( ParentOrigin::CENTER ); + mMetaballRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); for( uint32_t i = 0; i < METABALL_NUMBER; i++ ) { mMetaballRoot.Add( mMetaballs[i].actor ); @@ -505,7 +505,7 @@ void MetaballExplosionController::CreateComposition() // Create actor mCompositionActor = Actor::New( ); - mCompositionActor.SetParentOrigin(ParentOrigin::CENTER); + mCompositionActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mCompositionActor.SetPosition(Vector3(0.0f, 0.0f, 0.0f)); mCompositionActor.SetSize(mScreenSize.x, mScreenSize.y); mCompositionActor.AddRenderer( mRenderer ); diff --git a/examples/metaball-refrac/metaball-refrac-example.cpp b/examples/metaball-refrac/metaball-refrac-example.cpp index b73c6b9..5646e0a 100644 --- a/examples/metaball-refrac/metaball-refrac-example.cpp +++ b/examples/metaball-refrac/metaball-refrac-example.cpp @@ -422,9 +422,9 @@ void MetaballRefracController::CreateMetaballActors() mMetaballs[i].position = Vector2(0.0f, 0.0f); mMetaballs[i].actor = Actor::New(); - mMetaballs[i].actor.SetName( "Metaball" ); + mMetaballs[i].actor.SetProperty( Dali::Actor::Property::NAME, "Metaball" ); mMetaballs[i].actor.SetScale( 1.0f ); - mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER ); + mMetaballs[i].actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mMetaballs[i].actor.AddRenderer( renderer ); @@ -439,7 +439,7 @@ void MetaballRefracController::CreateMetaballActors() //Root creation mMetaballRoot = Actor::New(); - mMetaballRoot.SetParentOrigin( ParentOrigin::CENTER ); + mMetaballRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); for( uint32_t i = 0 ; i < METABALL_NUMBER ; i++ ) { mMetaballRoot.Add( mMetaballs[i].actor ); @@ -484,7 +484,7 @@ void MetaballRefracController::CreateComposition() // Create actor mCompositionActor = Actor::New( ); - mCompositionActor.SetParentOrigin(ParentOrigin::CENTER); + mCompositionActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mCompositionActor.SetPosition(Vector3(0.0f, 0.0f, 0.0f)); mCompositionActor.SetSize(mScreenSize.x, mScreenSize.y); diff --git a/examples/model3d-view/model3d-view-example.cpp b/examples/model3d-view/model3d-view-example.cpp index 865c8ed..522d7e9 100644 --- a/examples/model3d-view/model3d-view-example.cpp +++ b/examples/model3d-view/model3d-view-example.cpp @@ -86,16 +86,16 @@ public: //Add background Toolkit::ImageView backView = Toolkit::ImageView::New( BACKGROUND_IMAGE ); - backView.SetParentOrigin( ParentOrigin::CENTER ); - backView.SetAnchorPoint( AnchorPoint::CENTER ); + backView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + backView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); stage.Add( backView ); mModelCounter = 0; mModel3dView = Model3dView::New( MODEL_FILE[0], MATERIAL_FILE[0], IMAGE_PATH ); - mModel3dView.SetParentOrigin( ParentOrigin::CENTER ); - mModel3dView.SetAnchorPoint( AnchorPoint::CENTER ); - mModel3dView.SetName( "model3dViewControl" ); + mModel3dView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mModel3dView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mModel3dView.SetProperty( Dali::Actor::Property::NAME, "model3dViewControl" ); mModel3dView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); mModel3dView.SetSize(screenSize); @@ -107,16 +107,16 @@ public: mButtonLayer = Layer::New(); mButtonLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mButtonLayer.SetParentOrigin( ParentOrigin::CENTER ); - mButtonLayer.SetAnchorPoint( AnchorPoint::CENTER ); + mButtonLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mButtonLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); stage.Add(mButtonLayer); // Create button for model changing Toolkit::PushButton editButton = Toolkit::PushButton::New(); editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeModelClicked); - editButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); - editButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Model" ); mButtonLayer.Add( editButton ); @@ -124,8 +124,8 @@ public: editButton = Toolkit::PushButton::New(); editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeLightingClicked); - editButton.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - editButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Shader" ); mButtonLayer.Add( editButton ); @@ -133,8 +133,8 @@ public: editButton = Toolkit::PushButton::New(); editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); editButton.ClickedSignal().Connect( this, &Model3dViewController::OnPauseAnimationsClicked); - editButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - editButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); editButton.SetProperty( Toolkit::Button::Property::LABEL, "Pause Animations" ); mButtonLayer.Add( editButton ); diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index 6972cf3..3f0d052 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -179,7 +179,7 @@ public: layoutButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE ); layoutButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED ); layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked); - layoutButton.SetLeaveRequired( true ); + layoutButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Input @@ -209,7 +209,7 @@ public: mMotionBlurEffect = CreateMotionBlurEffect(); mMotionBlurImageView = ImageView::New(); SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y ); - mMotionBlurImageView.SetParentOrigin( ParentOrigin::CENTER ); + mMotionBlurImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mMotionBlurImageView.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y); mContentLayer.Add( mMotionBlurImageView ); diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index 3557005..63787f9 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -158,7 +158,7 @@ public: layoutButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE ); layoutButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED ); layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked); - layoutButton.SetLeaveRequired( true ); + layoutButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Input @@ -185,8 +185,8 @@ public: mMotionStretchEffect["url"] = MOTION_STRETCH_ACTOR_IMAGE1; mMotionStretchImageView = ImageView::New(); mMotionStretchImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionStretchEffect ); - mMotionStretchImageView.SetParentOrigin( ParentOrigin::CENTER ); - mMotionStretchImageView.SetAnchorPoint( AnchorPoint::CENTER ); + mMotionStretchImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mMotionStretchImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mMotionStretchImageView.SetSize( MOTION_STRETCH_ACTOR_WIDTH, MOTION_STRETCH_ACTOR_HEIGHT ); mContentLayer.Add( mMotionStretchImageView ); diff --git a/examples/native-image-source/native-image-source-example.cpp b/examples/native-image-source/native-image-source-example.cpp index d8271eb..d4865cf 100644 --- a/examples/native-image-source/native-image-source-example.cpp +++ b/examples/native-image-source/native-image-source-example.cpp @@ -147,15 +147,15 @@ public: mButtonArea = Layer::New(); mButtonArea.SetSize( stageSize.x, BUTTON_HEIGHT ); - mButtonArea.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mButtonArea.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mButtonArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mButtonArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); stage.Add( mButtonArea ); mButtonShow = PushButton::New(); mButtonShow.SetProperty( Button::Property::TOGGLABLE, true ); mButtonShow.SetProperty( Toolkit::Button::Property::LABEL, "SHOW" ); - mButtonShow.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mButtonShow.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mButtonShow.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mButtonShow.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mButtonShow.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT ); mButtonShow.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); mButtonArea.Add( mButtonShow ); @@ -163,8 +163,8 @@ public: mButtonRefreshAlways = PushButton::New(); mButtonRefreshAlways.SetProperty( Button::Property::TOGGLABLE, true ); mButtonRefreshAlways.SetProperty( Toolkit::Button::Property::LABEL, "ALWAYS" ); - mButtonRefreshAlways.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mButtonRefreshAlways.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mButtonRefreshAlways.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mButtonRefreshAlways.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mButtonRefreshAlways.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT ); mButtonRefreshAlways.SetPosition( (stageSize.x / BUTTON_COUNT)*1.0f, 0.0f ); mButtonRefreshAlways.StateChangedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); @@ -172,8 +172,8 @@ public: mButtonRefreshOnce = PushButton::New(); mButtonRefreshOnce.SetProperty( Toolkit::Button::Property::LABEL, "ONCE" ); - mButtonRefreshOnce.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mButtonRefreshOnce.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mButtonRefreshOnce.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mButtonRefreshOnce.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mButtonRefreshOnce.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT ); mButtonRefreshOnce.SetPosition( (stageSize.x / BUTTON_COUNT)*2.0f, 0.0f ); mButtonRefreshOnce.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); @@ -181,8 +181,8 @@ public: mButtonCapture = PushButton::New(); mButtonCapture.SetProperty( Toolkit::Button::Property::LABEL, "CAPTURE" ); - mButtonCapture.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mButtonCapture.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mButtonCapture.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mButtonCapture.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mButtonCapture.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT ); mButtonCapture.SetPosition( (stageSize.x / BUTTON_COUNT)*3.0f, 0.0f ); mButtonCapture.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); @@ -190,8 +190,8 @@ public: mButtonReset = PushButton::New(); mButtonReset.SetProperty( Toolkit::Button::Property::LABEL, "RESET" ); - mButtonReset.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mButtonReset.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mButtonReset.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mButtonReset.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mButtonReset.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT ); mButtonReset.SetPosition( (stageSize.x / BUTTON_COUNT)*4.0f, 0.0f ); mButtonReset.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); @@ -207,20 +207,20 @@ public: mTopContentArea = Actor::New(); mTopContentArea.SetSize( stageSize.x, contentHeight ); - mTopContentArea.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mTopContentArea.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mTopContentArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mTopContentArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mTopContentArea.SetY( BUTTON_HEIGHT ); stage.Add( mTopContentArea ); mBottomContentArea = Actor::New(); mBottomContentArea.SetSize( stageSize.x, contentHeight ); - mBottomContentArea.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mBottomContentArea.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mBottomContentArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mBottomContentArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); stage.Add( mBottomContentArea ); mSourceActor = ImageView::New(JPG_FILENAME); - mSourceActor.SetParentOrigin( ParentOrigin::CENTER); - mSourceActor.SetAnchorPoint( AnchorPoint::CENTER ); + mSourceActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + mSourceActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mTopContentArea.Add( mSourceActor ); Animation animation = Animation::New(2.f); @@ -234,15 +234,15 @@ public: animation.Play(); TextLabel textLabel1 = TextLabel::New( "Image" ); - textLabel1.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - textLabel1.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + textLabel1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + textLabel1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mTopContentArea.Add( textLabel1 ); // Wait until button press before creating mOffscreenRenderTask TextLabel textLabel2 = TextLabel::New( "Native Image" ); - textLabel2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - textLabel2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + textLabel2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + textLabel2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mBottomContentArea.Add( textLabel2 ); } @@ -263,8 +263,8 @@ public: mFrameBuffer.AttachColorTexture( mNativeTexture ); mCameraActor = CameraActor::New( imageSize ); - mCameraActor.SetParentOrigin( ParentOrigin::CENTER ); - mCameraActor.SetParentOrigin( AnchorPoint::CENTER ); + mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, AnchorPoint::CENTER ); mTopContentArea.Add( mCameraActor ); RenderTaskList taskList = stage.GetRenderTaskList(); @@ -297,8 +297,8 @@ public: SetupNativeImage(); mDisplayActor = Actor::New(); - mDisplayActor.SetParentOrigin( ParentOrigin::CENTER ); - mDisplayActor.SetAnchorPoint( AnchorPoint::CENTER ); + mDisplayActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mDisplayActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Geometry geometry = DemoHelper::CreateTexturedQuad(); diff --git a/examples/page-turn-view/page-turn-view-example.cpp b/examples/page-turn-view/page-turn-view-example.cpp index a8e53e5..c6c99a8 100644 --- a/examples/page-turn-view/page-turn-view-example.cpp +++ b/examples/page-turn-view/page-turn-view-example.cpp @@ -235,7 +235,7 @@ void PageTurnExample::Rotate( DemoOrientation orientation ) if( !mPageTurnPortraitView ) { mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, stageSize ); - mPageTurnPortraitView.SetParentOrigin( ParentOrigin::CENTER ); + mPageTurnPortraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); } if( mPageTurnLandscapeView ) @@ -249,7 +249,7 @@ void PageTurnExample::Rotate( DemoOrientation orientation ) if( !mPageTurnLandscapeView ) { mPageTurnLandscapeView = PageTurnLandscapeView::New( mLandscapePageFactory, Vector2(stageSize.x*0.5f, stageSize.y) ); - mPageTurnLandscapeView.SetParentOrigin( ParentOrigin::CENTER ); + mPageTurnLandscapeView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); } if( mPageTurnPortraitView ) diff --git a/examples/perf-scroll/perf-scroll.cpp b/examples/perf-scroll/perf-scroll.cpp index 43ac252..c961ae3 100644 --- a/examples/perf-scroll/perf-scroll.cpp +++ b/examples/perf-scroll/perf-scroll.cpp @@ -246,7 +246,7 @@ public: stage.KeyEventSignal().Connect( this, &PerfScroll::OnKeyEvent ); mParent = Actor::New(); - mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); stage.Add(mParent); if( gUseMesh ) diff --git a/examples/pivot/pivot-example.cpp b/examples/pivot/pivot-example.cpp index fe62dcf..af2b8d3 100644 --- a/examples/pivot/pivot-example.cpp +++ b/examples/pivot/pivot-example.cpp @@ -71,8 +71,8 @@ private: // Create a table view. TableView tableView = TableView::New( TABLE_VIEW_ROWS, TABLE_VIEW_COLUMNS ); - tableView.SetAnchorPoint( AnchorPoint::CENTER ); - tableView.SetParentOrigin( ParentOrigin::CENTER ); + tableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + tableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); tableView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); tableView.SetSizeModeFactor( TABLE_VIEW_SIZE_MODE_FACTOR ); stage.Add( tableView ); @@ -97,7 +97,7 @@ private: control.SetBackgroundColor( Vector4( Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), 1.0f ) ); control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); control.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); // Ensures the position always uses top-left for its calculations. - control.SetAnchorPoint( anchorPoint ); // This anchor-point is used for the rotation and the scale. + control.SetProperty( Actor::Property::ANCHOR_POINT, anchorPoint ); // This anchor-point is used for the rotation and the scale. // Add to the table-view tableView.AddChild( control, TableView::CellPosition( row, column ) ); diff --git a/examples/point-mesh/point-mesh-example.cpp b/examples/point-mesh/point-mesh-example.cpp index 0313f86..e785ebd 100644 --- a/examples/point-mesh/point-mesh-example.cpp +++ b/examples/point-mesh/point-mesh-example.cpp @@ -176,8 +176,8 @@ public: mRenderer.RegisterProperty( "uPointSize", 80.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(15); diff --git a/examples/popup/popup-example.cpp b/examples/popup/popup-example.cpp index 800317d..7c5e468 100644 --- a/examples/popup/popup-example.cpp +++ b/examples/popup/popup-example.cpp @@ -151,8 +151,8 @@ public: // Add title to the tool bar. mItemView = Toolkit::ItemView::New( *this ); - mItemView.SetParentOrigin( ParentOrigin::CENTER ); - mItemView.SetAnchorPoint( AnchorPoint::CENTER ); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Use a grid layout for tests @@ -334,9 +334,9 @@ public: const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f; Toolkit::Popup popup = Toolkit::Popup::New(); - popup.SetName( "popup" ); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( AnchorPoint::CENTER ); + popup.SetProperty( Dali::Actor::Property::NAME, "popup" ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); popup.SetSize( POPUP_WIDTH_DP, 0.0f ); popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false ); @@ -349,36 +349,36 @@ public: Toolkit::Popup CreateConfirmationPopup( int numberOfButtons ) { Toolkit::Popup confirmationPopup = Toolkit::Popup::New(); - confirmationPopup.SetName( "MAIN-POPUP-SELF" ); + confirmationPopup.SetProperty( Dali::Actor::Property::NAME, "MAIN-POPUP-SELF" ); if( numberOfButtons > 0 ) { // Start with a control area image. Toolkit::ImageView footer = Toolkit::ImageView::New( DEFAULT_CONTROL_AREA_IMAGE_PATH ); - footer.SetName( "controlAreaImage" ); + footer.SetProperty( Dali::Actor::Property::NAME, "controlAreaImage" ); // Set up the container's layout. footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); footer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); footer.SetSize( 0.0f, 130.0f ); - footer.SetAnchorPoint( AnchorPoint::CENTER ); - footer.SetParentOrigin( ParentOrigin::CENTER ); + footer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + footer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Actor okButton = CreateOKButton(); - okButton.SetParentOrigin( ParentOrigin::CENTER ); - okButton.SetAnchorPoint( AnchorPoint::CENTER ); + okButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + okButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); okButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); okButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) ); if( numberOfButtons > 1 ) { Toolkit::TableView controlLayout = Toolkit::TableView::New( 1, 2 ); - controlLayout.SetParentOrigin( ParentOrigin::CENTER ); - controlLayout.SetAnchorPoint( AnchorPoint::CENTER ); + controlLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + controlLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); controlLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Actor cancelButton = CreateCancelButton(); - cancelButton.SetParentOrigin( ParentOrigin::CENTER ); - cancelButton.SetAnchorPoint( AnchorPoint::CENTER ); + cancelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + cancelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); cancelButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); cancelButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) ); @@ -410,7 +410,7 @@ public: Actor CreateTitle( std::string title ) { Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( title ); - titleActor.SetName( "titleActor" ); + titleActor.SetProperty( Dali::Actor::Property::NAME, "titleActor" ); titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); titleActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); @@ -421,7 +421,7 @@ public: Toolkit::PushButton CreateOKButton() { Toolkit::PushButton okayButton = Toolkit::PushButton::New(); - okayButton.SetName( POPUP_CONTROL_OK_NAME ); + okayButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_OK_NAME ); okayButton.SetProperty( Toolkit::Button::Property::LABEL, "OK!" ); okayButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked ); @@ -432,7 +432,7 @@ public: Toolkit::PushButton CreateCancelButton() { Toolkit::PushButton cancelButton = Toolkit::PushButton::New(); - cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME ); + cancelButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_CANCEL_NAME ); cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" ); cancelButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked ); @@ -450,28 +450,28 @@ public: bool OnButtonClicked( Toolkit::Button button ) { // Handle menu items that create popups. - if( button.GetName() == POPUP_BUTTON_TITLE_ID ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_ID ) { mPopup = CreatePopup(); mPopup.SetTitle( CreateTitle( "Popup!" ) ); SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_BUTTONS_1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_BUTTONS_1_ID ) { mPopup = CreateConfirmationPopup( 1 ); mPopup.SetTitle( CreateTitle( "Title" ) ); SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_BUTTONS_2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_BUTTONS_2_ID ) { mPopup = CreateConfirmationPopup( 2 ); mPopup.SetTitle( CreateTitle( "Title" ) ); SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_TOAST_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TOAST_ID ) { // Create a toast popup via the type registry (as it is a named-type). TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "PopupToast" ); @@ -488,13 +488,13 @@ public: } } } - else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_BUTTONS_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_CONTENT_BUTTONS_ID ) { mPopup = CreateConfirmationPopup( 2 ); mPopup.SetTitle( CreateTitle( "Erase image" ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "This will erase the image permanently. Are you sure?" ); - text.SetName( "POPUP_CONTENT_TEXT" ); + text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); @@ -504,12 +504,12 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_TEXT_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_TEXT_ID ) { mPopup = CreatePopup(); TextLabel text = TextLabel::New( CONTENT_TEXT ); - text.SetName( "POPUP_CONTENT_TEXT" ); + text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetProperty( TextLabel::Property::MULTI_LINE, true ); text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); @@ -522,7 +522,7 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_ID ) { mPopup = CreatePopup(); Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 ); @@ -534,13 +534,13 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID ) { mPopup = CreatePopup(); mPopup.SetTitle( CreateTitle( "Popup!" ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT ); - text.SetName( "POPUP_CONTENT_TEXT" ); + text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetProperty( TextLabel::Property::MULTI_LINE, true ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); @@ -551,13 +551,13 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_FIXED_SIZE_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_FIXED_SIZE_ID ) { mPopup = CreatePopup(); mPopup.SetTitle( CreateTitle( "Popup!" ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed size popup" ); - text.SetName( "POPUP_CONTENT_TEXT" ); + text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetProperty( TextLabel::Property::MULTI_LINE, true ); text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) ); @@ -570,13 +570,13 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID ) { mPopup = CreateConfirmationPopup( 2 ); mPopup.SetTitle( CreateTitle( "Popup!" ) ); Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT ); - text.SetName( "POPUP_CONTENT_TEXT" ); + text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); @@ -587,14 +587,14 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_COMPLEX_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_COMPLEX_ID ) { mPopup = CreateConfirmationPopup( 2 ); mPopup.SetTitle( CreateTitle( "Warning" ) ); // Content Toolkit::TableView content = Toolkit::TableView::New( 2, 2 ); - content.SetName( "COMPLEX_TABLEVIEW" ); + content.SetProperty( Dali::Actor::Property::NAME, "COMPLEX_TABLEVIEW" ); content.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); content.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); content.SetFitHeight( 0 ); @@ -615,7 +615,7 @@ public: // Image { Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE1 ); - image.SetName( "COMPLEX_IMAGE" ); + image.SetProperty( Dali::Actor::Property::NAME, "COMPLEX_IMAGE" ); image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) ); @@ -649,12 +649,12 @@ public: SetupPopup( mPopup, button ); } - else if( button.GetName() == POPUP_BUTTON_CUSTOM_STYLE ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CUSTOM_STYLE ) { mPopup = CreateConfirmationPopup( 2 ); Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Styled Popup" ); - titleActor.SetName( "titleActor" ); + titleActor.SetProperty( Dali::Actor::Property::NAME, "titleActor" ); titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::RED ); titleActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); @@ -701,7 +701,7 @@ public: // From ItemFactory virtual Actor NewItem(unsigned int itemId) { Toolkit::PushButton popupButton = Toolkit::PushButton::New(); - popupButton.SetName( POPUP_BUTTON_ITEMS[ itemId ].name ); + popupButton.SetProperty( Dali::Actor::Property::NAME, POPUP_BUTTON_ITEMS[ itemId ].name ); popupButton.SetProperty( Toolkit::Button::Property::LABEL, POPUP_BUTTON_ITEMS[ itemId ].text ); popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); diff --git a/examples/pre-render-callback/pre-render-callback-example.cpp b/examples/pre-render-callback/pre-render-callback-example.cpp index bf5173a..e389c51 100644 --- a/examples/pre-render-callback/pre-render-callback-example.cpp +++ b/examples/pre-render-callback/pre-render-callback-example.cpp @@ -32,8 +32,8 @@ const float TEXT_HEIGHT = 40.0f; void AddText( Control textContainer, std::string text, unsigned int yIndex ) { auto label = TextLabel::New(text); - label.SetParentOrigin( ParentOrigin::TOP_CENTER ); - label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); label.SetSize( 300,TEXT_HEIGHT ); label.SetY( yIndex*TEXT_HEIGHT ); textContainer.Add( label ); @@ -104,7 +104,7 @@ private: CreateAnimatingScene(); auto textContainer = Control::New(); - textContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT); + textContainer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); AddText(textContainer, "Click to add callback", 1 ); AddText(textContainer, "Press 1 to add callback", 2 ); AddText(textContainer, "Press 2 to clear callback", 3 ); @@ -112,8 +112,8 @@ private: mSpinner = TextLabel::New(""); - mSpinner.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - mSpinner.SetParentOrigin( ParentOrigin::TOP_LEFT ); + mSpinner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + mSpinner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); mSpinner.SetSize(100,100); mStage.Add(mSpinner); @@ -126,7 +126,7 @@ private: { mSceneActor = Layer::New(); mSceneActor.SetBehavior( Layer::LAYER_3D ); - mSceneActor.SetParentOrigin(ParentOrigin::CENTER); + mSceneActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); // Create and add images to the scene actor: mImageActor1 = ImageView::New( SCENE_IMAGE_1 ); @@ -137,13 +137,13 @@ private: mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mImageActor3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - mImageActor2.SetParentOrigin(ParentOrigin::CENTER); + mImageActor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - mImageActor1.SetParentOrigin(ParentOrigin::CENTER_LEFT); - mImageActor1.SetAnchorPoint(AnchorPoint::CENTER_RIGHT); + mImageActor1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_LEFT); + mImageActor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_RIGHT); - mImageActor3.SetParentOrigin(ParentOrigin::CENTER_RIGHT); - mImageActor3.SetAnchorPoint(AnchorPoint::CENTER_LEFT); + mImageActor3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_RIGHT); + mImageActor3.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_LEFT); mSceneActor.Add(mImageActor2); mImageActor2.Add(mImageActor1); diff --git a/examples/primitive-shapes/primitive-shapes-example.cpp b/examples/primitive-shapes/primitive-shapes-example.cpp index e39fcb6..f7e9350 100644 --- a/examples/primitive-shapes/primitive-shapes-example.cpp +++ b/examples/primitive-shapes/primitive-shapes-example.cpp @@ -91,8 +91,8 @@ public: //Set up layer to place UI on. Layer layer = Layer::New(); - layer.SetParentOrigin( ParentOrigin::CENTER ); - layer.SetAnchorPoint( AnchorPoint::CENTER ); + layer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + layer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); layer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); layer.SetBehavior( Layer::LAYER_UI ); //We use a 2D layer as this is closer to UI work than full 3D scene creation. layer.SetDepthTestDisabled( false ); //Enable depth testing, as otherwise the 2D layer would not do so. @@ -152,24 +152,24 @@ public: //Used to layout the title and the buttons below it. Control topAlignment = Control::New(); - topAlignment.SetParentOrigin( ParentOrigin::TOP_CENTER ); - topAlignment.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + topAlignment.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + topAlignment.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); topAlignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); topAlignment.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); layer.Add( topAlignment ); //Add a title to indicate the currently selected shape. mShapeTitle = TextLabel::New( "DEFAULT" ); - mShapeTitle.SetParentOrigin( ParentOrigin::CENTER ); - mShapeTitle.SetAnchorPoint( AnchorPoint::CENTER ); + mShapeTitle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mShapeTitle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mShapeTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mShapeTitle.SetPadding( Padding( elementPadding, elementPadding, elementPadding, elementPadding ) ); topAlignment.Add( mShapeTitle ); //Create a variable-length container that can wrap buttons around as more are added. FlexContainer buttonContainer = FlexContainer::New(); - buttonContainer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - buttonContainer.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + buttonContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + buttonContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); buttonContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); buttonContainer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); buttonContainer.SetPadding( Padding( containerPadding, containerPadding, containerPadding, containerPadding ) ); @@ -181,8 +181,8 @@ public: for( int modelNumber = 0; modelNumber < NUM_MODELS; modelNumber++ ) { PushButton button = Toolkit::PushButton::New(); - button.SetParentOrigin( ParentOrigin::CENTER ); - button.SetAnchorPoint( AnchorPoint::CENTER ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); button.SetPadding( Padding( elementPadding, elementPadding, elementPadding, elementPadding ) ); button.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_IMAGE_URL[modelNumber] ); @@ -232,8 +232,8 @@ public: { //Create table to hold sliders and their corresponding labels. mSliderTable = Toolkit::TableView::New( MAX_PROPERTIES, 2 ); - mSliderTable.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mSliderTable.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mSliderTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mSliderTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mSliderTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); mSliderTable.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) ); //90% of width, 30% of height. mSliderTable.SetFitWidth( 0 ); //Label column should fit to natural size of label. @@ -246,8 +246,8 @@ public: { //Create slider Slider slider = Slider::New(); - slider.SetParentOrigin( ParentOrigin::CENTER ); - slider.SetAnchorPoint( AnchorPoint::CENTER ); + slider.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + slider.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); slider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); slider.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); slider.ValueChangedSignal().Connect( this, &PrimitiveShapesController::OnSliderValueChanged ); @@ -259,8 +259,8 @@ public: //Create slider label TextLabel sliderLabel = TextLabel::New(); - sliderLabel.SetParentOrigin( ParentOrigin::CENTER ); - sliderLabel.SetAnchorPoint( AnchorPoint::CENTER ); + sliderLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + sliderLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mSliderLabels.push_back( sliderLabel ); @@ -309,14 +309,14 @@ public: Actor container = Actor::New(); container.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); container.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) ); //90% of width, 30% of height. - container.SetParentOrigin( ParentOrigin::CENTER ); - container.SetAnchorPoint( AnchorPoint::CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); layer.Add( container ); //Create control to display the 3D primitive. mModel = Control::New(); - mModel.SetParentOrigin( ParentOrigin::CENTER ); - mModel.SetAnchorPoint( AnchorPoint::CENTER); + mModel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mModel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); mModel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); container.Add( mModel ); @@ -343,9 +343,9 @@ public: for( unsigned i = 0; i < mSliders.size(); i++ ) { mSliders.at( i ).SetProperty( Slider::Property::MARKS, Property::Value( 0 ) ); //Remove marks - mSliders.at( i ).SetVisible( false ); + mSliders.at( i ).SetProperty( Actor::Property::VISIBLE, false ); mSliderLabels.at( i ).SetProperty( TextLabel::Property::TEXT, Property::Value( "Default" ) ); - mSliderLabels.at( i ).SetVisible( false ); + mSliderLabels.at( i ).SetProperty( Actor::Property::VISIBLE, false ); } //Visual map for model @@ -534,21 +534,21 @@ public: mSliders.at( sliderIndex ).SetProperty( Slider::Property::LOWER_BOUND, Property::Value( lowerBound ) ); mSliders.at( sliderIndex ).SetProperty( Slider::Property::UPPER_BOUND, Property::Value( upperBound ) ); mSliders.at( sliderIndex ).SetProperty( Slider::Property::VALUE, Property::Value( startPoint ) ); - mSliders.at( sliderIndex ).SetVisible( true ); + mSliders.at( sliderIndex ).SetProperty( Actor::Property::VISIBLE, true ); //Label the slider with the property. //We reset the TextLabel to force a relayout of the table. mSliderTable.RemoveChildAt( TableView::CellPosition(sliderIndex, 0) ); TextLabel sliderLabel = TextLabel::New( visualPropertyLabel ); - sliderLabel.SetParentOrigin( ParentOrigin::CENTER ); - sliderLabel.SetAnchorPoint( AnchorPoint::CENTER ); + sliderLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + sliderLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mSliderTable.AddChild( sliderLabel, TableView::CellPosition( sliderIndex, 0 ) ); mSliderTable.SetCellAlignment( TableView::CellPosition( sliderIndex, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); - mSliderLabels.at( sliderIndex ).SetVisible( true ); + mSliderLabels.at( sliderIndex ).SetProperty( Actor::Property::VISIBLE, true ); mSliderLabels.at( sliderIndex) = sliderLabel; } diff --git a/examples/progress-bar/progress-bar-example.cpp b/examples/progress-bar/progress-bar-example.cpp index 049b559..038e87b 100644 --- a/examples/progress-bar/progress-bar-example.cpp +++ b/examples/progress-bar/progress-bar-example.cpp @@ -77,8 +77,8 @@ private: TOOLBAR_TITLE ); mProgressBarDefault = ProgressBar::New(); - mProgressBarDefault.SetParentOrigin(ParentOrigin::TOP_CENTER); - mProgressBarDefault.SetAnchorPoint(AnchorPoint::TOP_CENTER); + mProgressBarDefault.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_CENTER); + mProgressBarDefault.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mProgressBarDefault.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH); mProgressBarDefault.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT); mProgressBarDefault.ValueChangedSignal().Connect( this, &ProgressBarExample::OnValueChanged ); @@ -86,8 +86,8 @@ private: Toolkit::TableView contentTable = Toolkit::TableView::New(2, 1); contentTable.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH); contentTable.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT); - contentTable.SetAnchorPoint(AnchorPoint::TOP_LEFT); - contentTable.SetParentOrigin(ParentOrigin::TOP_LEFT); + contentTable.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + contentTable.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); contentTable.SetCellPadding(Size(MARGIN_SIZE, MARGIN_SIZE * 0.5f)); for( unsigned int i = 0; i < contentTable.GetRows(); ++i ) diff --git a/examples/ray-marching/ray-marching-example.cpp b/examples/ray-marching/ray-marching-example.cpp index 2a7b959..39f97df 100644 --- a/examples/ray-marching/ray-marching-example.cpp +++ b/examples/ray-marching/ray-marching-example.cpp @@ -214,8 +214,8 @@ public: Actor actor = Actor::New(); actor.AddRenderer( renderer ); - actor.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - actor.SetParentOrigin( Dali::ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); actor.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); mContentLayer.Add( actor ); diff --git a/examples/reflection-demo/reflection-example.cpp b/examples/reflection-demo/reflection-example.cpp index 3bf189f..7c5fadc 100644 --- a/examples/reflection-demo/reflection-example.cpp +++ b/examples/reflection-demo/reflection-example.cpp @@ -195,8 +195,8 @@ private: mLayer3D.SetSize( stageWidth, stageHeight ); stage.Add(mLayer3D); - mLayer3D.SetAnchorPoint( AnchorPoint::CENTER ); - mLayer3D.SetParentOrigin( ParentOrigin::CENTER ); + mLayer3D.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mLayer3D.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mLayer3D.SetBehavior( Layer::LAYER_3D ); mLayer3D.SetDepthTestDisabled( false ); @@ -302,8 +302,8 @@ private: Actor panScreen = Actor::New(); auto stageSize = stage.GetSize(); panScreen.SetSize( stageSize.width, stageSize.height ); - panScreen.SetAnchorPoint( AnchorPoint::CENTER ); - panScreen.SetParentOrigin( ParentOrigin::CENTER ); + panScreen.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + panScreen.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); auto camera2d = stage.GetRenderTaskList().GetTask(0).GetCameraActor(); panScreen.SetPosition( 0, 0, camera2d.GetNearClippingPlane() ); camera2d.Add(panScreen); @@ -331,9 +331,9 @@ private: auto actor = node.cameraId != 0xffffffff ? CameraActor::New( stage.GetSize() ) : Actor::New(); actor.SetSize( 1, 1, 1 ); - actor.SetName( node.name ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Dali::Actor::Property::NAME, node.name ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actor.SetPosition( node.translation[0], node.translation[1], node.translation[2] ); actor.SetScale( node.scale[0], node.scale[1], node.scale[2] ); actor.SetOrientation( Quaternion(node.rotationQuaternion[3], @@ -388,8 +388,8 @@ private: cameraActor.SetFieldOfView( camera->yfov ); cameraActor.SetProperty( CameraActor::Property::INVERT_Y_AXIS, true); - cameraActor.SetAnchorPoint( AnchorPoint::CENTER ); - cameraActor.SetParentOrigin( ParentOrigin::CENTER ); + cameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + cameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCameras.emplace_back( cameraActor ); } diff --git a/examples/refraction-effect/refraction-effect-example.cpp b/examples/refraction-effect/refraction-effect-example.cpp index bd2a0d3..4bc2445 100644 --- a/examples/refraction-effect/refraction-effect-example.cpp +++ b/examples/refraction-effect/refraction-effect-example.cpp @@ -294,7 +294,7 @@ private: mMeshActor = Actor::New(); mMeshActor.AddRenderer( mRenderer ); mMeshActor.SetSize( stageSize ); - mMeshActor.SetParentOrigin(ParentOrigin::CENTER); + mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mContent.Add( mMeshActor ); // Connect the callback to the touch signal on the mesh actor diff --git a/examples/remote-image-loading/remote-image-loading-example.cpp b/examples/remote-image-loading/remote-image-loading-example.cpp index 2dbcadb..791d9f2 100644 --- a/examples/remote-image-loading/remote-image-loading-example.cpp +++ b/examples/remote-image-loading/remote-image-loading-example.cpp @@ -66,51 +66,51 @@ public: rubric.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE ); rubric.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); rubric.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); - rubric.SetParentOrigin( ParentOrigin::TOP_CENTER ); - rubric.SetAnchorPoint( ParentOrigin::TOP_CENTER ); + rubric.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + rubric.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_CENTER ); stage.Add( rubric ); mImageView1 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/293/259/19/520_000000000000293259191500x1500_72dpi_RGB_q70.jpg"); - mImageView1.SetName("mImageView1"); - mImageView1.SetParentOrigin(ParentOrigin::TOP_LEFT); - mImageView1.SetAnchorPoint(AnchorPoint::TOP_CENTER); + mImageView1.SetProperty( Dali::Actor::Property::NAME,"mImageView1"); + mImageView1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mImageView1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mImageView1.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); mImageView1.SetPosition(0, 100); mImageView1.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); stage.Add(mImageView1); mImageView2 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/212/651/88/520_000000000000212651881500x1500_72dpi_RGB_q70.jpg"); - mImageView2.SetName("mImageView2"); - mImageView2.SetParentOrigin(ParentOrigin::TOP_LEFT); - mImageView2.SetAnchorPoint(AnchorPoint::TOP_CENTER); + mImageView2.SetProperty( Dali::Actor::Property::NAME,"mImageView2"); + mImageView2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mImageView2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mImageView2.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); mImageView2.SetPosition(400, 100); mImageView2.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); stage.Add(mImageView2); mImageView3 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/212/353/21/520_000000000000212353211500x1500_72dpi_RGB_q70.jpg"); - mImageView3.SetName("mImageView3"); - mImageView3.SetParentOrigin(ParentOrigin::TOP_LEFT); - mImageView3.SetAnchorPoint(AnchorPoint::TOP_CENTER); + mImageView3.SetProperty( Dali::Actor::Property::NAME,"mImageView3"); + mImageView3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mImageView3.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mImageView3.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); mImageView3.SetPosition(0, 400); mImageView3.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); stage.Add(mImageView3); mImageView4 = Toolkit::ImageView::New("http://d2k43l0oslhof9.cloudfront.net/platform/image/contents/vc/20/01/58/20170629100630071189_0bf6b911-a847-cba4-e518-be40fe2f579420170629192203240.jpg"); - mImageView4.SetName("mImageView4"); - mImageView4.SetParentOrigin(ParentOrigin::TOP_LEFT); - mImageView4.SetAnchorPoint(AnchorPoint::TOP_CENTER); + mImageView4.SetProperty( Dali::Actor::Property::NAME,"mImageView4"); + mImageView4.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mImageView4.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mImageView4.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); mImageView4.SetPosition(400, 400); mImageView4.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); stage.Add(mImageView4); mImageView5 = Toolkit::ImageView::New("http://static.midomi.com/h/images/w/weather_sunny.png"); - mImageView5.SetName("mImageView5"); - mImageView4.SetParentOrigin(ParentOrigin::TOP_LEFT); - mImageView5.SetAnchorPoint(AnchorPoint::TOP_CENTER); + mImageView5.SetProperty( Dali::Actor::Property::NAME,"mImageView5"); + mImageView4.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); + mImageView5.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER); mImageView5.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); mImageView5.SetPosition(800, 100); mImageView5.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); @@ -156,11 +156,11 @@ public: { if (event.state == KeyEvent::Down) { - std::cout<<"Control down key : " << control.GetName() << ", keyCode : " << event.keyCode << std::endl; + std::cout<<"Control down key : " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << ", keyCode : " << event.keyCode << std::endl; } else { - std::cout<<"Control up key : " << control.GetName() << ", keyCode : " << event.keyCode << std::endl; + std::cout<<"Control up key : " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << ", keyCode : " << event.keyCode << std::endl; } return false; } @@ -170,7 +170,7 @@ public: if (touch.GetState(0) == PointState::DOWN) { - std::cout<<"Control touch " << actor.GetName() << ", parent " << actor.GetParent().GetName() << std::endl; + std::cout<<"Control touch " << actor.GetProperty< std::string >( Dali::Actor::Property::NAME ) << ", parent " << actor.GetParent().GetProperty< std::string >( Dali::Actor::Property::NAME ) << std::endl; } return false; @@ -178,12 +178,12 @@ public: void OnFocusSet(Control control) { - std::cout<<"OnFocusSet " << control.GetName() << std::endl; + std::cout<<"OnFocusSet " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << std::endl; } void OnFocusUnSet(Control control) { - std::cout<<"OnFocusUnSet " << control.GetName() << std::endl; + std::cout<<"OnFocusUnSet " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << std::endl; } private: diff --git a/examples/renderer-stencil/renderer-stencil-example.cpp b/examples/renderer-stencil/renderer-stencil-example.cpp index a8f50f8..a5f24c0 100644 --- a/examples/renderer-stencil/renderer-stencil-example.cpp +++ b/examples/renderer-stencil/renderer-stencil-example.cpp @@ -120,8 +120,8 @@ private: // Use a gradient visual to render the background gradient. Toolkit::Control background = Dali::Toolkit::Control::New(); - background.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - background.SetParentOrigin( Dali::ParentOrigin::CENTER ); + background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + background.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); // Set up the background gradient. @@ -145,9 +145,9 @@ private: // Create a TextLabel for the application title. Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE ); - label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); // Set the parent origin to a small percentage below the top (so the demo will scale for different resolutions). - label.SetParentOrigin( Vector3( 0.5f, 0.03f, 0.5f ) ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.03f, 0.5f ) ); label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, TEXT_COLOR ); @@ -155,9 +155,9 @@ private: // Layer to hold the 3D scene. Layer layer = Layer::New(); - layer.SetAnchorPoint( AnchorPoint::CENTER ); + layer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); // Set the parent origin to a small percentage below the center (so the demo will scale for different resolutions). - layer.SetParentOrigin( Vector3( 0.5f, 0.58f, 0.5f ) ); + layer.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.58f, 0.5f ) ); layer.SetBehavior( Layer::LAYER_UI ); layer.SetDepthTestDisabled( false ); stage.Add( layer ); @@ -278,8 +278,8 @@ private: Actor CreateMainCubeObject( Geometry& geometry, Vector3 size, TextureSet& textureSet ) { Toolkit::Control container = Toolkit::Control::New(); - container.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - container.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); container.SetSize( size ); container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); @@ -315,8 +315,8 @@ private: Actor CreateFloorObject( Geometry& geometry, Vector3 size ) { Toolkit::Control container = Toolkit::Control::New(); - container.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - container.SetParentOrigin( ParentOrigin::TOP_CENTER ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); container.SetSize( size ); container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); @@ -353,8 +353,8 @@ private: Actor CreateStencilPlaneObject( Vector3 size ) { Toolkit::Control container = Toolkit::Control::New(); - container.SetAnchorPoint( AnchorPoint::CENTER ); - container.SetParentOrigin( ParentOrigin::CENTER ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); container.SetSize( size ); container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); @@ -402,8 +402,8 @@ private: Actor CreateReflectionCubeObject( Vector3 size, TextureSet& textureSet ) { Toolkit::Control container = Toolkit::Control::New(); - container.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - container.SetParentOrigin( ParentOrigin::TOP_CENTER ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); container.SetSize( size ); container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); diff --git a/examples/rendering-basic-light/rendering-basic-light-example.cpp b/examples/rendering-basic-light/rendering-basic-light-example.cpp index a5fdcb3..02daf2f 100644 --- a/examples/rendering-basic-light/rendering-basic-light-example.cpp +++ b/examples/rendering-basic-light/rendering-basic-light-example.cpp @@ -161,8 +161,8 @@ public: Stage stage = Stage::GetCurrent(); stage.SetBackgroundColor( Color::BLACK ); mLabel = TextLabel::New( material[MaterialID].name ); - mLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - mLabel.SetParentOrigin( Vector3( 0.5f, 0.0f, 0.5f ) ); + mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + mLabel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.0f, 0.5f ) ); mLabel.SetSize( stage.GetSize().x * 0.5f, stage.GetSize().y * 0.083f ); mLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -170,12 +170,12 @@ public: stage.Add( mLabel ); mButton = PushButton::New(); mButton.SetProperty( Button::Property::LABEL, "Exit" ); - mButton.SetParentOrigin( ParentOrigin::CENTER ); - mButton.SetAnchorPoint( AnchorPoint::CENTER ); + mButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mButton.ClickedSignal().Connect( this, &BasicLightController::OnExit ); - mButton.SetParentOrigin( Vector3( 0.5f, 0.1f, 0.5f ) ); + mButton.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.1f, 0.5f ) ); mButton.SetStyleName(CUSTOM_BASIC_LIGHT_THEME); - mButton.SetColor( Vector4( material[MaterialID].diffuse) + Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ); + mButton.SetProperty( Actor::Property::COLOR, Vector4( material[MaterialID].diffuse) + Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ); stage.Add(mButton); // Step 1. Create shader @@ -215,7 +215,7 @@ public: mShader.SetProperty( mShader.GetPropertyIndex( "material.specular" ), material[MaterialID].specular ); mShader.SetProperty( mShader.GetPropertyIndex( "material.shininess" ), material[MaterialID].shininess * 128.0f ); mLabel.SetProperty( TextLabel::Property::TEXT, material[MaterialID].name ); - mButton.SetColor( Vector4(material[MaterialID].diffuse) + Vector4(0.0f, 0.0f, 0.0f, 1.0f) ); + mButton.SetProperty( Actor::Property::COLOR, Vector4(material[MaterialID].diffuse) + Vector4(0.0f, 0.0f, 0.0f, 1.0f) ); } return true; } @@ -377,9 +377,9 @@ public: float quarterStageWidth = stage.GetSize().x * 0.25f; mActor = Actor::New(); - mActor.SetColor( Vector4( 1.0f, 1.0f, 0.6f, 1.0f ) ); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 1.0f, 0.6f, 1.0f ) ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) ); mActor.AddRenderer( mRenderer ); stage.Add( mActor ); diff --git a/examples/rendering-basic-pbr/model-pbr.cpp b/examples/rendering-basic-pbr/model-pbr.cpp index 565f5a7..5dce6a5 100644 --- a/examples/rendering-basic-pbr/model-pbr.cpp +++ b/examples/rendering-basic-pbr/model-pbr.cpp @@ -70,8 +70,8 @@ void ModelPbr::Init( Shader shader, const std::string& modelUrl, const Vector3& renderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK ); mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetPosition( position ); mActor.SetSize( size ); mActor.AddRenderer( renderer ); diff --git a/examples/rendering-basic-pbr/model-skybox.cpp b/examples/rendering-basic-pbr/model-skybox.cpp index 8873e0f..2e5709f 100644 --- a/examples/rendering-basic-pbr/model-skybox.cpp +++ b/examples/rendering-basic-pbr/model-skybox.cpp @@ -94,8 +94,8 @@ void ModelSkybox::Init( const Vector3& size ) renderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK ); mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetSize( size ); mActor.AddRenderer( renderer ); } diff --git a/examples/rendering-basic-pbr/rendering-basic-pbr-example.cpp b/examples/rendering-basic-pbr/rendering-basic-pbr-example.cpp index 1239401..03962e4 100644 --- a/examples/rendering-basic-pbr/rendering-basic-pbr-example.cpp +++ b/examples/rendering-basic-pbr/rendering-basic-pbr-example.cpp @@ -113,8 +113,8 @@ public: stage.SetBackgroundColor( Color::BLACK ); mAnimation = Animation::New( 1.0f ); mLabel = TextLabel::New( "R:1 M:0" ); - mLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - mLabel.SetParentOrigin( ParentOrigin::TOP_CENTER ); + mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + mLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); mLabel.SetSize( stage.GetSize().width * 0.5f, stage.GetSize().height * 0.083f ); mLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -284,19 +284,19 @@ public: mUiRoot = Actor::New(); m3dRoot = Actor::New(); CameraActor cameraUi = CameraActor::New(stage.GetSize()); - cameraUi.SetAnchorPoint(AnchorPoint::CENTER); - cameraUi.SetParentOrigin(ParentOrigin::CENTER); + cameraUi.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); + cameraUi.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); RenderTask rendertask = Stage::GetCurrent().GetRenderTaskList().CreateTask(); rendertask.SetCameraActor( cameraUi ); rendertask.SetSourceActor( mUiRoot ); - mUiRoot.SetAnchorPoint(AnchorPoint::TOP_LEFT); - mUiRoot.SetParentOrigin(ParentOrigin::TOP_LEFT); + mUiRoot.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + mUiRoot.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); mUiRoot.SetSize(stage.GetSize()); - m3dRoot.SetAnchorPoint(AnchorPoint::CENTER); - m3dRoot.SetParentOrigin(ParentOrigin::CENTER); + m3dRoot.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); + m3dRoot.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); // Setting camera parameters for 3D Scene mSkybox.GetActor().SetPosition( CAMERA_DEFAULT_POSITION ); diff --git a/examples/rendering-cube/rendering-cube.cpp b/examples/rendering-cube/rendering-cube.cpp index d8b24d9..6cc563e 100644 --- a/examples/rendering-cube/rendering-cube.cpp +++ b/examples/rendering-cube/rendering-cube.cpp @@ -247,8 +247,8 @@ public: float quarterStageWidth = stage.GetSize().x * 0.25f; mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) ); mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) ); mActor.AddRenderer( mRenderer ); diff --git a/examples/rendering-line/rendering-line.cpp b/examples/rendering-line/rendering-line.cpp index 1bbaf84..67e5198 100644 --- a/examples/rendering-line/rendering-line.cpp +++ b/examples/rendering-line/rendering-line.cpp @@ -168,10 +168,10 @@ public: Stage stage = Stage::GetCurrent(); Size size = stage.GetSize() * 0.25f; mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) ); - mActor.SetColor( Color::BLACK ); + mActor.SetProperty( Actor::Property::COLOR, Color::BLACK ); mActor.SetSize( Vector3( size.x, size.x, size.x ) ); mActor.AddRenderer( mRenderer ); stage.Add( mActor ); diff --git a/examples/rendering-radial-progress/radial-progress.cpp b/examples/rendering-radial-progress/radial-progress.cpp index eb0fb7e..2bef6b3 100644 --- a/examples/rendering-radial-progress/radial-progress.cpp +++ b/examples/rendering-radial-progress/radial-progress.cpp @@ -132,8 +132,8 @@ public: // 1. Create actor to show the effect mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetSize( Vector2( TEXTURE_WIDTH, TEXTURE_HEIGHT ) ); mActor.RegisterProperty("uProgress", float(1.0f) ); stage.Add( mActor ); diff --git a/examples/rendering-skybox/look-camera.cpp b/examples/rendering-skybox/look-camera.cpp index 9e6cf00..8e74743 100644 --- a/examples/rendering-skybox/look-camera.cpp +++ b/examples/rendering-skybox/look-camera.cpp @@ -74,7 +74,7 @@ void LookCamera::Initialise( const Vector3& position, float fovY, float near, fl mNear = near; mFar = far; - // Camera position is shadowed in order to avoid using GetCurrentPosition() + // Camera position is shadowed in order to avoid using.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) mCameraPosition = position; // Initialise default camera @@ -121,9 +121,9 @@ void LookCamera::InitialiseDefaultCamera() { Stage stage = Stage::GetCurrent(); mCameraActor = stage.GetRenderTaskList().GetTask(0).GetCameraActor(); - mCameraActor.SetName( "LookCamera" ); - mCameraActor.SetAnchorPoint( AnchorPoint::CENTER ); - mCameraActor.SetParentOrigin( ParentOrigin::CENTER ); + mCameraActor.SetProperty( Dali::Actor::Property::NAME, "LookCamera" ); + mCameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCameraActor.SetFieldOfView( Radian( Degree( mFovY ) ) ); // should be read from file @@ -137,11 +137,11 @@ void LookCamera::CreateInterceptorActor() Stage stage = Stage::GetCurrent(); mInterceptorActor = Actor::New(); - mInterceptorActor.SetName( "InputInterceptor" ); + mInterceptorActor.SetProperty( Dali::Actor::Property::NAME, "InputInterceptor" ); mInterceptorActor.SetSize( Vector3( stage.GetSize().x, stage.GetSize().y, 1 ) ); mInterceptorActor.SetPosition( Vector3( 0.0, 0.0, 1.0 ) ); - mInterceptorActor.SetAnchorPoint( AnchorPoint::CENTER ); - mInterceptorActor.SetParentOrigin( ParentOrigin::CENTER ); + mInterceptorActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mInterceptorActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mCameraActor.Add( mInterceptorActor ); // Connect TouchSignal to interceptor actor diff --git a/examples/rendering-skybox/rendering-skybox.cpp b/examples/rendering-skybox/rendering-skybox.cpp index cb8590d..c9c925c 100644 --- a/examples/rendering-skybox/rendering-skybox.cpp +++ b/examples/rendering-skybox/rendering-skybox.cpp @@ -402,9 +402,9 @@ public: mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON ); mActor = Actor::New(); - mActor.SetName( "Cube" ); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Dali::Actor::Property::NAME, "Cube" ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.AddRenderer( mRenderer ); mActor.SetSize( 10.f, 10.f, 10.f ); @@ -443,9 +443,9 @@ public: Stage stage = Stage::GetCurrent(); mSkyboxActor = Actor::New(); - mSkyboxActor.SetName( "SkyBox" ); - mSkyboxActor.SetAnchorPoint( AnchorPoint::CENTER ); - mSkyboxActor.SetParentOrigin( ParentOrigin::CENTER ); + mSkyboxActor.SetProperty( Dali::Actor::Property::NAME, "SkyBox" ); + mSkyboxActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mSkyboxActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mSkyboxActor.SetPosition( CAMERA_DEFAULT_POSITION ); mSkyboxActor.AddRenderer( mSkyboxRenderer ); stage.Add( mSkyboxActor ); diff --git a/examples/rendering-textured-cube/rendering-textured-cube.cpp b/examples/rendering-textured-cube/rendering-textured-cube.cpp index 3434d63..858b020 100644 --- a/examples/rendering-textured-cube/rendering-textured-cube.cpp +++ b/examples/rendering-textured-cube/rendering-textured-cube.cpp @@ -265,8 +265,8 @@ public: float quarterStageWidth = stage.GetSize().x * 0.25f; mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) ); mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) ); mActor.AddRenderer( mRenderer ); diff --git a/examples/rendering-triangle/rendering-triangle.cpp b/examples/rendering-triangle/rendering-triangle.cpp index 76fae81..af50653 100644 --- a/examples/rendering-triangle/rendering-triangle.cpp +++ b/examples/rendering-triangle/rendering-triangle.cpp @@ -169,10 +169,10 @@ public: Stage stage = Stage::GetCurrent(); Size size = stage.GetSize() * 0.25f; mActor = Actor::New(); - mActor.SetAnchorPoint( AnchorPoint::CENTER ); - mActor.SetParentOrigin( ParentOrigin::CENTER ); + mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) ); - mActor.SetColor( Color::RED ); + mActor.SetProperty( Actor::Property::COLOR, Color::RED ); mActor.SetSize( Vector3( size.x, size.x, size.x ) ); mActor.AddRenderer( mRenderer ); stage.Add( mActor ); diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index 05d3fcd..c636e2d 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -214,8 +214,8 @@ private: Vector2 stageSize = stage.GetSize(); mScrollView = ScrollView::New(); - mScrollView.SetAnchorPoint(AnchorPoint::CENTER); - mScrollView.SetParentOrigin(ParentOrigin::CENTER); + mScrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); + mScrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mContentLayer.Add( mScrollView ); mScrollView.SetSize( stageSize ); mScrollView.SetAxisAutoLock( true ); @@ -276,8 +276,8 @@ private: { Actor page = Actor::New(); page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - page.SetParentOrigin( ParentOrigin::CENTER ); - page.SetAnchorPoint( AnchorPoint::CENTER ); + page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Stage stage = Stage::GetCurrent(); Vector2 stageSize = stage.GetSize(); @@ -294,8 +294,8 @@ private: { ImageView image = CreateImage( GetNextImagePath(), imageSize.x, imageSize.y ); - image.SetParentOrigin( ParentOrigin::CENTER ); - image.SetAnchorPoint( AnchorPoint::CENTER ); + image.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + image.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Vector3 position( margin * 0.5f + (imageSize.x + margin) * column - stageSize.width * 0.5f, margin * 0.5f + (imageSize.y + margin) * row - stageSize.height * 0.5f, @@ -468,9 +468,9 @@ private: map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR; actor.SetProperty( ImageView::Property::IMAGE, map ); - actor.SetName( filename ); - actor.SetParentOrigin(ParentOrigin::CENTER); - actor.SetAnchorPoint(AnchorPoint::CENTER); + actor.SetProperty( Dali::Actor::Property::NAME, filename ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage ); return actor; diff --git a/examples/shadows-and-lights/shadows-and-lights-example.cpp b/examples/shadows-and-lights/shadows-and-lights-example.cpp index 740a283..4e83d32 100644 --- a/examples/shadows-and-lights/shadows-and-lights-example.cpp +++ b/examples/shadows-and-lights/shadows-and-lights-example.cpp @@ -211,17 +211,17 @@ public: void CreateShadowViewAndLights() { mShadowView = Toolkit::ShadowView::New(); - mShadowView.SetName("Container"); - mShadowView.SetParentOrigin(ParentOrigin::CENTER); - mShadowView.SetAnchorPoint(AnchorPoint::CENTER); + mShadowView.SetProperty( Dali::Actor::Property::NAME,"Container"); + mShadowView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mShadowView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); mShadowView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mShadowView.SetPointLightFieldOfView( Math::PI / 2.0f); mContents.Add(mShadowView); mShadowPlaneBg = ImageView::New( DEMO_IMAGE_DIR "brick-wall.jpg" ); - mShadowPlaneBg.SetParentOrigin(ParentOrigin::CENTER); - mShadowPlaneBg.SetAnchorPoint(AnchorPoint::CENTER); - mShadowPlaneBg.SetName("Plane"); + mShadowPlaneBg.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mShadowPlaneBg.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); + mShadowPlaneBg.SetProperty( Dali::Actor::Property::NAME,"Plane"); mShadowPlaneBg.SetSize(1000.0f, 1000.0f); mContents.Add(mShadowPlaneBg); mShadowPlaneBg.SetPosition(Vector3(50.0f, 50.0f, -200.0f)); @@ -230,8 +230,8 @@ public: mShadowView.Activate(); mLightAnchor = Actor::New(); - mLightAnchor.SetParentOrigin(ParentOrigin::CENTER); - mLightAnchor.SetAnchorPoint(AnchorPoint::CENTER); + mLightAnchor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mLightAnchor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); mLightAnchor.SetOrientation( CalculateWorldRotation( mLightXRotation, mLightYRotation ) ); // Work out a scaling factor as the initial light position was calculated for desktop @@ -240,27 +240,27 @@ public: float scaleFactor = stageSize.x / DEFAULT_STAGE_SIZE.x; mCastingLight = Actor::New(); - mCastingLight.SetParentOrigin(ParentOrigin::CENTER); - mCastingLight.SetAnchorPoint(AnchorPoint::CENTER); + mCastingLight.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + mCastingLight.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) * scaleFactor ); TextLabel text = TextLabel::New( "Light" ); text.SetProperty( TextLabel::Property::POINT_SIZE, 20.0f ); text.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - text.SetColor( Color::BLUE ); + text.SetProperty( Actor::Property::COLOR, Color::BLUE ); mCastingLight.Add(text); mLightAnchor.Add(mCastingLight); mShadowPlaneBg.Add(mLightAnchor); - text.SetParentOrigin(ParentOrigin::CENTER); + text.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); mShadowView.SetPointLight(mCastingLight); } void CreateScene() { mSceneActor = Actor::New(); - mSceneActor.SetParentOrigin(ParentOrigin::CENTER); + mSceneActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); // Create and add images to the scene actor: mImageActor1 = ImageView::New( SCENE_IMAGE_1 ); @@ -271,13 +271,13 @@ public: mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mImageActor3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - mImageActor2.SetParentOrigin(ParentOrigin::CENTER); + mImageActor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - mImageActor1.SetParentOrigin(ParentOrigin::CENTER_LEFT); - mImageActor1.SetAnchorPoint(AnchorPoint::CENTER_RIGHT); + mImageActor1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_LEFT); + mImageActor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_RIGHT); - mImageActor3.SetParentOrigin(ParentOrigin::CENTER_RIGHT); - mImageActor3.SetAnchorPoint(AnchorPoint::CENTER_LEFT); + mImageActor3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_RIGHT); + mImageActor3.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_LEFT); mSceneActor.Add(mImageActor2); mImageActor2.Add(mImageActor1); @@ -392,7 +392,7 @@ public: { if (gesture.state == Gesture::Started) { - mScaleAtPinchStart = mContents.GetCurrentScale().x; + mScaleAtPinchStart = mContents.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x; } mPinchScale = Clamp(mScaleAtPinchStart * gesture.scale, MIN_PINCH_SCALE, MAX_PINCH_SCALE); diff --git a/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp b/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp index 51845bb..0bdcc9b 100644 --- a/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp +++ b/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp @@ -106,8 +106,8 @@ public: fontClient.GetFontId( bitmapColorFont ); TextLabel label01 = TextLabel::New(); - label01.SetAnchorPoint( AnchorPoint::CENTER ); - label01.SetParentOrigin( ParentOrigin::CENTER ); + label01.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label01.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); label01.SetSize( 400.f, 50.f ); label01.SetPosition( 0.f, -100.f ); label01.SetProperty( TextLabel::Property::MULTI_LINE, true ); @@ -123,8 +123,8 @@ public: TextLabel label02 = TextLabel::New(); - label02.SetAnchorPoint( AnchorPoint::CENTER ); - label02.SetParentOrigin( ParentOrigin::CENTER ); + label02.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label02.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); label02.SetSize( 400.f, 50.f ); label02.SetPosition( 0.f, -50.f ); label02.SetProperty( TextLabel::Property::MULTI_LINE, true ); @@ -138,8 +138,8 @@ public: stage.Add( label02 ); TextLabel label03 = TextLabel::New(); - label03.SetAnchorPoint( AnchorPoint::CENTER ); - label03.SetParentOrigin( ParentOrigin::CENTER ); + label03.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label03.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); label03.SetSize( 400.f, 50.f ); label03.SetPosition( 0.f, 0.f ); label03.SetProperty( TextLabel::Property::MULTI_LINE, true ); @@ -152,8 +152,8 @@ public: stage.Add( label03 ); TextLabel label04 = TextLabel::New(); - label04.SetAnchorPoint( AnchorPoint::CENTER ); - label04.SetParentOrigin( ParentOrigin::CENTER ); + label04.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label04.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); label04.SetSize( 400.f, 50.f ); label04.SetPosition( 0.f, 50.f ); label04.SetProperty( TextLabel::Property::MULTI_LINE, true ); diff --git a/examples/simple-scroll-view/simple-scroll-view-example.cpp b/examples/simple-scroll-view/simple-scroll-view-example.cpp index a19d795..675bb6b 100644 --- a/examples/simple-scroll-view/simple-scroll-view-example.cpp +++ b/examples/simple-scroll-view/simple-scroll-view-example.cpp @@ -67,8 +67,8 @@ private: // Create a scroll view and set our desired properties ScrollView scrollView = ScrollView::New(); - scrollView.SetAnchorPoint( AnchorPoint::CENTER ); - scrollView.SetParentOrigin( ParentOrigin::CENTER ); + scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); scrollView.SetSize( pageSize ); scrollView.SetAxisAutoLock( true ); stage.Add( scrollView ); @@ -105,8 +105,8 @@ private: { Actor page = Actor::New(); page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - page.SetParentOrigin( ParentOrigin::CENTER ); - page.SetAnchorPoint( AnchorPoint::CENTER ); + page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Stage stage = Stage::GetCurrent(); diff --git a/examples/simple-text-field/simple-text-field.cpp b/examples/simple-text-field/simple-text-field.cpp index 45fa17d..ee9b3e7 100644 --- a/examples/simple-text-field/simple-text-field.cpp +++ b/examples/simple-text-field/simple-text-field.cpp @@ -57,7 +57,7 @@ public: stage.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) ); TextField field = TextField::New(); - field.SetParentOrigin( ParentOrigin::CENTER ); + field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); field.SetSize( 300.f, 60.f ); field.SetBackgroundColor( Color::WHITE ); field.SetBackgroundColor( Vector4( 1.f, 1.f, 1.f, 0.15f ) ); diff --git a/examples/simple-text-label/simple-text-label-example.cpp b/examples/simple-text-label/simple-text-label-example.cpp index 89c079d..0cadfe8 100644 --- a/examples/simple-text-label/simple-text-label-example.cpp +++ b/examples/simple-text-label/simple-text-label-example.cpp @@ -55,9 +55,9 @@ public: stage.KeyEventSignal().Connect(this, &SimpleTextLabelExample::OnKeyEvent); mLabel = TextLabel::New( "A Quick Brown Fox Jumps Over The Lazy Dog" ); - mLabel.SetName( "SimpleTextLabel" ); - mLabel.SetAnchorPoint( AnchorPoint::CENTER ); - mLabel.SetParentOrigin( ParentOrigin::CENTER ); + mLabel.SetProperty( Dali::Actor::Property::NAME, "SimpleTextLabel" ); + mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mLabel.SetSize( 400.f, 400.f ); mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true ); mLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK ); diff --git a/examples/simple-text-renderer/simple-text-renderer-example.cpp b/examples/simple-text-renderer/simple-text-renderer-example.cpp index 4180c2b..21f07ce 100644 --- a/examples/simple-text-renderer/simple-text-renderer-example.cpp +++ b/examples/simple-text-renderer/simple-text-renderer-example.cpp @@ -311,11 +311,11 @@ public: renderer.SetTextures( textureSet ); Actor actor = Actor::New(); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actor.SetPosition( 0.f, 0.f); actor.SetSize( 360.f, 360.f ); - actor.SetColor( Color::WHITE ); + actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); actor.AddRenderer( renderer ); diff --git a/examples/simple-text-visual/simple-text-visual-example.cpp b/examples/simple-text-visual/simple-text-visual-example.cpp index 5964010..24a6c68 100644 --- a/examples/simple-text-visual/simple-text-visual-example.cpp +++ b/examples/simple-text-visual/simple-text-visual-example.cpp @@ -56,7 +56,7 @@ public: stage.SetBackgroundColor( Color::WHITE ); Dali::Toolkit::Control control = Dali::Toolkit::ImageView::New(); - control.SetParentOrigin( ParentOrigin::CENTER ); + control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); const std::string markupText( "Hello world" ); diff --git a/examples/simple-visuals-control/simple-visuals-application.cpp b/examples/simple-visuals-control/simple-visuals-application.cpp index 2b9d93c..627dc11 100644 --- a/examples/simple-visuals-control/simple-visuals-application.cpp +++ b/examples/simple-visuals-control/simple-visuals-application.cpp @@ -111,12 +111,12 @@ void SimpleVisualsApplication::Create( Application& application ) // Create a table view to parent the 2 MyControls TableView contentLayout = TableView::New( 2, 2 ); - contentLayout.SetName("ContentLayout"); + contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout"); contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); contentLayout.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT ); contentLayout.SetSizeModeFactor( Vector3( 1.0f, .5f, 1.0f ) ); - contentLayout.SetAnchorPoint( AnchorPoint::CENTER ); - contentLayout.SetParentOrigin( ParentOrigin::CENTER ); + contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); contentLayout.SetCellPadding( Vector2( 50.0f, 15.0f ) ); contentLayout.SetBackgroundColor( Vector4(0.949, 0.949, 0.949, 1.0) ); @@ -128,11 +128,11 @@ void SimpleVisualsApplication::Create( Application& application ) // Create 2 MyControls and add to table view. mMyControl = MyControl::New(); mMyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mMyControl.SetParentOrigin(ParentOrigin::TOP_LEFT); + mMyControl.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT); mMyControl2 = MyControl::New(); mMyControl2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mMyControl2.SetParentOrigin(ParentOrigin::CENTER); + mMyControl2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); contentLayout.AddChild( mMyControl2, TableView::CellPosition(0, 0) ); contentLayout.AddChild( mMyControl, TableView::CellPosition(0, 1) ); diff --git a/examples/size-negotiation/size-negotiation-example.cpp b/examples/size-negotiation/size-negotiation-example.cpp index 4856360..98228d9 100644 --- a/examples/size-negotiation/size-negotiation-example.cpp +++ b/examples/size-negotiation/size-negotiation-example.cpp @@ -133,8 +133,8 @@ public: mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::Padding( padding, padding, padding, padding ) ); mItemView = Toolkit::ItemView::New( *this ); - mItemView.SetParentOrigin( ParentOrigin::CENTER ); - mItemView.SetAnchorPoint( AnchorPoint::CENTER ); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Use a grid layout for tests @@ -180,9 +180,9 @@ public: const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f; Toolkit::Popup popup = Toolkit::Popup::New(); - popup.SetName( "popup" ); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( AnchorPoint::CENTER ); + popup.SetProperty( Dali::Actor::Property::NAME, "popup" ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); popup.SetSize( POPUP_WIDTH_DP, 0.0f ); popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false ); @@ -194,14 +194,14 @@ public: bool OnButtonClicked( Toolkit::Button button ) { - if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID ) + if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_1CELL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); Toolkit::TableView table = Toolkit::TableView::New( 0, 0 ); - table.SetName( "TABLEVIEW_BUTTON_1CELL_ID" ); + table.SetProperty( Dali::Actor::Property::NAME, "TABLEVIEW_BUTTON_1CELL_ID" ); table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); @@ -212,7 +212,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3CELL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -241,7 +241,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3X3CELL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -305,7 +305,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED1_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -320,7 +320,7 @@ public: backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -333,7 +333,7 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); backing.Add( text ); @@ -345,7 +345,7 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); backing.Add( text ); @@ -356,7 +356,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED2_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -372,8 +372,8 @@ public: backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -386,8 +386,8 @@ public: backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -400,8 +400,8 @@ public: backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -414,7 +414,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT1_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -432,8 +432,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -448,8 +448,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -465,8 +465,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -480,7 +480,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT2_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -496,8 +496,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -517,8 +517,8 @@ public: text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); backing.Add( text ); table.Add( backing ); @@ -529,8 +529,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -544,7 +544,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL1_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); @@ -565,8 +565,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -582,8 +582,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -599,8 +599,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -614,7 +614,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL2_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); @@ -635,8 +635,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -652,8 +652,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -667,7 +667,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL3_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH ); @@ -686,8 +686,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -703,8 +703,8 @@ public: Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); + text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -717,7 +717,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -730,7 +730,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -744,7 +744,7 @@ public: StagePopup( mPopup ); } - else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID ) + else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID ) { mPopup = CreatePopup(); mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); @@ -795,7 +795,7 @@ public: // From ItemFactory virtual Actor NewItem(unsigned int itemId) { Toolkit::PushButton popupButton = Toolkit::PushButton::New(); - popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name ); + popupButton.SetProperty( Dali::Actor::Property::NAME, TABLEVIEW_BUTTON_ITEMS[ itemId ].name ); popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text ); popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); diff --git a/examples/sparkle/sparkle-effect-example.cpp b/examples/sparkle/sparkle-effect-example.cpp index 9cb180a..689a369 100644 --- a/examples/sparkle/sparkle-effect-example.cpp +++ b/examples/sparkle/sparkle-effect-example.cpp @@ -90,8 +90,8 @@ private: stage.SetBackgroundColor( BACKGROUND_COLOR ); mCircleBackground = ImageView::New( CIRCLE_BACKGROUND_IMAGE ); - mCircleBackground.SetParentOrigin( ParentOrigin::CENTER ); - mCircleBackground.SetAnchorPoint( AnchorPoint::CENTER ); + mCircleBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mCircleBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); stage.Add( mCircleBackground ); @@ -166,7 +166,7 @@ private: renderer.SetTextures( textureSet ); Actor meshActor = Actor::New(); - meshActor.SetParentOrigin( ParentOrigin::CENTER ); + meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); meshActor.SetSize( 1, 1 ); meshActor.AddRenderer( renderer ); diff --git a/examples/styling/image-channel-control-impl.cpp b/examples/styling/image-channel-control-impl.cpp index c7dde4f..b67e0ad 100644 --- a/examples/styling/image-channel-control-impl.cpp +++ b/examples/styling/image-channel-control-impl.cpp @@ -110,7 +110,7 @@ void ImageChannelControl::SetImage( const std::string& url ) void ImageChannelControl::SetVisibility( bool visibility ) { - printf("ImageChannelControl %s: SetVisibility( %s )\n", Self().GetName().c_str(), visibility?"T":"F" ); + printf("ImageChannelControl %s: SetVisibility( %s )\n", Self().GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str(), visibility?"T":"F" ); if( mAnimation ) { diff --git a/examples/styling/styling-application.cpp b/examples/styling/styling-application.cpp index ff88750..224ccf5 100644 --- a/examples/styling/styling-application.cpp +++ b/examples/styling/styling-application.cpp @@ -23,6 +23,7 @@ #include "styling-application.h" // External includes +#include #include #include #include "image-channel-control.h" @@ -116,10 +117,10 @@ void StylingApplication::Create( Application& application ) // Content panes: TableView contentLayout = TableView::New( 5, 1 ); - contentLayout.SetName("ContentLayout"); + contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout"); contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT ); + contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); contentLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) ); // Assign all rows the size negotiation property of fitting to children @@ -134,10 +135,10 @@ void StylingApplication::Create( Application& application ) mContentPane.Add( contentLayout ); mTitle = TextLabel::New( "Styling Example" ); - mTitle.SetName( "Title" ); + mTitle.SetProperty( Dali::Actor::Property::NAME, "Title" ); mTitle.SetStyleName("Title"); - mTitle.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - mTitle.SetParentOrigin( ParentOrigin::TOP_CENTER ); + mTitle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + mTitle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); mTitle.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); @@ -146,12 +147,12 @@ void StylingApplication::Create( Application& application ) // Buttons: TableView imageSelectLayout = TableView::New( 1, 2 ); - imageSelectLayout.SetName("ImageSelectLayout"); + imageSelectLayout.SetProperty( Dali::Actor::Property::NAME,"ImageSelectLayout"); imageSelectLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); imageSelectLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); - imageSelectLayout.SetAnchorPoint( AnchorPoint::CENTER ); - imageSelectLayout.SetParentOrigin( ParentOrigin::CENTER ); + imageSelectLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + imageSelectLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); imageSelectLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) ); // Fit radio button column to child width, leave image to fill remainder @@ -160,7 +161,7 @@ void StylingApplication::Create( Application& application ) contentLayout.Add( imageSelectLayout ); TableView radioButtonsLayout = TableView::New( 3, 2 ); - radioButtonsLayout.SetName("RadioButtonsLayout"); + radioButtonsLayout.SetProperty( Dali::Actor::Property::NAME,"RadioButtonsLayout"); radioButtonsLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); // Leave each row to fill to parent height // Set each column to fit to child width @@ -177,16 +178,16 @@ void StylingApplication::Create( Application& application ) { std::ostringstream thumbnailName; thumbnailName << "thumbnail" << i+1; ImageView image = ImageView::New( images[i] ); - image.SetName( thumbnailName.str() ); + image.SetProperty( Dali::Actor::Property::NAME, thumbnailName.str() ); image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); std::ostringstream label; label << (i+1); std::ostringstream radioButtonStyleName; radioButtonStyleName << "imageSelectButton" << i+1; mRadioButtons[i] = RadioButton::New( label.str() ); - mRadioButtons[i].SetName( radioButtonStyleName.str() ); - mRadioButtons[i].SetParentOrigin( ParentOrigin::TOP_LEFT ); - mRadioButtons[i].SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mRadioButtons[i].SetProperty( Dali::Actor::Property::NAME, radioButtonStyleName.str() ); + mRadioButtons[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mRadioButtons[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mRadioButtons[i].SetProperty( Button::Property::SELECTED, false ); mRadioButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnButtonStateChange ); @@ -199,35 +200,35 @@ void StylingApplication::Create( Application& application ) mRadioButtons[0].SetProperty( Button::Property::SELECTED, true ); mImagePlacement = Actor::New(); - mImagePlacement.SetParentOrigin( ParentOrigin::CENTER ); - mImagePlacement.SetAnchorPoint( AnchorPoint::CENTER ); + mImagePlacement.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mImagePlacement.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mImagePlacement.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); imageSelectLayout.AddChild( mImagePlacement, TableView::CellPosition( 0, 1 ) ); imageSelectLayout.SetCellAlignment( TableView::CellPosition( 0, 1 ), HorizontalAlignment::RIGHT, VerticalAlignment::CENTER ); mIcc1 = ImageChannelControl::New( BIG_IMAGE_1 ); - mIcc1.SetName("ICC1"); + mIcc1.SetProperty( Dali::Actor::Property::NAME,"ICC1"); mIcc1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT , Dimension::ALL_DIMENSIONS ); mIcc1.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); - mIcc1.SetParentOrigin( ParentOrigin::CENTER ); + mIcc1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mIcc1.SetVisibility( true ); mImagePlacement.Add( mIcc1 ); mIcc2 = ImageChannelControl::New( BIG_IMAGE_2 ); - mIcc2.SetName("ICC2"); + mIcc2.SetProperty( Dali::Actor::Property::NAME,"ICC2"); mIcc2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT , Dimension::ALL_DIMENSIONS ); mIcc2.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); - mIcc2.SetParentOrigin( ParentOrigin::CENTER ); + mIcc2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mIcc2.SetVisibility( false ); mImagePlacement.Add( mIcc2 ); mIcc3 = ImageChannelControl::New( BIG_IMAGE_3 ); - mIcc3.SetName("ICC3"); + mIcc3.SetProperty( Dali::Actor::Property::NAME,"ICC3"); mIcc3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT , Dimension::ALL_DIMENSIONS ); mIcc3.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); - mIcc3.SetParentOrigin( ParentOrigin::CENTER ); + mIcc3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mIcc3.SetVisibility( false ); mImagePlacement.Add( mIcc3 ); @@ -235,13 +236,13 @@ void StylingApplication::Create( Application& application ) mImageChannelControl = mIcc1; TableView channelSliderLayout = TableView::New( 3, 3 ); - channelSliderLayout.SetName("ChannelSliderLayout"); + channelSliderLayout.SetProperty( Dali::Actor::Property::NAME,"ChannelSliderLayout"); // Contains a column of check buttons and a column of sliders for R/G/B channelSliderLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); channelSliderLayout.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - channelSliderLayout.SetAnchorPoint( AnchorPoint::CENTER ); - channelSliderLayout.SetParentOrigin( ParentOrigin::CENTER ); + channelSliderLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + channelSliderLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); channelSliderLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) ); // Set each row to fit to child height @@ -261,9 +262,9 @@ void StylingApplication::Create( Application& application ) std::ostringstream checkBoxStyleName; checkBoxStyleName << "channelActiveCheckBox" << i+1; mCheckButtons[i] = CheckBoxButton::New(); - mCheckButtons[i].SetName( checkBoxStyleName.str() ); - mCheckButtons[i].SetParentOrigin( ParentOrigin::CENTER ); - mCheckButtons[i].SetAnchorPoint( AnchorPoint::CENTER ); + mCheckButtons[i].SetProperty( Dali::Actor::Property::NAME, checkBoxStyleName.str() ); + mCheckButtons[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mCheckButtons[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mCheckButtons[i].SetProperty( Button::Property::SELECTED, true ); mCheckButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnCheckButtonChange ); @@ -274,10 +275,10 @@ void StylingApplication::Create( Application& application ) TextLabel label = TextLabel::New( checkboxLabels[i] ); std::ostringstream labelStyleName; labelStyleName << "ColorLabel" << i+1; - label.SetName( labelStyleName.str() ); + label.SetProperty( Dali::Actor::Property::NAME, labelStyleName.str() ); label.SetStyleName( labelStyleName.str() ); - label.SetParentOrigin( ParentOrigin::CENTER ); - label.SetAnchorPoint ( AnchorPoint::CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH ); label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); @@ -286,10 +287,10 @@ void StylingApplication::Create( Application& application ) mChannelSliders[i] = Slider::New(); std::ostringstream sliderStyleName; sliderStyleName << "ColorSlider" << i+1; - mChannelSliders[i].SetName( sliderStyleName.str() ); + mChannelSliders[i].SetProperty( Dali::Actor::Property::NAME, sliderStyleName.str() ); mChannelSliders[i].SetStyleName( sliderStyleName.str() ); - mChannelSliders[i].SetParentOrigin( ParentOrigin::CENTER ); - mChannelSliders[i].SetAnchorPoint ( AnchorPoint::CENTER ); + mChannelSliders[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mChannelSliders[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mChannelSliders[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mChannelSliders[i].SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN , Dimension::HEIGHT ); mChannelSliders[i].SetProperty( Slider::Property::LOWER_BOUND, 0.0f ); @@ -309,7 +310,7 @@ void StylingApplication::Create( Application& application ) mResetButton = PushButton::New(); mResetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" ); - mResetButton.SetName("ResetButton"); + mResetButton.SetProperty( Dali::Actor::Property::NAME,"ResetButton"); mResetButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mResetButton.ClickedSignal().Connect( this, &StylingApplication::OnResetClicked ); @@ -317,11 +318,11 @@ void StylingApplication::Create( Application& application ) contentLayout.SetCellAlignment( TableView::CellPosition( 3, 0 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); TableView themeButtonLayout = TableView::New( 1, 4 ); - themeButtonLayout.SetName("ThemeButtonsLayout"); + themeButtonLayout.SetProperty( Dali::Actor::Property::NAME,"ThemeButtonsLayout"); themeButtonLayout.SetCellPadding( Vector2( 6.0f, 0.0f ) ); - themeButtonLayout.SetAnchorPoint( AnchorPoint::CENTER ); - themeButtonLayout.SetParentOrigin( ParentOrigin::CENTER ); + themeButtonLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + themeButtonLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); themeButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); themeButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); themeButtonLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) ); @@ -330,18 +331,18 @@ void StylingApplication::Create( Application& application ) TextLabel label = TextLabel::New( "Theme: "); label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); label.SetStyleName("ThemeLabel"); - label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - label.SetParentOrigin( ParentOrigin::TOP_CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); themeButtonLayout.AddChild( label, TableView::CellPosition( 0, 0 ) ); themeButtonLayout.SetCellAlignment( TableView::CellPosition( 0, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); for( int i=0; i<3; ++i ) { mThemeButtons[i] = PushButton::New(); - mThemeButtons[i].SetName("ThemeButton"); + mThemeButtons[i].SetProperty( Dali::Actor::Property::NAME,"ThemeButton"); mThemeButtons[i].SetStyleName("ThemeButton"); - mThemeButtons[i].SetParentOrigin( ParentOrigin::CENTER ); - mThemeButtons[i].SetAnchorPoint( ParentOrigin::CENTER ); + mThemeButtons[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mThemeButtons[i].SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::CENTER ); mThemeButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mThemeButtons[i].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); mThemeButtons[i].RegisterProperty( "theme", i, Property::READ_WRITE ); @@ -358,9 +359,9 @@ void StylingApplication::Create( Application& application ) Actor StylingApplication::CreateContentPane() { Toolkit::ImageView contentPane = Toolkit::ImageView::New( BORDER_IMAGE ); - contentPane.SetName("ContentPane"); - contentPane.SetParentOrigin( ParentOrigin::CENTER ); - contentPane.SetAnchorPoint( AnchorPoint::CENTER ); + contentPane.SetProperty( Dali::Actor::Property::NAME,"ContentPane"); + contentPane.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + contentPane.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); contentPane.SetPadding( Padding( BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH ) ); return contentPane; } @@ -368,23 +369,23 @@ Actor StylingApplication::CreateContentPane() Actor StylingApplication::CreateResizableContentPane() { Toolkit::ImageView contentPane = Toolkit::ImageView::New( BORDER_IMAGE ); - contentPane.SetName("ContentPane"); - contentPane.SetParentOrigin( ParentOrigin::CENTER ); - contentPane.SetAnchorPoint( AnchorPoint::CENTER ); + contentPane.SetProperty( Dali::Actor::Property::NAME,"ContentPane"); + contentPane.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + contentPane.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); contentPane.SetPadding( Padding( BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH ) ); Toolkit::ImageView grabHandle = Toolkit::ImageView::New( RESIZE_HANDLE_IMAGE ); - grabHandle.SetName("GrabHandle"); + grabHandle.SetProperty( Dali::Actor::Property::NAME,"GrabHandle"); grabHandle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - grabHandle.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); - grabHandle.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + grabHandle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT ); + grabHandle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); grabHandle.SetPosition( -BORDER_WIDTH, -BORDER_WIDTH ); - grabHandle.SetOpacity( 0.6f ); + grabHandle.SetProperty( DevelActor::Property::OPACITY, 0.6f ); Layer grabCornerLayer = Layer::New(); - grabCornerLayer.SetName("GrabCornerLayer"); - grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); - grabCornerLayer.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + grabCornerLayer.SetProperty( Dali::Actor::Property::NAME,"GrabCornerLayer"); + grabCornerLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT ); + grabCornerLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); grabCornerLayer.Add( grabHandle ); contentPane.Add( grabCornerLayer ); @@ -400,10 +401,10 @@ Popup StylingApplication::CreateResetPopup() Stage stage = Stage::GetCurrent(); Popup popup= Popup::New(); - popup.SetName("ResetPopup"); + popup.SetProperty( Dali::Actor::Property::NAME,"ResetPopup"); popup.SetStyleName("ResetPopup"); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( AnchorPoint::CENTER ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); popup.SetSize( stage.GetSize().width * 0.75f, 0.0f ); popup.SetProperty( Popup::Property::TAIL_VISIBILITY, false ); popup.OutsideTouchedSignal().Connect( this, &StylingApplication::HidePopup ); @@ -412,7 +413,7 @@ Popup StylingApplication::CreateResetPopup() popup.SetTitle( CreateTitle( "Reset channels" ) ); TextLabel text = TextLabel::New( "This will reset the channel data to full value. Are you sure?" ); - text.SetName( "PopupContentText" ); + text.SetProperty( Dali::Actor::Property::NAME, "PopupContentText" ); text.SetStyleName( "PopupBody" ); text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); @@ -421,36 +422,36 @@ Popup StylingApplication::CreateResetPopup() popup.SetContent( text ); ImageView footer = ImageView::New( DEFAULT_CONTROL_AREA_IMAGE_PATH ); - footer.SetName( "PopupFooter" ); + footer.SetProperty( Dali::Actor::Property::NAME, "PopupFooter" ); footer.SetStyleName( "PopupFooter" ); footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); footer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); footer.SetSize( 0.0f, 80.0f ); - footer.SetAnchorPoint( AnchorPoint::CENTER ); - footer.SetParentOrigin( ParentOrigin::CENTER ); + footer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + footer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); TableView footerLayout = TableView::New( 1, 2 ); - footerLayout.SetParentOrigin( ParentOrigin::CENTER ); - footerLayout.SetAnchorPoint ( AnchorPoint::CENTER ); + footerLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + footerLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); footerLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); PushButton okayButton = PushButton::New(); - okayButton.SetName( POPUP_CONTROL_OK_NAME ); + okayButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_OK_NAME ); okayButton.SetStyleName( POPUP_CONTROL_OK_NAME ); okayButton.SetProperty( Toolkit::Button::Property::LABEL, "Ok!" ); okayButton.ClickedSignal().Connect( this, &StylingApplication::OnReset ); - okayButton.SetParentOrigin( ParentOrigin::CENTER ); - okayButton.SetAnchorPoint( AnchorPoint::CENTER ); + okayButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + okayButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); okayButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); okayButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0f ) ); PushButton cancelButton = PushButton::New(); - cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME ); + cancelButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_CANCEL_NAME ); cancelButton.SetStyleName( POPUP_CONTROL_CANCEL_NAME ); cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" ); cancelButton.ClickedSignal().Connect( this, &StylingApplication::OnResetCancelled ); - cancelButton.SetParentOrigin( ParentOrigin::CENTER ); - cancelButton.SetAnchorPoint( AnchorPoint::CENTER ); + cancelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + cancelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); cancelButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); cancelButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0f ) ); @@ -468,7 +469,7 @@ Popup StylingApplication::CreateResetPopup() TextLabel StylingApplication::CreateTitle( std::string title ) { TextLabel titleActor = TextLabel::New( title ); - titleActor.SetName( "titleActor" ); + titleActor.SetProperty( Dali::Actor::Property::NAME, "titleActor" ); titleActor.SetStyleName( "PopupTitle" ); titleActor.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); titleActor.SetProperty( TextLabel::Property::MULTI_LINE, false ); diff --git a/examples/super-blur-view/super-blur-view-example.cpp b/examples/super-blur-view/super-blur-view-example.cpp index c687de3..a33bbfc 100644 --- a/examples/super-blur-view/super-blur-view-example.cpp +++ b/examples/super-blur-view/super-blur-view-example.cpp @@ -56,8 +56,8 @@ private: stage.KeyEventSignal().Connect( this, &SuperBlurViewExample::OnKeyEvent ); mSuperBlurView = SuperBlurView::New( DEFAULT_BLUR_LEVEL ); - mSuperBlurView.SetParentOrigin( ParentOrigin::CENTER ); - mSuperBlurView.SetAnchorPoint( AnchorPoint::CENTER ); + mSuperBlurView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mSuperBlurView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mSuperBlurView.SetSize( 800, 1280 ); mSuperBlurView.SetProperty( SuperBlurView::Property::IMAGE_URL, BACKGROUND_IMAGE ); stage.Add( mSuperBlurView ); @@ -69,8 +69,8 @@ private: mClearAnimation.AnimateTo( Property(mSuperBlurView, mSuperBlurView.GetBlurStrengthPropertyIndex()), 0.0f ); mPushButton = PushButton::New(); - mPushButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mPushButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mPushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mPushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mPushButton.SetProperty( Button::Property::LABEL, "Blur" ); mPushButton.PressedSignal().Connect( this, &SuperBlurViewExample::OnButtonPressed ); mPushButton.ReleasedSignal().Connect( this, &SuperBlurViewExample::OnButtonReleased ); diff --git a/examples/text-editor/text-editor-example.cpp b/examples/text-editor/text-editor-example.cpp index c775f19..caa89c9 100644 --- a/examples/text-editor/text-editor-example.cpp +++ b/examples/text-editor/text-editor-example.cpp @@ -122,8 +122,8 @@ public: mColorContainer.SetSizeModeFactor( Vector3( 0.0f, BUTTON_PERCENTAGE, 0.0f ) ); // Place to right of parent. - mColorContainer.SetParentOrigin( ParentOrigin::CENTER_RIGHT ); - mColorContainer.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + mColorContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_RIGHT ); + mColorContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); colorLabel.Add( mColorContainer ); // Add border to highlight harder-to-see colors. @@ -137,8 +137,8 @@ public: mColorButtonOption = Toolkit::PushButton::New(); mColorButtonOption.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); mColorButtonOption.SetSizeModeFactor( Vector3( 0.9f, 0.9f, 0.0f ) ); // Smaller than container to show border. - mColorButtonOption.SetParentOrigin( ParentOrigin::CENTER ); - mColorButtonOption.SetAnchorPoint( AnchorPoint::CENTER ); + mColorButtonOption.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mColorButtonOption.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); SetButtonColor( mColorButtonOption, Color::BLACK ); @@ -150,8 +150,8 @@ public: // Create the text editor. mEditor = TextEditor::New(); - mEditor.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mEditor.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mEditor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mEditor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mEditor.SetPosition( 0.f, toolBarHeight * 2.0f, 0.f ); mEditor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); mEditor.SetSizeModeFactor( TEXT_EDITOR_RELATIVE_SIZE ); @@ -193,8 +193,8 @@ public: mButtonContainer.SetSizeModeFactor( Vector3( 1.0f, NUMBER_OF_COLORS, 1.0f ) ); // Place below color selection button. - mButtonContainer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mButtonContainer.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mButtonContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mButtonContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); mButtonContainer.SetPosition( 0.0f, 2.f * TOOLBAR_PADDING, 0.f ); mColorContainer.Add( mButtonContainer ); @@ -207,7 +207,7 @@ public: std::ostringstream s; s << "color" << index; - button.SetName( s.str() ); + button.SetProperty( Dali::Actor::Property::NAME, s.str() ); SetButtonColor( button, COLORS[index] ); @@ -236,14 +236,14 @@ public: CreateButtonContainer(); } - mButtonContainer.SetVisible( true ); - mButtonContainer.SetSensitive( true ); + mButtonContainer.SetProperty( Actor::Property::VISIBLE, true ); + mButtonContainer.SetProperty( Actor::Property::SENSITIVE, true ); return true; } bool OnColorButtonClicked( Button button ) { - const std::string& name = button.GetName(); + const std::string& name = button.GetProperty< std::string >( Dali::Actor::Property::NAME ); Vector4 color; if( "color" == name.substr( 0u, 5u ) ) @@ -255,8 +255,8 @@ public: SetButtonColor( mColorButtonOption, color ); - mButtonContainer.SetVisible( false ); - mButtonContainer.SetSensitive( false ); + mButtonContainer.SetProperty( Actor::Property::VISIBLE, false ); + mButtonContainer.SetProperty( Actor::Property::SENSITIVE, false ); return true; } diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp index 4b9b7e2..3a7559c 100644 --- a/examples/text-field/text-field-example.cpp +++ b/examples/text-field/text-field-example.cpp @@ -85,7 +85,7 @@ public: PushButton button = PushButton::New(); button.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, FOLDER_ICON_IMAGE ); button.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, FOLDER_OPEN_ICON_IMAGE ); - button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); return button; } @@ -111,8 +111,8 @@ public: TextField CreateTextField( const Vector2& stageSize, const std::string& text ) { TextField field = TextField::New(); - field.SetName("textField"); - field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + field.SetProperty( Dali::Actor::Property::NAME,"textField"); + field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); field.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); field.SetProperty( TextField::Property::TEXT, text ); @@ -127,8 +127,8 @@ public: Popup CreatePopup() { Popup popup = Popup::New(); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( AnchorPoint::CENTER ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH ); popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched ); diff --git a/examples/text-fonts/text-fonts-example.cpp b/examples/text-fonts/text-fonts-example.cpp index cd20814..779af13 100644 --- a/examples/text-fonts/text-fonts-example.cpp +++ b/examples/text-fonts/text-fonts-example.cpp @@ -68,7 +68,7 @@ public: void CreateTextLabel( TextLabel& textLabel, std::string textString, const Vector4& color, bool infoLabel=false ) { textLabel = TextLabel::New( textString ); - textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); textLabel.SetProperty( TextLabel::Property::MULTI_LINE, true ); @@ -93,14 +93,14 @@ public: { container = Control::New(); container.SetSize( size ); - container.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); container.SetDrawMode( DrawMode::OVERLAY_2D ); } void CreateFolderButton( PushButton& button ) { button = PushButton::New(); - button.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); button.SetSize( 50.0f, 50.0f ); } @@ -121,7 +121,7 @@ public: stage.Add( mContainer4 ); // Info CreateContainer ( mContainer4Info , mLayoutSize ); - mContainer4Info.SetParentOrigin( ParentOrigin::TOP_RIGHT ); + mContainer4Info.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); mContainer4.Add( mContainer4Info ); CreateTextLabel ( mLabel4Info, "system free", Color::BLACK, true ); mContainer4Info.Add ( mLabel4Info ); @@ -154,7 +154,7 @@ public: stage.KeyEventSignal().Connect(this, &TextFontsExample::OnKeyEvent); CreateFolderButton ( mButton ); - mButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + mButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); mButton.ClickedSignal().Connect( this, &TextFontsExample::OnButtonClicked ); stage.Add( mButton ); @@ -167,9 +167,9 @@ public: CreateContainer ( mContainerInfo , mLayoutSize ); CreateContainer ( mContainer2Info , mLayoutSize ); CreateContainer ( mContainer3Info , mLayoutSize ); - mContainerInfo.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - mContainer2Info.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - mContainer3Info.SetParentOrigin( ParentOrigin::TOP_RIGHT ); + mContainerInfo.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + mContainer2Info.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + mContainer3Info.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); mContainer.Add( mContainerInfo ); mContainer2.Add( mContainer2Info ); mContainer3.Add( mContainer3Info ); diff --git a/examples/text-label-emojis/text-label-emojis.cpp b/examples/text-label-emojis/text-label-emojis.cpp index c98e206..8ae9bf1 100644 --- a/examples/text-label-emojis/text-label-emojis.cpp +++ b/examples/text-label-emojis/text-label-emojis.cpp @@ -62,8 +62,8 @@ public: mTableView = Toolkit::TableView::New( NUMBER_OF_EMOJIS, 1 ); mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch ); stage.Add( mTableView ); @@ -73,8 +73,8 @@ public: const std::string text = emoji.mUTF8 + " " + emoji.mDescription; TextLabel label = TextLabel::New( text ); - label.SetParentOrigin( ParentOrigin::TOP_CENTER ); - label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); label.SetProperty( TextLabel::Property::MULTI_LINE, true ); mTableView.SetFitHeight( index ); diff --git a/examples/text-label-multi-language/text-label-multi-language-example.cpp b/examples/text-label-multi-language/text-label-multi-language-example.cpp index ba54b57..24f6926 100644 --- a/examples/text-label-multi-language/text-label-multi-language-example.cpp +++ b/examples/text-label-multi-language/text-label-multi-language-example.cpp @@ -64,8 +64,8 @@ public: mTableView = Toolkit::TableView::New( NUMBER_OF_LANGUAGES, 1 ); mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); - mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + mTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch ); stage.Add( mTableView ); diff --git a/examples/text-label/text-label-example.cpp b/examples/text-label/text-label-example.cpp index 8fd1668..8faf0a6 100644 --- a/examples/text-label/text-label-example.cpp +++ b/examples/text-label/text-label-example.cpp @@ -210,17 +210,17 @@ public: mButtonSize = Size( mStageSize.height * 0.1, mStageSize.height * 0.1 ); // Button size 1/10 of stage height mContainer = Control::New(); - mContainer.SetName( "Container" ); - mContainer.SetParentOrigin( ParentOrigin::CENTER ); + mContainer.SetProperty( Dali::Actor::Property::NAME, "Container" ); + mContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mLayoutSize = Vector2(mStageSize.width*0.6f, mStageSize.width*0.6f); mContainer.SetSize( mLayoutSize ); stage.Add( mContainer ); // Resize the center layout when the corner is grabbed mGrabCorner = ImageView::New( BACKGROUND_IMAGE ); - mGrabCorner.SetName( "GrabCorner" ); - mGrabCorner.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); + mGrabCorner.SetProperty( Dali::Actor::Property::NAME, "GrabCorner" ); + mGrabCorner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + mGrabCorner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT ); mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mContainer.Add( mGrabCorner ); @@ -230,8 +230,8 @@ public: mLabel = TextLabel::New( "\xF0\x9F\x98\x89 A Quick Brown Fox Jumps Over The Lazy Dog" ); - mLabel.SetName( "TextLabel" ); - mLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mLabel.SetProperty( Dali::Actor::Property::NAME, "TextLabel" ); + mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mLabel.SetSize(mLayoutSize); mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true ); mLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN ); @@ -245,7 +245,7 @@ public: // Add a border for the container so you can see the container is being resized while grabbing the handle. mBorder = Control::New(); - mBorder.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mBorder.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); @@ -255,7 +255,7 @@ public: border.Insert( BorderVisual::Property::SIZE, 3.f ); mBorder.SetProperty( Control::Property::BACKGROUND, border ); mContainer.Add( mBorder ); - mBorder.SetVisible(false); + mBorder.SetProperty( Actor::Property::VISIBLE,false); mGrabCorner.RaiseToTop(); mHueAngleIndex = mLabel.RegisterProperty( "hue", 0.0f ); @@ -471,7 +471,7 @@ public: // Use a white button with 50% transparency as a clear color button if ( Color::WHITE == AVAILABLE_COLORS[ index ] && styleButtonIndex != StyleType::TEXT_COLOR ) { - mColorButtons[index].SetOpacity(0.5f); + mColorButtons[index].SetProperty( DevelActor::Property::OPACITY,0.5f); mColorButtons[index].SetProperty( Toolkit::Button::Property::LABEL, Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT ) @@ -585,7 +585,7 @@ public: } // Only show the border during the panning - mBorder.SetVisible(true); + mBorder.SetProperty( Actor::Property::VISIBLE,true); HideStyleAndColorButtons(); } @@ -610,7 +610,7 @@ public: { // Resize the text label to match the container size when panning is finished mLabel.SetSize(mLayoutSize); - mBorder.SetVisible(false); + mBorder.SetProperty( Actor::Property::VISIBLE,false); } } diff --git a/examples/text-memory-profiling/text-memory-profiling-example.cpp b/examples/text-memory-profiling/text-memory-profiling-example.cpp index 2fb3d2d..53baad6 100644 --- a/examples/text-memory-profiling/text-memory-profiling-example.cpp +++ b/examples/text-memory-profiling/text-memory-profiling-example.cpp @@ -97,8 +97,8 @@ public: TextLabel SetupTextLabel( int type ) { TextLabel label = TextLabel::New(); - label.SetAnchorPoint( ParentOrigin::TOP_LEFT ); - label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + label.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK ); label.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f ); Property::Map shadowMap; @@ -205,8 +205,8 @@ public: // Create an item view for the main menu mItemView = ItemView::New( *this ); - mItemView.SetParentOrigin( ParentOrigin::CENTER ); - mItemView.SetAnchorPoint( AnchorPoint::CENTER ); + mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST ); mLayout->SetItemSize( Vector3( stageSize.width, 60.0f, 0.0f ) ); @@ -278,8 +278,8 @@ public: mLayer.Remove( mLayer.GetChildAt( 0 ) ); } - mLayer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mLayer.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mLayer.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::HEIGHT ); mLayer.SetSizeModeFactor( Vector3( 0.0f, -DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight, 0.0f ) ); @@ -322,8 +322,8 @@ public: mLayer = Layer::New(); mIndicator = Toolkit::ImageView::New(INDICATOR_IMAGE); - mIndicator.SetParentOrigin( ParentOrigin::CENTER ); - mIndicator.SetAnchorPoint( AnchorPoint::CENTER ); + mIndicator.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mIndicator.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mIndicator.SetProperty( Actor::Property::VISIBLE, false ); // Create a back button in the left of toolbar @@ -331,13 +331,13 @@ public: backButton.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, BACK_IMAGE ); backButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, BACK_IMAGE_SELECTED ); backButton.ClickedSignal().Connect( this, &TextMemoryProfilingExample::OnBackButtonPressed ); - backButton.SetLeaveRequired( true ); + backButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Create a navigation view to navigate different types of text labels mNavigationView = NavigationView::New(); mNavigationView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mNavigationView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mNavigationView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); mNavigationView.SetBackgroundColor( Color::WHITE ); stage.Add( mNavigationView ); diff --git a/examples/text-overlap/text-overlap-example.cpp b/examples/text-overlap/text-overlap-example.cpp index 85d12db..7140614 100644 --- a/examples/text-overlap/text-overlap-example.cpp +++ b/examples/text-overlap/text-overlap-example.cpp @@ -33,8 +33,8 @@ void TextOverlapController::Create( Application& app ) mLabels[0] = TextLabel::New("Text Label 1"); mLabels[1] = TextLabel::New("Text Label 2"); - mLabels[0].SetName("Label1"); - mLabels[1].SetName("Label2"); + mLabels[0].SetProperty( Dali::Actor::Property::NAME,"Label1"); + mLabels[1].SetProperty( Dali::Actor::Property::NAME,"Label2"); mLabels[0].SetProperty( DevelActor::Property::SIBLING_ORDER, 1 ); mLabels[1].SetProperty( DevelActor::Property::SIBLING_ORDER, 2 ); @@ -45,8 +45,8 @@ void TextOverlapController::Create( Application& app ) for(int i=0; i( Actor::Property::POSITION ); + Vector3 size = mLabels[i].GetCurrentProperty< Vector3 >( Actor::Property::SIZE ); if( gesture.position.y > position.y - size.y * 0.5f && gesture.position.y <= position.y + size.y * 0.5f ) { @@ -92,7 +92,7 @@ void TextOverlapController::OnPan( Actor actor, const PanGesture& gesture ) else if( mGrabbedActor && gesture.state == PanGesture::Continuing ) { Vector2 stageSize = Stage::GetCurrent().GetSize(); - Vector3 size = mGrabbedActor.GetCurrentSize(); + Vector3 size = mGrabbedActor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ); float y = Clamp( gesture.position.y, size.y * 0.5f, stageSize.y - size.y*0.5f ); mGrabbedActor.SetPosition( 0, y ); } diff --git a/examples/text-scrolling/text-scrolling-example.cpp b/examples/text-scrolling/text-scrolling-example.cpp index e886331..3cb1ad4 100644 --- a/examples/text-scrolling/text-scrolling-example.cpp +++ b/examples/text-scrolling/text-scrolling-example.cpp @@ -76,9 +76,9 @@ public: void CreateBox( const std::string& name, Actor& box, Actor parent, const Vector2& size ) { - box.SetName(name); - box.SetAnchorPoint( AnchorPoint::CENTER ); - box.SetParentOrigin( ParentOrigin::CENTER ); + box.SetProperty( Dali::Actor::Property::NAME,name); + box.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + box.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); box.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); box.SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH ); box.SetSize( size.width, 0.f ); @@ -97,8 +97,8 @@ public: label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); label.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); label.SetPadding( Padding( 1.0f, 1.0f, 1.0f, 1.0f ) ); - label.SetAnchorPoint( AnchorPoint::CENTER ); - label.SetParentOrigin( ParentOrigin::CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); parent.Add( label ); if ( scrollOnStart ) @@ -108,8 +108,8 @@ public: button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); button.SetSize(BOX_SIZE.height,BOX_SIZE.height); - button.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); parent.Add(button); } @@ -126,10 +126,10 @@ public: // Create Root actor Actor rootActor = Actor::New(); - rootActor.SetName("rootActor"); + rootActor.SetProperty( Dali::Actor::Property::NAME,"rootActor"); rootActor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); rootActor.SetSize( mStageSize ); - rootActor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + rootActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); stage.Add( rootActor ); @@ -140,8 +140,8 @@ public: // Create Desktop Control desktop = Control::New(); desktop.SetBackgroundColor( Color::WHITE ); - desktop.SetName("desktopActor"); - desktop.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + desktop.SetProperty( Dali::Actor::Property::NAME,"desktopActor"); + desktop.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); desktop.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); desktop.SetSize( mTargetActorSize ); @@ -161,7 +161,7 @@ public: TextField field = TextField::New(); field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); field.SetPadding( Padding( 1.0f, 1.0f, 1.0f, 1.0f ) ); - field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Enter Folder Name" ); field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect( SCREEN_BORDER, SCREEN_BORDER, mStageSize.width - SCREEN_BORDER*2, mStageSize.height - SCREEN_BORDER*2 ) ); boxA.Add( field ); @@ -210,8 +210,8 @@ public: colorButton.SetProperty( Button::Property::TOGGLABLE, true ); colorButton.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::RED ) ); colorButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::BLACK ) ); - colorButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - colorButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); + colorButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); + colorButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); colorButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); colorButton.SetSize(BOX_SIZE.height,BOX_SIZE.height); colorButton.ClickedSignal().Connect( this, &TextScrollingExample::OnColorButtonClicked ); @@ -221,11 +221,11 @@ public: { Toolkit::RadioButton alignButton = Toolkit::RadioButton::New( ALIGNMENT_TABLE[ i ] ); alignButton.ClickedSignal().Connect( this, &TextScrollingExample::OnAlignButtonClicked ); - alignButton.SetName( ALIGNMENT_TABLE[ i ] ); + alignButton.SetProperty( Dali::Actor::Property::NAME, ALIGNMENT_TABLE[ i ] ); // Place first button to left aligned, second center aligned and third right aligned - alignButton.SetAnchorPoint( Vector3( i * 0.5f, 0.0f, 0.5f ) ); - alignButton.SetParentOrigin( Vector3( i * 0.5f, 0.0f, 0.5f ) ); + alignButton.SetProperty( Actor::Property::ANCHOR_POINT, Vector3( i * 0.5f, 0.0f, 0.5f ) ); + alignButton.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( i * 0.5f, 0.0f, 0.5f ) ); rootActor.Add( alignButton ); @@ -335,7 +335,7 @@ public: { for( unsigned int index = 0; index < ALIGNMENT_TABLE_COUNT; ++index ) { - const std::string& buttonName = button.GetName(); + const std::string& buttonName = button.GetProperty< std::string >( Dali::Actor::Property::NAME ); if( buttonName == ALIGNMENT_TABLE[ index ] ) { mSmallLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, ALIGNMENT_TABLE[ index ] ); diff --git a/examples/textured-mesh/textured-mesh-example.cpp b/examples/textured-mesh/textured-mesh-example.cpp index 19dd3a6..7d59d60 100644 --- a/examples/textured-mesh/textured-mesh-example.cpp +++ b/examples/textured-mesh/textured-mesh-example.cpp @@ -134,8 +134,8 @@ public: Property::Index fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); - mMeshActor.SetParentOrigin( ParentOrigin::TOP_CENTER ); - mMeshActor.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); stage.Add( mMeshActor ); mRenderer2 = Renderer::New( mGeometry, mShader ); @@ -152,8 +152,8 @@ public: Property::Index fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE ); mRenderer2.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); - mMeshActor2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mMeshActor2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mMeshActor2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mMeshActor2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); stage.Add( mMeshActor2 ); Animation animation = Animation::New(5); diff --git a/examples/tilt/tilt-example.cpp b/examples/tilt/tilt-example.cpp index dec8078..2ac324e 100644 --- a/examples/tilt/tilt-example.cpp +++ b/examples/tilt/tilt-example.cpp @@ -46,13 +46,13 @@ public: stage.SetBackgroundColor( Color::BLUE); mTextLabel = TextLabel::New( "Tilt Sensor Demo" ); - mTextLabel.SetParentOrigin( ParentOrigin::CENTER ); - mTextLabel.SetAnchorPoint( AnchorPoint::CENTER ); + mTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mTextLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mTextLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); mTextLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mTextLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE ); mTextLabel.SetProperty( TextLabel::Property::POINT_SIZE, 15.0f ); - mTextLabel.SetName( "tiltLabel" ); + mTextLabel.SetProperty( Dali::Actor::Property::NAME, "tiltLabel" ); stage.Add( mTextLabel ); // Respond to a click anywhere on the stage diff --git a/examples/tooltip/tooltip-example.cpp b/examples/tooltip/tooltip-example.cpp index 9068d2b..54c5cc0 100644 --- a/examples/tooltip/tooltip-example.cpp +++ b/examples/tooltip/tooltip-example.cpp @@ -63,8 +63,8 @@ private: // Add a text label at the top for information purposes Control label = TextLabel::New( "Hover over buttons to see tooltip" ); - label.SetParentOrigin( ParentOrigin::TOP_CENTER ); - label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "Center" ); stage.Add( label ); @@ -155,8 +155,8 @@ private: previousPosition += POSITION_INCREMENTER; control.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); control.SetSizeModeFactor( Vector3( 0.75, 0.1, 1.0 ) ); - control.SetAnchorPoint( AnchorPoint::CENTER ); - control.SetParentOrigin( ParentOrigin::TOP_CENTER ); + control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); control.SetY( stageSize.height * previousPosition ); } } diff --git a/examples/transitions/transition-application.cpp b/examples/transitions/transition-application.cpp index d2697d5..0e5acd4 100644 --- a/examples/transitions/transition-application.cpp +++ b/examples/transitions/transition-application.cpp @@ -77,10 +77,10 @@ void TransitionApplication::Create( Application& application ) // Content panes: TableView contentLayout = TableView::New( 3, 1 ); - contentLayout.SetName("ContentLayout"); + contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout"); contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT ); + contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); contentLayout.SetCellPadding( Vector2( 0.0f, 5.0f ) ); contentLayout.SetBackgroundColor( Vector4(0.949, 0.949, 0.949, 1.0) ); // Assign all rows the size negotiation property of fitting to children @@ -88,7 +88,7 @@ void TransitionApplication::Create( Application& application ) stage.Add( contentLayout ); mTitle = TextLabel::New( "Custom Control Transition Example" ); - mTitle.SetName( "Title" ); + mTitle.SetProperty( Dali::Actor::Property::NAME, "Title" ); mTitle.SetStyleName("Title"); mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); @@ -104,10 +104,10 @@ void TransitionApplication::Create( Application& application ) contentLayout.Add( buttonLayout ); mShadowButton = ShadowButton::New(); - mShadowButton.SetName("ShadowButton"); + mShadowButton.SetProperty( Dali::Actor::Property::NAME,"ShadowButton"); mShadowButton.SetActiveState( false ); - mShadowButton.SetAnchorPoint( AnchorPoint::CENTER ); - mShadowButton.SetParentOrigin( ParentOrigin::CENTER ); + mShadowButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mShadowButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mShadowButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mShadowButton.SetProperty( DevelControl::Property::STATE, DevelControl::DISABLED ); mShadowButton.SetProperty( DevelControl::Property::SUB_STATE, "UNCHECKED" ); @@ -115,7 +115,7 @@ void TransitionApplication::Create( Application& application ) buttonLayout.AddChild( mShadowButton, TableView::CellPosition(1, 1) ); TableView actionButtonLayout = TableView::New( 1, NUMBER_OF_ACTION_BUTTONS+1 ); - actionButtonLayout.SetName("ThemeButtonsLayout"); + actionButtonLayout.SetProperty( Dali::Actor::Property::NAME,"ThemeButtonsLayout"); actionButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); actionButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); actionButtonLayout.SetFitHeight( 0 ); @@ -129,7 +129,7 @@ void TransitionApplication::Create( Application& application ) for( int i=0; i +#include #include #include #include @@ -104,9 +105,9 @@ Control CreateBackground( std::string stylename ) Control background = Control::New(); Stage::GetCurrent().Add( background ); background.SetStyleName( stylename ); - background.SetName( "BACKGROUND" ); - background.SetAnchorPoint( AnchorPoint::CENTER ); - background.SetParentOrigin( ParentOrigin::CENTER ); + background.SetProperty( Actor::Property::NAME, "BACKGROUND" ); + background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); return background; } @@ -235,9 +236,9 @@ void DaliTableView::Initialize( Application& application ) // Add logo ImageView logo = ImageView::New( LOGO_PATH ); - logo.SetName( "LOGO_IMAGE" ); - logo.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - logo.SetParentOrigin( Vector3( 0.5f, 0.1f, 0.5f ) ); + logo.SetProperty( Actor::Property::NAME, "LOGO_IMAGE" ); + logo.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); + logo.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.1f, 0.5f ) ); logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); // The logo should appear on top of everything. logo.SetDrawMode( DrawMode::OVERLAY_2D ); @@ -250,8 +251,8 @@ void DaliTableView::Initialize( Application& application ) // Scrollview occupying the majority of the screen mScrollView = ScrollView::New(); - mScrollView.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - mScrollView.SetParentOrigin( Vector3( 0.5f, 1.0f - 0.05f, 0.5f ) ); + mScrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); + mScrollView.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 1.0f - 0.05f, 0.5f ) ); mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mScrollView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT ); mScrollView.SetSizeModeFactor( Vector3( 0.0f, 0.6f, 0.0f ) ); @@ -269,8 +270,8 @@ void DaliTableView::Initialize( Application& application ) // Populate background and bubbles - needs to be scrollViewLayer so scroll ends show Actor bubbleContainer = Actor::New(); bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER ); - bubbleContainer.SetParentOrigin( ParentOrigin::CENTER ); + bubbleContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + bubbleContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); SetupBackground( bubbleContainer ); mRootActor.Add( bubbleContainer ); @@ -330,9 +331,9 @@ void DaliTableView::CreateFocusEffect() { mFocusEffect[i].actor = ImageView::New(); mFocusEffect[i].actor.SetStyleName( "FocusActor" ); - mFocusEffect[i].actor.SetParentOrigin( ParentOrigin::CENTER ); + mFocusEffect[i].actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mFocusEffect[i].actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - mFocusEffect[i].actor.SetInheritScale( false ); + mFocusEffect[i].actor.SetProperty( Actor::Property::INHERIT_SCALE, false ); mFocusEffect[i].actor.SetColorMode( USE_OWN_COLOR ); KeyFrames alphaKeyFrames = KeyFrames::New(); @@ -416,8 +417,8 @@ void DaliTableView::Populate() { // Create Table TableView page = TableView::New( ROWS_PER_PAGE, EXAMPLES_PER_ROW ); - page.SetAnchorPoint( AnchorPoint::CENTER ); - page.SetParentOrigin( ParentOrigin::CENTER ); + page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mScrollView.Add( page ); @@ -505,10 +506,10 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit Toolkit::ImageView focusableTile = ImageView::New(); focusableTile.SetStyleName( "DemoTile" ); - focusableTile.SetParentOrigin( ParentOrigin::CENTER ); + focusableTile.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); focusableTile.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); focusableTile.SetSizeModeFactor( sizeMultiplier ); - focusableTile.SetName( name ); + focusableTile.SetProperty( Actor::Property::NAME, name ); // Set the tile to be keyboard focusable focusableTile.SetKeyboardFocusable( true ); @@ -528,15 +529,15 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit // Create an ImageView for the 9-patch border around the tile. ImageView borderImage = ImageView::New(); borderImage.SetStyleName("DemoTileBorder"); - borderImage.SetAnchorPoint( AnchorPoint::CENTER ); - borderImage.SetParentOrigin( ParentOrigin::CENTER ); + borderImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + borderImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); borderImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - borderImage.SetOpacity( 0.8f ); + borderImage.SetProperty( DevelActor::Property::OPACITY, 0.8f ); focusableTile.Add( borderImage ); TextLabel label = TextLabel::New(); - label.SetAnchorPoint( AnchorPoint::CENTER ); - label.SetParentOrigin( ParentOrigin::CENTER ); + label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); label.SetStyleName( "LauncherLabel" ); label.SetProperty( TextLabel::Property::MULTI_LINE, true ); label.SetProperty( TextLabel::Property::TEXT, title ); @@ -578,7 +579,7 @@ bool DaliTableView::DoTilePress( Actor actor, PointState::Type pointState ) // ignore Example button presses when scrolling or button animating. if( ( !mScrolling ) && ( !mPressedAnimation ) ) { - std::string name = actor.GetName(); + std::string name = actor.GetProperty< std::string >( Dali::Actor::Property::NAME ); const ExampleListIter end = mExampleList.end(); for( ExampleListIter iter = mExampleList.begin(); iter != end; ++iter ) { @@ -618,7 +619,7 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation& source ) mPressedAnimation.Reset(); if( mPressedActor ) { - std::string name = mPressedActor.GetName(); + std::string name = mPressedActor.GetProperty< std::string >( Dali::Actor::Property::NAME ); ExecuteProcess( name, mApplication ); @@ -766,7 +767,7 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count ) ImageView dfActor = ImageView::New(); dfActor.SetSize( Vector2( randSize, randSize ) ); - dfActor.SetParentOrigin( ParentOrigin::CENTER ); + dfActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); // Set the Image URL and the custom shader at the same time Dali::Property::Map effect = Toolkit::CreateDistanceFieldEffect(); @@ -915,12 +916,12 @@ void DaliTableView::OnLogoTapped( Dali::Actor actor, const Dali::TapGesture& tap mVersionPopup = Dali::Toolkit::Popup::New(); Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Version information" ); - titleActor.SetName( "titleActor" ); + titleActor.SetProperty( Actor::Property::NAME, "titleActor" ); titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::CENTER ); titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); Toolkit::TextLabel contentActor = Toolkit::TextLabel::New( stream.str() ); - contentActor.SetName( "contentActor" ); + contentActor.SetProperty( Actor::Property::NAME, "contentActor" ); contentActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); contentActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::CENTER ); contentActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE ); diff --git a/shared/view.h b/shared/view.h index 4497a63..67dee20 100644 --- a/shared/view.h +++ b/shared/view.h @@ -66,9 +66,9 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, Dali::Stage stage = Dali::Stage::GetCurrent(); Dali::Layer toolBarLayer = Dali::Layer::New(); - toolBarLayer.SetName( "TOOLBAR_LAYER" ); - toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); - toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); + toolBarLayer.SetProperty( Dali::Actor::Property::NAME, "TOOLBAR_LAYER" ); + toolBarLayer.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_CENTER ); + toolBarLayer.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::TOP_CENTER ); toolBarLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::WIDTH ); toolBarLayer.SetSize( 0.0f, style.mToolBarHeight ); @@ -77,12 +77,12 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, // Tool bar toolBar = Dali::Toolkit::ToolBar::New(); - toolBar.SetName( "TOOLBAR" ); + toolBar.SetProperty( Dali::Actor::Property::NAME, "TOOLBAR" ); Dali::Property::Map background; background["url"] = toolbarImagePath; toolBar.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, background ); - toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); - toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); + toolBar.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::TOP_CENTER ); + toolBar.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_CENTER ); toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); // Add the tool bar to the tool bar layer. @@ -92,7 +92,7 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, if( !title.empty() ) { Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New(); - label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT ); + label.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_LEFT ); label.SetStyleName( "ToolbarLabel" ); label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title ); label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); @@ -122,8 +122,8 @@ Dali::Layer CreateView( Dali::Application& application, // Create default View. view = Dali::Toolkit::Control::New(); - view.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - view.SetParentOrigin( Dali::ParentOrigin::CENTER ); + view.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + view.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); view.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); // Add the view to the stage before setting the background. @@ -155,8 +155,8 @@ Dali::Layer CreateView( Dali::Application& application, // Create a content layer. Dali::Layer contentLayer = Dali::Layer::New(); - contentLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - contentLayer.SetParentOrigin( Dali::ParentOrigin::CENTER ); + contentLayer.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + contentLayer.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); contentLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); view.Add( contentLayer ); contentLayer.LowerBelow( toolBarLayer ); -- 2.7.4