Commit fda6bc69b3bed04fac0de742b7d5bbbaa9d43f01
1 parent
3dcfa7a9
Update demos to not use deprecated Button API
Change-Id: Iaf8e17feb02567a92f2ff83a050e8bc6652212a0
Showing
2 changed files
with
31 additions
and
21 deletions
examples/video-view/video-view-example.cpp
| @@ -143,13 +143,13 @@ class VideoViewController: public ConnectionTracker | @@ -143,13 +143,13 @@ class VideoViewController: public ConnectionTracker | ||
| 143 | mMenu.Add( mForwardButton ); | 143 | mMenu.Add( mForwardButton ); |
| 144 | 144 | ||
| 145 | mPauseButton.SetVisible( false ); | 145 | mPauseButton.SetVisible( false ); |
| 146 | - mPauseButton.SetDisabled( true ); | 146 | + mPauseButton.SetProperty( Button::Property::DISABLED, true ); |
| 147 | mPlayButton.SetVisible( true ); | 147 | mPlayButton.SetVisible( true ); |
| 148 | - mPlayButton.SetDisabled( false ); | 148 | + mPlayButton.SetProperty( Button::Property::DISABLED, false ); |
| 149 | mStopButton.SetVisible( true ); | 149 | mStopButton.SetVisible( true ); |
| 150 | - mStopButton.SetDisabled( false ); | 150 | + mStopButton.SetProperty( Button::Property::DISABLED, false ); |
| 151 | mResetButton.SetVisible( false ); | 151 | mResetButton.SetVisible( false ); |
| 152 | - mResetButton.SetDisabled( true ); | 152 | + mResetButton.SetProperty( Button::Property::DISABLED, true ); |
| 153 | 153 | ||
| 154 | mPlayButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_IMAGE ); | 154 | mPlayButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_IMAGE ); |
| 155 | mPlayButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_IMAGE ); | 155 | mPlayButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_IMAGE ); |
| @@ -198,9 +198,9 @@ class VideoViewController: public ConnectionTracker | @@ -198,9 +198,9 @@ class VideoViewController: public ConnectionTracker | ||
| 198 | if( mIsPlay ) | 198 | if( mIsPlay ) |
| 199 | { | 199 | { |
| 200 | mPauseButton.SetVisible( false ); | 200 | mPauseButton.SetVisible( false ); |
| 201 | - mPauseButton.SetDisabled( true ); | 201 | + mPauseButton.SetProperty( Button::Property::DISABLED, true ); |
| 202 | mPlayButton.SetVisible( true ); | 202 | mPlayButton.SetVisible( true ); |
| 203 | - mPlayButton.SetDisabled( false ); | 203 | + mPlayButton.SetProperty( Button::Property::DISABLED, false ); |
| 204 | 204 | ||
| 205 | mIsPlay = false; | 205 | mIsPlay = false; |
| 206 | mVideoView.Pause(); | 206 | mVideoView.Pause(); |
| @@ -214,9 +214,9 @@ class VideoViewController: public ConnectionTracker | @@ -214,9 +214,9 @@ class VideoViewController: public ConnectionTracker | ||
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | mPauseButton.SetVisible( true ); | 216 | mPauseButton.SetVisible( true ); |
| 217 | - mPauseButton.SetDisabled( false ); | 217 | + mPauseButton.SetProperty( Button::Property::DISABLED, false ); |
| 218 | mPlayButton.SetVisible( false ); | 218 | mPlayButton.SetVisible( false ); |
| 219 | - mPlayButton.SetDisabled( true ); | 219 | + mPlayButton.SetProperty( Button::Property::DISABLED, true ); |
| 220 | 220 | ||
| 221 | mIsPlay = true; | 221 | mIsPlay = true; |
| 222 | mVideoView.Play(); | 222 | mVideoView.Play(); |
| @@ -226,13 +226,13 @@ class VideoViewController: public ConnectionTracker | @@ -226,13 +226,13 @@ class VideoViewController: public ConnectionTracker | ||
| 226 | if( mIsStop ) | 226 | if( mIsStop ) |
| 227 | { | 227 | { |
| 228 | mPauseButton.SetVisible( true ); | 228 | mPauseButton.SetVisible( true ); |
| 229 | - mPauseButton.SetDisabled( false ); | 229 | + mPauseButton.SetProperty( Button::Property::DISABLED, false ); |
| 230 | mPlayButton.SetVisible( false ); | 230 | mPlayButton.SetVisible( false ); |
| 231 | - mPlayButton.SetDisabled( true ); | 231 | + mPlayButton.SetProperty( Button::Property::DISABLED, true ); |
| 232 | mResetButton.SetVisible( false ); | 232 | mResetButton.SetVisible( false ); |
| 233 | - mResetButton.SetDisabled( true ); | 233 | + mResetButton.SetProperty( Button::Property::DISABLED, true ); |
| 234 | mStopButton.SetVisible( true ); | 234 | mStopButton.SetVisible( true ); |
| 235 | - mStopButton.SetDisabled( false ); | 235 | + mStopButton.SetProperty( Button::Property::DISABLED, false ); |
| 236 | 236 | ||
| 237 | mIsStop = false; | 237 | mIsStop = false; |
| 238 | mIsPlay = true; | 238 | mIsPlay = true; |
| @@ -243,13 +243,13 @@ class VideoViewController: public ConnectionTracker | @@ -243,13 +243,13 @@ class VideoViewController: public ConnectionTracker | ||
| 243 | else if( mStopButton.GetId() == button.GetId()) | 243 | else if( mStopButton.GetId() == button.GetId()) |
| 244 | { | 244 | { |
| 245 | mPauseButton.SetVisible( false ); | 245 | mPauseButton.SetVisible( false ); |
| 246 | - mPauseButton.SetDisabled( true ); | 246 | + mPauseButton.SetProperty( Button::Property::DISABLED, true ); |
| 247 | mPlayButton.SetVisible( true ); | 247 | mPlayButton.SetVisible( true ); |
| 248 | - mPlayButton.SetDisabled( false ); | 248 | + mPlayButton.SetProperty( Button::Property::DISABLED, false ); |
| 249 | mResetButton.SetVisible( true ); | 249 | mResetButton.SetVisible( true ); |
| 250 | - mResetButton.SetDisabled( false ); | 250 | + mPlayButton.SetProperty( Button::Property::DISABLED, false ); |
| 251 | mStopButton.SetVisible( false ); | 251 | mStopButton.SetVisible( false ); |
| 252 | - mStopButton.SetDisabled( true ); | 252 | + mStopButton.SetProperty( Button::Property::DISABLED, true ); |
| 253 | 253 | ||
| 254 | mIsStop = true; | 254 | mIsStop = true; |
| 255 | mVideoView.Stop(); | 255 | mVideoView.Stop(); |
examples/visual-transitions/transition-application.cpp
| @@ -35,6 +35,16 @@ | @@ -35,6 +35,16 @@ | ||
| 35 | using namespace Dali; | 35 | using namespace Dali; |
| 36 | using namespace Dali::Toolkit; | 36 | using namespace Dali::Toolkit; |
| 37 | 37 | ||
| 38 | +namespace | ||
| 39 | +{ | ||
| 40 | + | ||
| 41 | +void SetLabelText( Button button, const char* label ) | ||
| 42 | +{ | ||
| 43 | + button.SetProperty( Toolkit::Button::Property::LABEL, label ); | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +} | ||
| 47 | + | ||
| 38 | namespace Demo | 48 | namespace Demo |
| 39 | { | 49 | { |
| 40 | 50 | ||
| @@ -43,7 +53,6 @@ const char* DALI_LOGO_PATH( DEMO_IMAGE_DIR "Logo-for-demo.png" ); | @@ -43,7 +53,6 @@ const char* DALI_LOGO_PATH( DEMO_IMAGE_DIR "Logo-for-demo.png" ); | ||
| 43 | const char* DALI_ROBOT_MODEL_PATH( DEMO_MODEL_DIR "ToyRobot-Metal.obj" ); | 53 | const char* DALI_ROBOT_MODEL_PATH( DEMO_MODEL_DIR "ToyRobot-Metal.obj" ); |
| 44 | const char* DALI_ROBOT_MATERIAL_PATH( DEMO_MODEL_DIR "ToyRobot-Metal.mtl" ); | 54 | const char* DALI_ROBOT_MATERIAL_PATH( DEMO_MODEL_DIR "ToyRobot-Metal.mtl" ); |
| 45 | 55 | ||
| 46 | - | ||
| 47 | TransitionApplication::TransitionApplication( Application& application ) | 56 | TransitionApplication::TransitionApplication( Application& application ) |
| 48 | : mApplication( application ), | 57 | : mApplication( application ), |
| 49 | mTitle(), | 58 | mTitle(), |
| @@ -151,10 +160,11 @@ void TransitionApplication::Create( Application& application ) | @@ -151,10 +160,11 @@ void TransitionApplication::Create( Application& application ) | ||
| 151 | mActionButtons[i].ClickedSignal().Connect( this, &TransitionApplication::OnActionButtonClicked ); | 160 | mActionButtons[i].ClickedSignal().Connect( this, &TransitionApplication::OnActionButtonClicked ); |
| 152 | actionButtonLayout.AddChild( mActionButtons[i], TableView::CellPosition( 0, 1+i ) ); | 161 | actionButtonLayout.AddChild( mActionButtons[i], TableView::CellPosition( 0, 1+i ) ); |
| 153 | } | 162 | } |
| 154 | - mActionButtons[0].SetLabelText( "Bounce" ); | ||
| 155 | - mActionButtons[1].SetLabelText( "X" ); | ||
| 156 | - mActionButtons[2].SetLabelText( "Y" ); | ||
| 157 | - mActionButtons[3].SetLabelText( "Fade" ); | 163 | + |
| 164 | + SetLabelText( mActionButtons[0], "Bounce" ); | ||
| 165 | + SetLabelText( mActionButtons[1], "X" ); | ||
| 166 | + SetLabelText( mActionButtons[2], "Y" ); | ||
| 167 | + SetLabelText( mActionButtons[3], "Fade" ); | ||
| 158 | 168 | ||
| 159 | contentLayout.Add( actionButtonLayout ); | 169 | contentLayout.Add( actionButtonLayout ); |
| 160 | contentLayout.SetFitHeight(3); | 170 | contentLayout.SetFitHeight(3); |