Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

PATHDocumentation > Mac OS 8 and 9 > Human Interface Toolbox > Control Manager >

Mac OS 8 Control Manager Reference


Control Part Code Constants

Constants of type ControlPartCode identify specific parts of controls for functions such as SetControlData , GetControlData , and FindControlUnderMouse . The ControlPartCode constants are changed with the Appearance Manager to support new control part codes.

Part codes are meaningful only within the scope of a single control definition function. For example, the standard tab control uses part codes 1... N , where N is the number of tabs, even though those numbers do collide with part codes defined for use with other control definition functions. Therefore, when you wish to specify part codes for the tab control for use with the function SetControlData , for example, you should use a part code corresponding to a 1-based index of the tab whose data you wish to set. In other words, the first tab is part code 1, the second tab is part code 2, and so on.

Note that if you wish to create part codes for a custom control definition function, you may assign values anywhere within the ranges 1-128 and 130-253. Note also that the function FindControl does not typically return the kControlDisabledPart or kControlInactivePart part codes and never returns them with standard controls.

enum {
    kControlNoPart                  = 0,
    kControlLabelPart               = 1,
    kControlMenuPart                = 2,
    kControlTrianglePart            = 4,
    kControlEditTextPart            = 5,
    kControlPicturePart             = 6,
    kControlIconPart                = 7,
    kControlClockPart               = 8,
    kControlButtonPart              = 10,
    kControlCheckBoxPart            = 11,
    kControlRadioButtonPart         = 12,
    kControlUpButtonPart            = 20,
    kControlDownButtonPart          = 21,
    kControlPageUpPart              = 22,
    kControlPageDownPart            = 23,
    kControlListBoxPart             = 24,
    kControlListBoxDoubleClickPart  = 25,
    kControlImageWellPart           = 26,
    kControlRadioGroupPart          = 27,
    kControlIndicatorPart           = 129,
    kControlDisabledPart            = 254,
    kControlInactivePart            = 255
};
typedef SInt16 ControlPartCode; 

Constant descriptions

kControlNoPart
Identifies no specific control part. This value unhighlights any highlighted part of the control when passed to the HiliteControl function. For events in bevel buttons with an attached menu, this part code indicates that either the mouse was released outside the bevel button and menu or that the button was disabled.
kControlLabelPart
Identifies the label of a pop-up menu control.
kControlMenuPart
Identifies the menu of a pop-up menu control. For bevel buttons with a menu attached, this part code specifies a menu item of the bevel button.
kControlTrianglePart
Identifies a disclosure triangle control.
kControlEditTextPart
Identifies an editable text control. Available with Appearance Manager 1.0 and later.
kControlPicturePart
Identifies a picture control. Available with Appearance Manager 1.0 and later.
kControlIconPart
Identifies an icon control. Available with Appearance Manager 1.0 and later.
kControlClockPart
Identifies a clock control. Available with Appearance Manager 1.0 and later.
kControlButtonPart
Identifies either a push button or bevel button control. For bevel buttons with a menu attached, this part code specifies the button but not the attached menu.
kControlCheckBoxPart
Identifies a checkbox control.
kControlRadioButtonPart
Identifies a radio button control.
kControlUpButtonPart
Identifies the up button of a scroll bar control (the arrow at the top or the left).
kControlDownButtonPart
Identifies the down button of a scroll bar control (the arrow at the right or the bottom).
kControlPageUpPart
Identifies the page-up part of a scroll bar control.
kControlPageDownPart
Identifies the page-down part of a scroll bar control.
kControlListBoxPart
Identifies a list box control. Available with Appearance Manager 1.0 and later.
kControlListBoxDoubleClickPart
Identifies a double-click in a list box control. Available with Appearance Manager 1.0 and later.
kControlImageWellPart
Identifies an image well control. Available with Appearance Manager 1.0 and later.
kControlRadioGroupPart
Identifies a radio group control. Available with Appearance Manager 1.0.2 and later.
kControlIndicatorPart
Identifies the scroll box of a scroll bar control.
kControlDisabledPart
Used with HiliteControl to disable the control.
kControlInactivePart
Used with HiliteControl to make the control inactive.

\xA9 1998 Apple Computer, Inc. – (Last Updated 19 Nov 98)