Classes

Message XbpPushButton():xbeP_Activate Foundation

Executes the method or code block that is linked to the pushbutton.

Syntax
:activate := {| uNIL1, uNIL2, self | ... }
:activate () --> self
Return

This method returns the object executing the method (self).

Description

The xbeP_Activate event is generated after the pushbutton is pressed by the user. This occurs when the left mouse button is clicked or the space bar is pressed when the pushbutton has the input focus. The callback method :activate() is executed followed by the callback code block contained in the instance variable :activate.

The callback method in the XbpPushbutton class implements default processing for default pushbuttons in modal dialogs. A modal dialog is an Xbase Part displayed using method XbpDialog:showModal() or XbpCrt:showModal(). A default pushbutton is a button designated to close the dialog. These default pushbutton objects usually have assigned a caption such as "Ok" or "Cancel" to their :caption. instance variables.

If the XbpPushbutton object is contained in a modal dialog and the pushbutton's :default. instance variable contains .T. (TRUE), then activating the pushbutton object automatically terminates the modal dialog. This behaviour is implemented in the callback method :activate, which terminates the modal dialog by assigning the value XBP_MRESULT_OK to the XbpDialog:modalResult or XbpCrt:modalResultinstance variable. If the pushbutton is the form's cancel button and the :cancel. instance variable is .T. (TRUE), the value XBP_MRESULT_CANCEL is used instead.

The action performed by objects of the XbpPushButton class must be defined as a code block contained in the :activate callback slot. The action associated with an XbpPushbutton object can also be implemented by overriding the method :activate in a derived class. However, to have the derived class behave like a normal pushbutton, the derived implementation of :activate must also call the implementation inherited from the base class. Otherwise, default behaviour for "Ok" and "Cancel" pushbuttons will not be available.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.