Standard Event Methods

The following methods are abstract methods that are called each time a push button with ID 1, 2, or 9 is pressed.

OK

>>-aBaseDialog~OK----------------------------------------------><


The OK method is called in response to a pressed OK button. It calls Validate to get its return code. The default return code is the self~finished attribute, which is usually 1, in which case the dialog is terminated.

Protected:

This method is protected. You might want to override it in your subclass. If you do, forward the OK message to the parent class after processing has finished. Set the self~finished attribute to 1 or 0 and return it. The dialog continues executing if you return the value 0. See also Validate.

Example:

The following example shows how to override the OK method:

::method OK
...
self~ok:super()
self~finished = 1
return self~finished

Cancel

>>-aBaseDialog~Cancel------------------------------------------><


The Cancel method is called in response to a pressed Cancel button. The default return code is the self~finished attribute, which is usually 1, in which case the dialog is terminated. The InitCode attribute is set to 2 if the dialog is terminated.

Protected:

This method is protected. You might want to override it in your subclass. If you do, forward the Cancel message to the parent class after processing has finished. Set the self~finished attribute to 1 or 0 and return it. The dialog continues executing if you return the value 0.

Help

>>-aBaseDialog~Help--------------------------------------------><


The Help method is called in response to a pressed Help button.

Protected:

This method is protected. You might want to override it in your subclass.

Validate

>>-aBaseDialog~Validate----------------------------------------><


The Validate method is an abstract method that is called to determine whether the dialog can be closed. This method is called by the OK method. The standard implementation is that Validate returns 1 and the dialog is closed. The dialog is not closed if Validate returns 0.

Protected:

The method is designed to be defined in a subclass.

Example:

In the following example Validate checks whether entry line 203 is empty. If it is empty, Validate returns 0, which indicates that the dialog cannot be closed.

::class MyDialog subclass UserDialog
::method Validate
   if self~GetEntryLine(203) = "" then return 0
   else return 1

Leaving

>>-aBaseDialog~Leaving-----------------------------------------><


The Leaving method is called when the dialog was closed.

DeInstall

>>-aBaseDialog~DeInstall---------------------------------------><


The DeInstall method removes the external functions from the Object Rexx API manager. It should be called at the end of each dialog. The installed functions are freed when all dialogs are finished.