Important: The information in this document is obsolete and should not be used for new development.
MyPanelRemove
A control panel extension must respond to thekPanelRemoveSelectrequest code. A control panel sends this request code to an extension just before removing the panel from the enclosing dialog box. A control panel extension typically responds to thekPanelRemoveSelectrequest code by calling an extension-defined subroutine (for example,MyPanelRemove) to handle the request.
FUNCTION MyPanelRemove (globals: Handle; dialog: DialogPtr; itemOffset: Integer): ComponentResult;
globals- A handle to the control panel extension's global data.
dialog- A pointer to the dialog record of the owning control panel.
itemOffset- An offset to the panel's first item.
DESCRIPTION
YourMyPanelRemovefunction should perform any processing that must occur before your panel is removed from the enclosing dialog box. For example, yourMyPanelRemovefunction can save the current values of any items in the dialog box. You can also use this opportunity to dispose of any user items (such as lists) in the dialog box. If the control panel opened your component's resource file, that file is still open at the timeMyPanelRemoveis called.The
itemOffsetparameter specifies the offset from 1 to the first item in your control panel. The dialog items installed by your control panel extension are contained in a larger dialog box containing other items; as a result, if you call theGetDialogItemprocedure to obtain a handle to a dialog item, you need to increment theitemNoparameter passed toGetDialogItemby the value ofitemOffset.The value passed to your
MyPanelRemovefunction in theitemOffsetparameter may be different each timeMyPanelRemoveis called. You should not assume it is always the same value.RESULT CODES
YourMyPanelRemovefunction should returnnoErrif successful, or an appropriate result code otherwise.