From fe51b34a968be11d80b032030cf1a20ff8bf7e85 Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Wed, 11 Jan 2017 15:56:17 +0000 Subject: [PATCH] Use Property:LABEL instead of SetLabelText for buttons Change-Id: I905c14141ad4f207c8bcbb3c29d68c1f698f0530 --- examples/buttons/buttons-example.cpp | 27 +++++++++++----------- examples/flex-container/flex-container-example.cpp | 2 +- .../image-scaling-and-filtering-example.cpp | 12 +++++----- examples/image-view-svg/image-view-svg-example.cpp | 4 ++-- examples/image-view/image-view-example.cpp | 4 ++-- examples/line-mesh/line-mesh-example.cpp | 4 ++-- examples/logging/logging-example.cpp | 16 ++++++------- examples/mesh-visual/mesh-visual-example.cpp | 22 +++++++++--------- examples/model3d-view/model3d-view-example.cpp | 6 ++--- .../native-image-source-example.cpp | 4 ++-- examples/popup/popup-example.cpp | 6 ++--- examples/progress-bar/progress-bar-example.cpp | 2 +- .../size-negotiation/size-negotiation-example.cpp | 2 +- examples/styling/styling-application.cpp | 12 +++++----- examples/text-field/text-field-example.cpp | 4 ++-- examples/transitions/transition-application.cpp | 6 ++--- 16 files changed, 66 insertions(+), 67 deletions(-) diff --git a/examples/buttons/buttons-example.cpp b/examples/buttons/buttons-example.cpp index 5904504..a21e2f2 100644 --- a/examples/buttons/buttons-example.cpp +++ b/examples/buttons/buttons-example.cpp @@ -204,7 +204,7 @@ class ButtonsController: public ConnectionTracker // Create select button mUpdateButton = Toolkit::PushButton::New(); - mUpdateButton.SetLabelText( "Select" ); + mUpdateButton.SetProperty( Toolkit::Button::Property::LABEL, "Select" ); mUpdateButton.SetName( "selectButton" ); mUpdateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); @@ -304,7 +304,7 @@ class ButtonsController: public ConnectionTracker { mCheckboxButton1 = Toolkit::CheckBoxButton::New(); mCheckboxButton1.SetName( "checkbox1" ); - mCheckboxButton1.SetLabelText( "CheckBox1 is unselected" ); + mCheckboxButton1.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is unselected" ); mCheckboxButton1.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); mCheckboxButton1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); @@ -314,9 +314,8 @@ class ButtonsController: public ConnectionTracker { mCheckboxButton2 = Toolkit::CheckBoxButton::New(); mCheckboxButton2.SetName( "checkbox2" ); - mCheckboxButton2.SetLabelText( "CheckBox2 is selected" ); + mCheckboxButton2.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is selected" ); mCheckboxButton2.SetProperty( Toolkit::Button::Property::SELECTED, true ); - mCheckboxButton2.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); mCheckboxButton2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); @@ -326,7 +325,7 @@ class ButtonsController: public ConnectionTracker { mCheckboxButton3 = Toolkit::CheckBoxButton::New(); mCheckboxButton3.SetName( "checkbox3" ); - mCheckboxButton3.SetLabelText( "CheckBox3 is unselected" ); + mCheckboxButton3.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is unselected" ); mCheckboxButton3.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); mCheckboxButton3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); @@ -349,7 +348,7 @@ class ButtonsController: public ConnectionTracker mToggleButton = Toolkit::PushButton::New(); mToggleButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true ); - mToggleButton.SetLabelText( "Unselected" ); + mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Unselected" ); mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); mToggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected ); @@ -377,11 +376,11 @@ class ButtonsController: public ConnectionTracker bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get(); if( isSelected ) { - pushButton.SetLabelText( "Selected" ); + pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Selected" ); } else { - pushButton.SetLabelText( "Unselected" ); + pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Unselected" ); } } @@ -452,11 +451,11 @@ class ButtonsController: public ConnectionTracker { if( isSelected ) { - button.SetLabelText("CheckBox1 is selected"); + button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is selected"); } else { - button.SetLabelText("CheckBox1 is unselected"); + button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is unselected"); } } @@ -464,11 +463,11 @@ class ButtonsController: public ConnectionTracker { if( isSelected ) { - button.SetLabelText("CheckBox2 is selected"); + button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is selected"); } else { - button.SetLabelText("CheckBox2 is unselected"); + button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is unselected"); } } @@ -476,11 +475,11 @@ class ButtonsController: public ConnectionTracker { if( isSelected ) { - button.SetLabelText("CheckBox3 is selected"); + button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is selected"); } else { - button.SetLabelText("CheckBox3 is unselected"); + button.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is unselected"); } } diff --git a/examples/flex-container/flex-container-example.cpp b/examples/flex-container/flex-container-example.cpp index 6898dbd..4178991 100644 --- a/examples/flex-container/flex-container-example.cpp +++ b/examples/flex-container/flex-container-example.cpp @@ -231,7 +231,7 @@ public: // Add a label to the button so that we can identify each item more easily std::ostringstream index; index << i + 1; - flexItem.SetLabelText(index.str()); + flexItem.SetProperty( Toolkit::Button::Property::LABEL, index.str() ); flexItem.SetName("FlexItem " + index.str()); // Set a fixed size to the items so that we can wrap the line and test these 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 f5d17c6..1c4563c 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 @@ -373,7 +373,7 @@ public: Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetStyleName( STYLE_BUTTON_TEXT ); button.SetName( id ); - button.SetLabelText( label ); + button.SetProperty( Toolkit::Button::Property::LABEL, label ); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &ImageScalingAndFilteringController::OnButtonClicked ); @@ -400,7 +400,7 @@ public: { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( id ); - button.SetLabelText( id ); + button.SetProperty( Toolkit::Button::Property::LABEL, id ); button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); button.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); @@ -489,7 +489,7 @@ public: if( button.GetName() == modeName ) { mFittingMode = mode; - mFittingModeButton.SetLabelText( modeName ); + mFittingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName ); ResizeImage(); mPopup.SetDisplayState( Toolkit::Popup::HIDDEN ); mPopup.Reset(); @@ -504,7 +504,7 @@ public: if( button.GetName() == modeName ) { mSamplingMode = mode; - mSamplingModeButton.SetLabelText( modeName ); + mSamplingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName ); ResizeImage(); mPopup.SetDisplayState( Toolkit::Popup::HIDDEN ); mPopup.Reset(); @@ -661,13 +661,13 @@ public: else if ( event.keyPressedName == "f" ) { mSamplingMode = NextFilterMode( mSamplingMode ); - mSamplingModeButton.SetLabelText( StringFromFilterMode( mSamplingMode ) ); + mSamplingModeButton.SetProperty( Toolkit::Button::Property::LABEL, StringFromFilterMode( mSamplingMode ) ); } // Cycle filter and scaling modes: else if ( event.keyPressedName == "s" ) { mFittingMode = NextScalingMode( mFittingMode ); - mFittingModeButton.SetLabelText( StringFromScalingMode( mFittingMode ) ); + mFittingModeButton.SetProperty( Toolkit::Button::Property::LABEL, StringFromScalingMode( mFittingMode ) ); } else { diff --git a/examples/image-view-svg/image-view-svg-example.cpp b/examples/image-view-svg/image-view-svg-example.cpp index 5617a73..613ecb7 100644 --- a/examples/image-view-svg/image-view-svg-example.cpp +++ b/examples/image-view-svg/image-view-svg-example.cpp @@ -82,7 +82,7 @@ public: // Push button, for changing the image set for displaying Toolkit::PushButton changeButton = Toolkit::PushButton::New(); - changeButton.SetLabelText( "Next" ); + changeButton.SetProperty( Toolkit::Button::Property::LABEL, "Next" ); changeButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); changeButton.SetParentOrigin( ParentOrigin::TOP_RIGHT ); stage.Add( changeButton ); @@ -91,7 +91,7 @@ public: // Push button, for resetting the actor size and position Toolkit::PushButton resetButton = Toolkit::PushButton::New(); - resetButton.SetLabelText( "Reset" ); + resetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" ); resetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); resetButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); stage.Add( resetButton ); diff --git a/examples/image-view/image-view-example.cpp b/examples/image-view/image-view-example.cpp index 15d37e8..bc41577 100644 --- a/examples/image-view/image-view-example.cpp +++ b/examples/image-view/image-view-example.cpp @@ -107,7 +107,7 @@ class ImageViewController: public ConnectionTracker buttonsTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); Toolkit::PushButton button = Toolkit::PushButton::New(); - button.SetLabelText( "Toggle on/off stage" ); + button.SetProperty( Toolkit::Button::Property::LABEL, "Toggle on/off stage" ); button.SetParentOrigin( ParentOrigin::CENTER ); button.SetAnchorPoint( AnchorPoint::CENTER ); button.ClickedSignal().Connect( this, &ImageViewController::ToggleImageOnStage ); @@ -115,7 +115,7 @@ class ImageViewController: public ConnectionTracker buttonsTable.AddChild( button, Toolkit::TableView::CellPosition( 0, 0 ) ); Toolkit::PushButton button2 = Toolkit::PushButton::New(); - button2.SetLabelText( "Change Image" ); + button2.SetProperty( Toolkit::Button::Property::LABEL, "Change Image" ); button2.SetParentOrigin( ParentOrigin::CENTER ); button2.SetAnchorPoint( AnchorPoint::CENTER ); button2.ClickedSignal().Connect( this, &ImageViewController::ChangeImageClicked ); diff --git a/examples/line-mesh/line-mesh-example.cpp b/examples/line-mesh/line-mesh-example.cpp index d642450..922da41 100644 --- a/examples/line-mesh/line-mesh-example.cpp +++ b/examples/line-mesh/line-mesh-example.cpp @@ -268,12 +268,12 @@ public: elementCountTableView.SetFitWidth( 1 ); elementCountTableView.SetFitWidth( 2 ); mMinusButton = Toolkit::PushButton::New(); - mMinusButton.SetLabelText( "<<" ); + mMinusButton.SetProperty( Toolkit::Button::Property::LABEL, "<<" ); mMinusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); mMinusButton.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); Toolkit::PushButton mPlusButton = Toolkit::PushButton::New(); - mPlusButton.SetLabelText( ">>" ); + mPlusButton.SetProperty( Toolkit::Button::Property::LABEL, ">>" ); mPlusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); mPlusButton.SetAnchorPoint( AnchorPoint::CENTER_RIGHT ); diff --git a/examples/logging/logging-example.cpp b/examples/logging/logging-example.cpp index 02cc1ba..21e1ef5 100644 --- a/examples/logging/logging-example.cpp +++ b/examples/logging/logging-example.cpp @@ -294,7 +294,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( CREATE_BUTTON_ID ); - button.SetLabelText( CREATE_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, CREATE_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -305,7 +305,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( DELETE_BUTTON_ID ); - button.SetLabelText( DELETE_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, DELETE_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -327,7 +327,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( START_BUTTON_ID ); - button.SetLabelText( START_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, START_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -338,7 +338,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( STOP_BUTTON_ID ); - button.SetLabelText( STOP_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, STOP_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -359,7 +359,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( ENABLE_BUTTON_ID ); - button.SetLabelText( ENABLE_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, ENABLE_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -370,7 +370,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( DISABLE_BUTTON_ID ); - button.SetLabelText( DISABLE_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, DISABLE_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -453,7 +453,7 @@ class LoggingController: public ConnectionTracker { Toolkit::PushButton button = Toolkit::PushButton::New(); button.SetName( VSYNC_BUTTON_ID ); - button.SetLabelText( VSYNC_BUTTON_TEXT ); + button.SetProperty( Toolkit::Button::Property::LABEL, VSYNC_BUTTON_TEXT); button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); @@ -473,7 +473,7 @@ class LoggingController: public ConnectionTracker << ", " << ((mLoggerStates[i].isTiming) ? "Started" : "Stopped") << ", " << ((mLoggerStates[i].isEnabled) ? "Enabled" : "Disabled"); - mLogRadioButtons[i].SetLabelText( ss.str() ); + mLogRadioButtons[i].SetProperty( Toolkit::Button::Property::LABEL, ss.str() ); } } diff --git a/examples/mesh-visual/mesh-visual-example.cpp b/examples/mesh-visual/mesh-visual-example.cpp index e8674c9..24901bd 100644 --- a/examples/mesh-visual/mesh-visual-example.cpp +++ b/examples/mesh-visual/mesh-visual-example.cpp @@ -183,7 +183,7 @@ public: modelButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeModelClicked ); modelButton.SetParentOrigin( ParentOrigin::TOP_CENTER ); modelButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - modelButton.SetLabelText( "Model" ); + modelButton.SetProperty( Toolkit::Button::Property::LABEL, "Model" ); positionActorModel.Add( modelButton ); //Create button for shading mode changing. @@ -192,7 +192,7 @@ public: shadingModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeShadingModeClicked ); shadingModeButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); shadingModeButton.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - shadingModeButton.SetLabelText( "Shading Mode" ); + shadingModeButton.SetProperty( Toolkit::Button::Property::LABEL, "Shading Mode" ); positionActorModel.Add( shadingModeButton ); //Text label title for changing model or shading mode. @@ -209,7 +209,7 @@ public: pauseButton.ClickedSignal().Connect( this, &MeshVisualController::OnPauseClicked ); pauseButton.SetParentOrigin( Vector3( 0.5, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) ); pauseButton.SetAnchorPoint( AnchorPoint::CENTER ); - pauseButton.SetLabelText( PAUSE ); + pauseButton.SetProperty( Toolkit::Button::Property::LABEL, PAUSE ); layer.Add( pauseButton ); //Actor for positioning light position buttons. @@ -224,7 +224,7 @@ public: lightModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightModeClicked ); lightModeButton.SetParentOrigin( ParentOrigin::TOP_CENTER ); lightModeButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - lightModeButton.SetLabelText( FIXED ); + lightModeButton.SetProperty( Toolkit::Button::Property::LABEL, FIXED ); positionActorLight.Add( lightModeButton ); //Create button for switching between front and back light position. @@ -233,7 +233,7 @@ public: lightSideButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightSideClicked ); lightSideButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); lightSideButton.SetAnchorPoint( AnchorPoint::TOP_CENTER ); - lightSideButton.SetLabelText( FRONT ); + lightSideButton.SetProperty( Toolkit::Button::Property::LABEL, FRONT ); positionActorLight.Add( lightSideButton ); //Text label title for light position mode. @@ -504,7 +504,7 @@ public: mModels[i].rotationAnimation.Pause(); } - button.SetLabelText( PLAY ); + button.SetProperty( Toolkit::Button::Property::LABEL, PLAY ); } else //Unpause all animations again. { @@ -513,7 +513,7 @@ public: mModels[i].rotationAnimation.Play(); } - button.SetLabelText( PAUSE ); + button.SetProperty( Toolkit::Button::Property::LABEL, PAUSE ); } return true; @@ -528,11 +528,11 @@ public: if( mLightFixed ) { - button.SetLabelText( FIXED ); + button.SetProperty( Toolkit::Button::Property::LABEL, FIXED ); } else { - button.SetLabelText( MANUAL ); + button.SetProperty( Toolkit::Button::Property::LABEL, MANUAL ); } SetLightMode(); @@ -548,11 +548,11 @@ public: if( mLightFront ) { - button.SetLabelText( FRONT ); + button.SetProperty( Toolkit::Button::Property::LABEL, FRONT ); } else { - button.SetLabelText( BACK ); + button.SetProperty( Toolkit::Button::Property::LABEL, BACK ); } //Change light image. diff --git a/examples/model3d-view/model3d-view-example.cpp b/examples/model3d-view/model3d-view-example.cpp index 21e7553..08cb8fa 100644 --- a/examples/model3d-view/model3d-view-example.cpp +++ b/examples/model3d-view/model3d-view-example.cpp @@ -117,7 +117,7 @@ public: editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeModelClicked); editButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); editButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - editButton.SetLabelText( "Change Model" ); + editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Model" ); mButtonLayer.Add( editButton ); // Create button for shader changing @@ -126,7 +126,7 @@ public: editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeLightingClicked); editButton.SetParentOrigin( ParentOrigin::TOP_RIGHT ); editButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); - editButton.SetLabelText( "Change Shader" ); + editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Shader" ); mButtonLayer.Add( editButton ); // Create button for pause/resume animation @@ -135,7 +135,7 @@ public: editButton.ClickedSignal().Connect( this, &Model3dViewController::OnPauseAnimationsClicked); editButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); editButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - editButton.SetLabelText( "Pause Animations" ); + editButton.SetProperty( Toolkit::Button::Property::LABEL, "Pause Animations" ); mButtonLayer.Add( editButton ); //Create animations diff --git a/examples/native-image-source/native-image-source-example.cpp b/examples/native-image-source/native-image-source-example.cpp index 828bef1..f9f7a54 100644 --- a/examples/native-image-source/native-image-source-example.cpp +++ b/examples/native-image-source/native-image-source-example.cpp @@ -155,14 +155,14 @@ public: mButtonRefreshAlways = PushButton::New(); mButtonRefreshAlways.SetProperty( Button::Property::TOGGLABLE, true ); mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, true ); - mButtonRefreshAlways.SetLabelText( "Refresh ALWAYS" ); + mButtonRefreshAlways.SetProperty( Toolkit::Button::Property::LABEL, "Refresh ALWAYS" ); mButtonRefreshAlways.SetParentOrigin( ParentOrigin::TOP_LEFT ); mButtonRefreshAlways.SetAnchorPoint( AnchorPoint::TOP_LEFT ); mButtonRefreshAlways.StateChangedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); stage.Add( mButtonRefreshAlways ); mButtonRefreshOnce = PushButton::New(); - mButtonRefreshOnce.SetLabelText( "Refresh ONCE" ); + mButtonRefreshOnce.SetProperty( Toolkit::Button::Property::LABEL, "Refresh ONCE" ); mButtonRefreshOnce.SetParentOrigin( ParentOrigin::TOP_RIGHT ); mButtonRefreshOnce.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); mButtonRefreshOnce.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected ); diff --git a/examples/popup/popup-example.cpp b/examples/popup/popup-example.cpp index cebffd9..a2427ea 100644 --- a/examples/popup/popup-example.cpp +++ b/examples/popup/popup-example.cpp @@ -428,7 +428,7 @@ public: { Toolkit::PushButton okayButton = Toolkit::PushButton::New(); okayButton.SetName( POPUP_CONTROL_OK_NAME ); - okayButton.SetLabelText( "OK!" ); + okayButton.SetProperty( Toolkit::Button::Property::LABEL, "OK!" ); okayButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked ); @@ -439,7 +439,7 @@ public: { Toolkit::PushButton cancelButton = Toolkit::PushButton::New(); cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME ); - cancelButton.SetLabelText( "Cancel" ); + cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" ); cancelButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked ); @@ -708,7 +708,7 @@ public: // From ItemFactory { Toolkit::PushButton popupButton = Toolkit::PushButton::New(); popupButton.SetName( POPUP_BUTTON_ITEMS[ itemId ].name ); - popupButton.SetLabelText( POPUP_BUTTON_ITEMS[ itemId ].text ); + popupButton.SetProperty( Toolkit::Button::Property::LABEL, POPUP_BUTTON_ITEMS[ itemId ].text ); popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); popupButton.ClickedSignal().Connect( this, &PopupExample::OnButtonClicked ); diff --git a/examples/progress-bar/progress-bar-example.cpp b/examples/progress-bar/progress-bar-example.cpp index d63b5ec..aca1a53 100644 --- a/examples/progress-bar/progress-bar-example.cpp +++ b/examples/progress-bar/progress-bar-example.cpp @@ -143,7 +143,7 @@ private: contentTable.Add( buttonBackground ); mResetProgressButton = Toolkit::PushButton::New(); - mResetProgressButton.SetLabelText( "Reset" ); + mResetProgressButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" ); mResetProgressButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); mResetProgressButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); mResetProgressButton.ClickedSignal().Connect( this, &ProgressBarExample::OnResetProgressButtonSelected ); diff --git a/examples/size-negotiation/size-negotiation-example.cpp b/examples/size-negotiation/size-negotiation-example.cpp index 5e03efa..7d2962a 100644 --- a/examples/size-negotiation/size-negotiation-example.cpp +++ b/examples/size-negotiation/size-negotiation-example.cpp @@ -800,7 +800,7 @@ public: // From ItemFactory { Toolkit::PushButton popupButton = Toolkit::PushButton::New(); popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name ); - popupButton.SetLabelText( TABLEVIEW_BUTTON_ITEMS[ itemId ].text ); + popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text ); popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); diff --git a/examples/styling/styling-application.cpp b/examples/styling/styling-application.cpp index 4a6c8ea..19a1411 100644 --- a/examples/styling/styling-application.cpp +++ b/examples/styling/styling-application.cpp @@ -309,7 +309,7 @@ void StylingApplication::Create( Application& application ) } mResetButton = PushButton::New(); - mResetButton.SetLabelText( "Reset" ); + mResetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" ); mResetButton.SetName("ResetButton"); mResetButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); mResetButton.ClickedSignal().Connect( this, &StylingApplication::OnResetClicked ); @@ -349,9 +349,9 @@ void StylingApplication::Create( Application& application ) mThemeButtons[i].ClickedSignal().Connect( this, &StylingApplication::OnThemeButtonClicked ); themeButtonLayout.AddChild( mThemeButtons[i], TableView::CellPosition( 0, 1+i ) ); } - mThemeButtons[0].SetLabelText( "Lite" ); // Lightweight changes on top of Dali - mThemeButtons[1].SetLabelText( "App1" ); // Different application style - mThemeButtons[2].SetLabelText( "App2" ); + mThemeButtons[0].SetProperty( Toolkit::Button::Property::LABEL, "Lite" ); // Lightweight changes on top of Dali + mThemeButtons[1].SetProperty( Toolkit::Button::Property::LABEL, "App1" ); // Different application style + mThemeButtons[2].SetProperty( Toolkit::Button::Property::LABEL, "App2" ); contentLayout.Add( themeButtonLayout ); } @@ -438,7 +438,7 @@ Popup StylingApplication::CreateResetPopup() PushButton okayButton = PushButton::New(); okayButton.SetName( POPUP_CONTROL_OK_NAME ); okayButton.SetStyleName( POPUP_CONTROL_OK_NAME ); - okayButton.SetLabelText( "Ok!" ); + okayButton.SetProperty( Toolkit::Button::Property::LABEL, "Ok!" ); okayButton.ClickedSignal().Connect( this, &StylingApplication::OnReset ); okayButton.SetParentOrigin( ParentOrigin::CENTER ); okayButton.SetAnchorPoint( AnchorPoint::CENTER ); @@ -448,7 +448,7 @@ Popup StylingApplication::CreateResetPopup() PushButton cancelButton = PushButton::New(); cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME ); cancelButton.SetStyleName( POPUP_CONTROL_CANCEL_NAME ); - cancelButton.SetLabelText( "Cancel" ); + cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" ); cancelButton.ClickedSignal().Connect( this, &StylingApplication::OnResetCancelled ); cancelButton.SetParentOrigin( ParentOrigin::CENTER ); cancelButton.SetAnchorPoint( AnchorPoint::CENTER ); diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp index 70e7e7d..5e025b1 100644 --- a/examples/text-field/text-field-example.cpp +++ b/examples/text-field/text-field-example.cpp @@ -152,7 +152,7 @@ public: { Property::Value text = mField.GetProperty( TextField::Property::TEXT ); mButtonLabel = text.Get< std::string >(); - mButton.SetLabelText( mButtonLabel ); + mButton.SetProperty( Toolkit::Button::Property::LABEL, mButtonLabel ); } // Hide & discard the pop-up @@ -177,7 +177,7 @@ public: { Property::Value text = mField.GetProperty( TextField::Property::TEXT ); mButtonLabel = text.Get< std::string >(); - mButton.SetLabelText( mButtonLabel ); + mButton.SetProperty( Toolkit::Button::Property::LABEL, mButtonLabel ); mField.ClearKeyInputFocus(); } break; diff --git a/examples/transitions/transition-application.cpp b/examples/transitions/transition-application.cpp index ab0daf0..cf4312b 100644 --- a/examples/transitions/transition-application.cpp +++ b/examples/transitions/transition-application.cpp @@ -125,9 +125,9 @@ void TransitionApplication::Create( Application& application ) mActionButtons[i].ClickedSignal().Connect( this, &TransitionApplication::OnActionButtonClicked ); actionButtonLayout.AddChild( mActionButtons[i], TableView::CellPosition( 0, 1+i ) ); } - mActionButtons[0].SetLabelText( "Bounce" ); - mActionButtons[1].SetLabelText( "X" ); - mActionButtons[2].SetLabelText( "Y" ); + mActionButtons[0].SetProperty( Toolkit::Button::Property::LABEL, "Bounce" ); + mActionButtons[1].SetProperty( Toolkit::Button::Property::LABEL, "X" ); + mActionButtons[2].SetProperty( Toolkit::Button::Property::LABEL, "Y" ); contentLayout.Add( actionButtonLayout ); contentLayout.SetFitHeight(2); -- 2.7.4