Important: The information in this document is obsolete and should not be used for new development.
PATH![]() |
![]() ![]() |
When showing, hiding, activating, or deactivating groups of controls, the state of an embedded control that is hidden or deactivated is preserved so that when the embedder control is shown or activated, the embedded control appears in the same state as the embedder. An embedded control is considered latent when it is deactivated or hidden due to its embedder control being deactivated or hidden. If you activate a latent embedded control whose embedder is deactivated, the embedded control becomes latent until the embedder is activated. However, if you deactivate a latent embedded control, it will not be activated when its embedder is activated.
When activating and deactivating controls in an
embedding hierarchy, call ActivateControl
and DeactivateControl
instead of HiliteControl
to ensure that latent embedded controls are displayed correctly.
The following Control Manager functions for manipulating controls are new, changed, or not recommended with Appearance Manager 1.0:
ShowControl
makes an invisible control, and any latent embedded controls, visible. Changed with Appearance Manager 1.0.HideControl
makes a visible control, and any latent embedded controls, invisible. Changed with Appearance Manager 1.0.ActivateControl
activates a control and any latent embedded controls. New with Appearance Manager 1.0.DeactivateControl
deactivates a control and any latent embedded controls. New with Appearance Manager 1.0.IsControlActive
returns whether a control is active. New with Appearance Manager 1.0.SendControlMessage
sends a message to a control definition function. New with Appearance Manager 1.0.Makes an invisible control, and any latent embedded controls, visible.
pascal void ShowControl (ControlHandle theControl);
theControl
If the specified control is invisible, the ShowControl
function makes it visible and immediately draws the control within its window without using your window's standard updating mechanism. If the specified control has embedded controls, ShowControl
makes the embedded controls visible as well. If the control is already visible, ShowControl
has no effect.
If you call ShowControl
on a latent embedded control whose embedder is disabled, the embedded control will be invisible until its embedder control is enabled. For a discussion of latency, see Manipulating Controls
.
You can make a control invisible in several ways:
false
in the visible
parameter of NewControl
.
HideControl
.
SetControlVisibility
. The setting takes effect the next time the control is drawn.
The ShowControl
function draws the control in its window, but the control can still be completely or partially obscured by overlapping windows or other objects.
Changed with Appearance Manager 1.0 to support embedding hierarchies.
Makes a visible control, and any latent embedded controls, invisible.
pascal void HideControl (ControlHandle theControl);
The HideControl
function makes the specified control invisible. This can be useful, for example, before adjusting a control's size and location. It also adds the control's rectangle to the window's update region, so that anything else that was previously obscured by the control will reappear on the screen. If the specified control has embedded controls, HideControl
makes the embedded controls invisible as well. If the control is already invisible, HideControl
has no effect.
If you call HideControl
on a latent embedded control, it would not be displayed the next time ShowControl
was called on its embedder control. For a discussion of latency, see Manipulating Controls
.
To make the control visible again, you can use the functions ShowControl
or SetControlVisibility
.
Changed with Appearance Manager 1.0 to support embedding hierarchies.
Activates a control and any latent embedded controls.
pascal OSErr ActivateControl (ControlHandle inControl);
inControl
The ActivateControl
function should be called instead of HiliteControl
to activate a specified control and its latent embedded controls. For a discussion of latency, see Manipulating Controls
.
You can use ActivateControl
to activate all controls in a window by passing the window's root control in the inControl
parameter.
If a control definition function supports activate events, it will receive a kControlMsgActivate
message before redrawing itself in its active state.
Deactivates a control and any latent embedded controls.
pascal OSErr DeactivateControl (ControlHandle inControl);
inControl
The DeactivateControl
function should be called instead of HiliteControl
to deactivate a specified control and its latent embedded controls. For a discussion of latency, see Manipulating Controls
.
You can use DeactivateControl
to deactivate all controls in a window by passing the window's root control in the inControl
parameter.
If a control definition function supports activate events, it will receive a kControlMsgActivate
message before redrawing itself in its inactive state.
Returns whether a control is active.
pascal Boolean IsControlActive (ControlHandle inControl);
If you wish to determine whether a control is active, you should call IsControlActive
instead of testing the contrlHilite
field of the control structure.
Available with Appearance Manager 1.0 and later.
Sends a message to a control definition function.
pascal SInt32 SendControlMessage (
ControlHandle inControl,
SInt16 inMessage,
SInt32 inParam);
inControl
inMessage
inParam
param
parameter of the control definition function.
Your application does not normally need to call the SendControlMessage
function. If you have a special need to call a control definition function directly, call SendControlMessage
to access and manipulate the control's attributes.
Before calling SendControlMessage
, you should determine whether the control supports the specific message you wish to send by calling GetControlFeatures
and examining the feature bit field returned. If there are no feature bits returned that correspond to the message you wish to send (for messages 0 through 12), you can assume that all system controls support that message.