Important: The information in this document is obsolete and should not be used for new development.
MyPanelValidateInput
A control panel extension must respond to thekPanelValidateInputSelect
request code. A control panel sends this request code to your extension whenever the user clicks a control panel's close box. A control panel extension typically responds to thekPanelValidateInputSelect
request code by calling an extension-defined subroutine (for example,MyPanelValidateInput
) to handle the request.
FUNCTION MyPanelValidateInput (globals: Handle; VAR ok: Boolean) : ComponentResult;
globals
- A handle to the control panel extension's global data.
ok
- On return, a Boolean value that indicates whether the panel's current values are valid (
TRUE
) or invalid (FALSE
).DESCRIPTION
YourMyPanelValidateInput
function should perform any processing necessary to validate the current settings in the panel. For example, if your panel contains any editable text items, you might need to ensure that the text they contain makes sense. The control panel calls this function when the user clicks the control panel's close box.If the current settings of the panel items are acceptable, set the
ok
parameter toTRUE
before returning fromMyPanelValidateInput
. If the current settings are not valid, setok
toFALSE
. When you setok
toFALSE
, the control panel ignores any of the user's subsequent clicks in the panel's OK button.RESULT CODES
YourMyPanelValidateInput
function should returnnoErr
if successful, or an appropriate result code otherwise.