// Do nothing.
}
-void Button::OnStageDisconnection()
+void Button::OnControlStageDisconnection()
{
- if( ButtonUp != mState )
- {
- OnTouchPointLeave(); // Notification for derived classes.
- mState = ButtonUp;
- }
+ OnButtonStageDisconnection(); // Notification for derived classes.
+ mState = ButtonUp;
}
void Button::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
*/
virtual float OnAnimationTimeRequested() const;
+ /**
+ * This method is called when the button is removed from the stage.
+ * Could be reimplemented in subclasses to provide specific behaviour.
+ */
+ virtual void OnButtonStageDisconnection() { }
+
public:
/**
*/
virtual void OnControlSizeSet( const Vector3& targetSize );
+ /**
+ * Callback received when the button is disconnected from the stage.
+ * It resets the button status.
+ */
+ void OnControlStageDisconnection();
+
private:
/**
private:
- /**
- * Callback received when the button is disconected from the stage.
- * It resets the button status.
- */
- void OnStageDisconnection();
-
-private:
-
// Undefined
Button( const Button& );
return GetPushButtonPainter( mPainter )->GetAnimationTime();
}
+void PushButton::OnButtonStageDisconnection()
+{
+ if( ButtonDown == mState )
+ {
+ if( !mToggleButton )
+ {
+ Toolkit::PushButton handle( GetOwner() );
+
+ // Notifies the painter the button has been released.
+ GetPushButtonPainter( mPainter )->Released( handle );
+
+ if( mAutoRepeating )
+ {
+ mAutoRepeatingTimer.Reset();
+ }
+ }
+ }
+}
+
PushButton::PushButton()
: Button(),
mAutoRepeating( false ),
*/
virtual float OnAnimationTimeRequested() const;
+ /**
+ * This method is called when the button is removed from the stage.
+ */
+ virtual void OnButtonStageDisconnection();
+
protected: // From Control
/**