return false;
}
-void Button::OnButtonStageDisconnection()
-{
- if( ButtonDown == mState )
- {
- if( !mTogglableButton )
- {
- Released();
-
- if( mAutoRepeating )
- {
- mAutoRepeatingTimer.Reset();
- }
- }
- }
-}
-
void Button::OnButtonDown()
{
if( !mTogglableButton )
mTapDetector.Attach( self );
mTapDetector.DetectedSignal().Connect(this, &Button::OnTap);
- OnButtonInitialize();
-
self.SetKeyboardFocusable( true );
}
void Button::OnStageDisconnection()
{
- OnButtonStageDisconnection(); // Notification for derived classes.
+ if( ButtonDown == mState )
+ {
+ if( !mTogglableButton )
+ {
+ Released();
+
+ if( mAutoRepeating )
+ {
+ mAutoRepeatingTimer.Reset();
+ }
+ }
+ }
+
mState = ButtonUp;
Control::OnStageDisconnection();
bool DoClickAction( const Property::Map& attributes );
/**
- * This method is called after the button initialization.
- * Could be reimplemented in subclasses to provide specific behaviour.
- */
- virtual void OnButtonInitialize() { }
-
- /**
* This method is called when the label is set.
* @param[in] noPadding Used to bypass padding if the label is to be treated generically.
*/
virtual void OnTouchPointInterrupted();
/**
- * This method is called when the button is removed from the stage.
- * Could be reimplemented in subclasses to provide specific behaviour.
- */
- virtual void OnButtonStageDisconnection();
-
- /**
* This method is called when the \e selected property is changed.
*/
virtual void OnSelected() {}
*/
static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
-protected: // From CustomActorImpl
+protected: // From Control
/**
- * @copydoc Dali::CustomActorImpl::OnTouchEvent( const TouchEvent& event )
+ * @copydoc Dali::Control::OnTouchEvent( const TouchEvent& event )
*/
virtual bool OnTouchEvent( const TouchEvent& event );
-private: // From Control
-
/**
* @copydoc Toolkit::Control::OnInitialize()
+ * @note If overridden by deriving button classes, then an up-call to Button::OnInitialize MUST be made at the start.
*/
virtual void OnInitialize();
virtual bool OnKeyboardEnter();
/**
- * Callback received when the button is disconnected from the stage.
- * It resets the button status.
+ * @copydoc Toolkit::Control::OnStageDisconnection()
+ * @note If overridden by deriving button classes, then an up-call to Button::OnStageDisconnection MUST be made at the end.
*/
void OnStageDisconnection();
}
}
-void CheckBoxButton::OnButtonInitialize()
+void CheckBoxButton::OnInitialize()
{
+ Button::OnInitialize();
+
// Wrap around all children
Self().SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
/**
- * @copydoc Toolkit::Internal::Button::OnButtonInitialize
+ * @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnButtonInitialize();
+ virtual void OnInitialize();
/**
* @copydoc Toolkit::Internal::Button::OnLabelSet
{
}
-void PushButton::OnButtonInitialize()
+void PushButton::OnInitialize()
{
+ Button::OnInitialize();
+
// Push button requires the Leave event.
Actor self = Self();
self.SetLeaveRequired( true );
private: // From Button
/**
- * @copydoc Toolkit::Internal::Button::OnButtonInitialize
+ * @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnButtonInitialize();
+ virtual void OnInitialize();
/**
* @copydoc Toolkit::Internal::Button::OnLabelSet
{
}
-void RadioButton::OnButtonInitialize()
+void RadioButton::OnInitialize()
{
+ Button::OnInitialize();
+
Actor self = Self();
// Wrap size of radio button around all its children
private: // From Button
/**
- * @copydoc Toolkit::Internal::Button::OnButtonInitialize
+ * @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnButtonInitialize();
+ virtual void OnInitialize();
/**
* @copydoc Toolkit::Internal::Button::OnButtonUp