Change-Id: Id1c720dee217bfd2a81b2647c2a8227351fc3616
-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 )
}
void Button::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
*/
virtual float OnAnimationTimeRequested() const;
*/
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() { }
+
*/
virtual void OnControlSizeSet( const Vector3& targetSize );
*/
virtual void OnControlSizeSet( const Vector3& targetSize );
+ /**
+ * Callback received when the button is disconnected from the stage.
+ * It resets the button status.
+ */
+ void OnControlStageDisconnection();
+
- /**
- * Callback received when the button is disconected from the stage.
- * It resets the button status.
- */
- void OnStageDisconnection();
-
-private:
-
// Undefined
Button( const Button& );
// Undefined
Button( const Button& );
return GetPushButtonPainter( mPainter )->GetAnimationTime();
}
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 ),
PushButton::PushButton()
: Button(),
mAutoRepeating( false ),
*/
virtual float OnAnimationTimeRequested() const;
*/
virtual float OnAnimationTimeRequested() const;
+ /**
+ * This method is called when the button is removed from the stage.
+ */
+ virtual void OnButtonStageDisconnection();
+
protected: // From Control
/**
protected: // From Control
/**