-void PushButton::SetAutoRepeating( bool autoRepeating )
-{
- mAutoRepeating = autoRepeating;
-
- // An autorepeating button can't be a toggle button.
- if( autoRepeating )
- {
- mToggleButton = false;
- if( mToggled )
- {
- // Emit a signal is not wanted, only change the appearance.
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->Toggled( handle );
- mToggled = false;
- }
- }
-
- // Notifies the painter.
- GetPushButtonPainter( mPainter )->SetAutoRepeating( mAutoRepeating );
-}
-
-bool PushButton::IsAutoRepeating() const
-{
- return mAutoRepeating;
-}
-
-void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
-{
- DALI_ASSERT_ALWAYS( initialAutoRepeatingDelay > 0.f );
- mInitialAutoRepeatingDelay = initialAutoRepeatingDelay;
-}
-
-float PushButton::GetInitialAutoRepeatingDelay() const
-{
- return mInitialAutoRepeatingDelay;
-}
-
-void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
-{
- DALI_ASSERT_ALWAYS( nextAutoRepeatingDelay > 0.f );
- mNextAutoRepeatingDelay = nextAutoRepeatingDelay;
-}
-
-float PushButton::GetNextAutoRepeatingDelay() const
-{
- return mNextAutoRepeatingDelay;
-}
-
-void PushButton::SetToggleButton( bool toggle )
-{
- mToggleButton = toggle;
-
- // A toggle button can't be an autorepeating button.
- if( toggle )
- {
- mAutoRepeating = false;
-
- // Notifies the painter.
- GetPushButtonPainter( mPainter )->SetAutoRepeating( mAutoRepeating );
- }
-}
-
-bool PushButton::IsToggleButton() const
-{
- return mToggleButton;
-}
-
-void PushButton::SetToggled( bool toggle )
-{
- if( !mDisabled && mToggleButton && ( toggle != mToggled ) )
- {
- mToggled = toggle;
-
- Toolkit::PushButton handle( GetOwner() );
-
- // Notifies the painter the button has been toggled.
- GetPushButtonPainter( mPainter )->Toggled( handle );
-
- // Emit signal.
- mStateChangedSignal.Emit( handle, mToggled );
- }
-}
-
-bool PushButton::IsToggled() const
-{
- return mToggleButton && mToggled;
-}
-
-void PushButton::SetButtonImage( Image image )
-{
- SetButtonImage( ImageActor::New( image ) );
-}
-
-void PushButton::SetButtonImage( Actor image )
-{
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetButtonImage( handle, image );
-}
-
-Actor& PushButton::GetButtonImage()
-{
- return mButtonImage;
-}
-
-Actor PushButton::GetButtonImage() const
-{
- return mButtonImage;
-}
-
-void PushButton::SetBackgroundImage( Image image )
-{
- SetBackgroundImage( ImageActor::New( image ) );
-}
-
-void PushButton::SetBackgroundImage( Actor image )
-{
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetBackgroundImage( handle, image );
-}
-
-Actor& PushButton::GetBackgroundImage()
-{
- return mBackgroundImage;
-}
-
-Actor PushButton::GetBackgroundImage() const
-{
- return mBackgroundImage;
-}
-
-void PushButton::SetSelectedImage( Image image )
-{
- SetSelectedImage( ImageActor::New( image ) );
-}
-
-void PushButton::SetSelectedImage( Actor image )
-{
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetSelectedImage( handle, image );
-}
-
-Actor& PushButton::GetSelectedImage()
-{
- return mSelectedImage;
-}
-
-Actor PushButton::GetSelectedImage() const
-{
- return mSelectedImage;
-}
-
-void PushButton::SetDisabledBackgroundImage( Image image )
-{
- SetDisabledBackgroundImage( ImageActor::New( image ) );
-}
-
-void PushButton::SetDisabledBackgroundImage( Actor image )
-{
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetDisabledBackgroundImage( handle, image );
-}
-
-Actor& PushButton::GetDisabledBackgroundImage()
-{
- return mDisabledBackgroundImage;
-}
-
-Actor PushButton::GetDisabledBackgroundImage() const
-{
- return mDisabledBackgroundImage;
-}
-
-void PushButton::SetDisabledImage( Image image )
-{
- SetDisabledImage( ImageActor::New( image ) );
-}
-
-void PushButton::SetDisabledImage( Actor image )
-{
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetDisabledImage( handle, image );
-}
-
-Actor& PushButton::GetDisabledImage()
-{
- return mDisabledImage;
-}
-
-Actor PushButton::GetDisabledImage() const
-{
- return mDisabledImage;
-}
-
-void PushButton::SetLabel( const std::string& label )
-{
- Toolkit::TextView textView ( Toolkit::TextView::New( label ) );
- textView.SetWidthExceedPolicy( Toolkit::TextView::ShrinkToFit ); // Make sure our text always fits inside the button
- SetLabel( textView );
-}
-
-void PushButton::SetLabel( Actor label )
-{
- Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetLabel( handle, label );
-}
-
-Actor PushButton::GetLabel() const
-{
- return mLabel;
-}
-
-Actor& PushButton::GetLabel()
-{
- return mLabel;
-}
-
-Actor& PushButton::GetFadeOutBackgroundImage()
-{
- return mFadeOutBackgroundImage;
-}
-
-Actor& PushButton::GetFadeOutButtonImage()
-{
- return mFadeOutButtonImage;
-}
-
-Toolkit::PushButton::PressedSignalType& PushButton::PressedSignal()
-{
- return mPressedSignal;
-}
-
-Toolkit::PushButton::ReleasedSignalType& PushButton::ReleasedSignal()