Important: The information in this document is obsolete and should not be used for new development.
HideDialogItem
Although you should rarely need to do so, you can make an item in a dialog box invisible by using theHideDialogItem
procedure. TheHideDialogItem
procedure is also available as theHideDItem
procedure.
PROCEDURE HideDialogItem (theDialog: DialogPtr; itemNo: Integer);
- theDialog
- A pointer to a dialog record.
itemNo
- A number corresponding to the position of an item in the dialog box's item list resource.
DESCRIPTION
TheHideDialogItem
procedure hides the item specified byitemNo
by giving it a display rectangle that's off the screen. Specifically, if the left coordinate of the item's display rectangle is less than 8192 (hexadecimal $2000),HideDialogItem
adds 16,384 (hexadecimal $4000) to both the left and right coordinates of the rectangle. If the item is already hidden (that is, if the left coordinate is greater than 8192),HideDialogItem
does nothing. To redisplay an item that's been hidden byHideDialogItem
, you can use theShowDialogItem
procedure.SPECIAL CONSIDERATIONS
If your application needs to display a number of dialog boxes that are similar except for one or two items, it's generally easier to modify the common elements using theAppendDITL
andShortenDITL
procedures than to use theHideDialogItem
andShowDialogItem
procedures.The rectangle for a static text item must always be at least as wide as the first character of the text.
You generally shouldn't use
HideDialogItem
to make an editable text item invisible, because as the user presses the Tab key, the Dialog Manager attempts to move the cursor to the hidden editable text item, where the user's subsequent keystrokes will be placed.