Legacy Documentclose button

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

Legacy Legacy Mac OS X Reference Library Mac OS 8 and 9 Developer Documentation


Control Definition IDs

When creating a control, your application supplies a control definition ID to one of the Control Manager control-creation functions or to the control resource; see 'CNTL' . The control definition ID indicates the type of control to create. A control definition ID is an integer that contains the resource ID of a control definition function in its upper 12 bits and a variation code in its lower 4 bits. A control definition ID is derived as follows:

control definition ID = 16 * ('CDEF' resource ID) + variation code

A control definition function determines how a control generally looks and behaves. Control definition functions are stored as resources of type 'CDEF' . Various Control Manager functions call a control definition function whenever they need to perform some control-dependent action, such as drawing the control on the screen. For more information on how to create a control definition function, see Defining Your Own Control Definition Function .

A control definition function, in turn, can use a variation code to describe variations of the same basic control. For example, all pop-up arrows share the same basic control definition function, which is stored in a resource of type 'CDEF' and has a resource ID of 12. The standard pop-up arrow is large and points to the right; it has a control definition ID of 192. A variation of this is a large, left-pointing arrow, which has a control definition ID of 193. Still another variation, in which the arrow points up, has a control definition ID of 194.

Your application can use the constants listed in Table 1-1 in place of control definition IDs. Most of these constants, and their associated IDs, are new with the Appearance Manager and are not supported unless the Appearance Manager is available. A control definition ID that is new is identified with an asterisk (*) in its description in Table 1-1 . For illustrations of these new controls, see "Control Guidelines" in Mac OS 8 Human Interface Guidelines.

If your application contains code that uses the older, pre-Appearance control definition IDs or their constants, your application can use the Appearance Manager to map the old IDs to those for the new, updated controls introduced by the Appearance Manager. In particular, the control definition IDs for pre-Appearance checkboxes, buttons, scroll bars, radio buttons, and pop-up menus will be automatically mapped to Appearance-compliant equivalents.

Table 1-1 Control definition IDs and resource IDs for standard controls 

Constant (and Value) for Control Definition ID

Description

Resource
ID

pushButProc (0) Pre-Appearance push button. 0
pushButProc + kControlUsesOwningWindowsFontVariant (8) Pre-Appearance push button with its text in the window font. 0
kControlPushButtonProc (368) Appearance-compliant push button.* 23
kControlPushButLeftIconProc (374) Appearance-compliant push button with a color icon to the left of the control title.* (This direction is reversed when the system justification is right to left). The contrlMax field of the control structure for this control contains the resource ID of the 'cicn' resource drawn in the pushbutton. 23
kControlPushButRightIconProc (375) Appearance-compliant push button with a color icon to right of control title.* (This direction is reversed when the system justification is right to left). The contrlMax field of the control structure for this control contains the resource ID of the 'cicn' resource drawn in the pushbutton. 23
checkBoxProc (1) Pre-Appearance checkbox. 0
checkBoxProc + kControlUsesOwningWindowsFontVariant (8) Pre-Appearance checkbox with a control title in the window font. 0
kControlCheckBoxProc (369) Appearance-compliant checkbox.* 23
radioButProc (2) Pre-Appearance radio button. 0
radioButProc + kControlUsesOwningWindowsFontVariant (8) Pre-Appearance radio button with a title in the window font. 0
kControlRadioButtonProc (370) Appearance-compliant radio button.* 23
scrollBarProc (16) Pre-Appearance scroll bar. 1
kControlScrollBarProc (384) Appearance-compliant scroll bar.* 24
kControlScrollBarLiveProc (386) Appearance-compliant scroll bar with live feedback.* 24
kControlBevelButtonSmallBevelProc (32) Bevel button with a small bevel.* 2
kControlBevelButtonNormalBevelProc (33) Bevel button with a normal bevel.* 2
kControlBevelButtonLargeBevelProc (34) Bevel button with a large bevel.* 2
kControlBevelButtonSmallBevelProc + kControlBevelButtonMenuOnRight (4) Small bevel button with a pop-up menu.* 2
kControlSliderProc (48) Slider.* Your application calls the function SetControlAction to set the last value for the control. 3
kControlSliderProc + kControlSliderLiveFeedback (1) Slider with live feedback.* The value of the control is updated automatically by the Control Manager before your action function is called. If no application-defined action function is supplied, the slider draws an outline of the indicator as the user moves it. 3
kControlSliderProc + kControlSliderHasTickMarks (2) Slider with tick marks.* The control rectangle must be large enough to include the tick marks. 3
kControlSliderProc + kControlSliderReverseDirection (4) Slider with a directional indicator.* The indicator is positioned perpendicularly to the slider; that is, if the slider is horizontal, the indicator points up, and if the slider is vertical, the indicator points left. 3
kControlSliderProc + kControlSliderNonDirectional (8) Slider with a rectangular, non-directional indicator.* This variant overrides the kSliderReverseDirection and kSliderHasTickMarks variants. 3
kControlTriangleProc (64) Disclosure triangle.* 4
kControlTriangleLeftFacingProc (65) Left-facing disclosure triangle.* 4
kControlTriangleAutoToggleProc (66) Auto-tracking disclosure triangle.* 4
kControlTriangleLeftFacingAutoToggleProc (67)
Left-facing, auto-tracking disclosure triangle.* 4
kControlProgressBarProc (80) Progress indicator.* To make the control determinate or indeterminate, set the kControlProgressBarIndeterminateTag constant; see Control Data Tag Constants . Progress indicators are only horizontal in orientation; vertical progress indicators are not currently supported. 5
kControlLittleArrowsProc (96) Little arrows.* 6
kControlChasingArrowsProc (11) Asynchronous arrows.* 7
kControlTabLargeProc (128) Normal tab control.* 8
kControlTabSmallProc (129) Small tab control.*
kControlSeparatorLineProc (144) Separator line. 9
kControlGroupBoxTextTitleProc (160) Primary group box with text title.* 10
kControlGroupBoxCheckBoxProc (161) Primary group box with checkbox title.* 10
kControlGroupBoxPopupButtonProc (162) Primary group box with pop-up button title.* 10
kControlGroupBoxSecondaryTextTitleProc (164)
Secondary group box with text title.* 10
kControlGroupBoxSecondaryCheckBoxProc (165)
Secondary group box with checkbox title.* 10
kControlGroupBoxSecondaryPopupButtonProc (166)
Secondary group box with pop-up button title.* 10
kControlImageWellProc (176) Image well.* This control behaves as a palette-type object: it can be selected by clicking, and clicking on another object should change the keyboard focus. If the keyboard focus is removed, your application should then set the value to 0 to remove the checked border. 11
kControlImageWellAutoTrackProc (177) Image well with autotracking.* This variant sets the value itself so the control remains highlighted. 11
kControlPopupArrowEastProc (192) Large, right-facing pop-up arrow.* 12
kControlPopupArrowWestProc (193) Large, left-facing pop-up arrow.* 12
kControlPopupArrowNorthProc (194) Large, up-facing pop-up arrow.* 12
kControlPopupArrowSouthProc (195) Large, down-facing pop-up arrow.* 12
kControlPopupArrowSmallEastProc (196) Small, right-facing pop-up arrow.* 12
kControlPopupArrowSmallWestProc (197) Small, left-facing pop-up arrow.* 12
kControlPopupArrowSmallNorthProc (198) Small, up-facing pop-up arrow.* 12
kControlPopupArrowSmallSouthProc (199) Small, down-facing pop-up arrow.* 12
kControlPlacardProc (224) Placard.* 14
kControlClockTimeProc (240) Clock control displaying hour/minutes.* 15
kControlClockTimeSecondsProc (241) Clock control displaying hours/minutes/seconds.* 15
kControlClockDateProc (242) Clock control displaying date/month/year.* 15
kControlClockMonthYearProc (243) Clock control displaying month/year.* 15
kControlUserPaneProc (256) User pane.* 16
kControlEditTextProc (272) Editable text field for windows.* This control maintains its own text handle (TEHandle ). 17
kControlEditTextPasswordProc (274) Editable text field for passwords.* This control is supported by the Script Manager. Password text can be accessed via the kEditTextPasswordTag constant; see Control Data Tag Constants . 17
kControlStaticTextProc (288) Static text field.* 18
kControlPictureProc (304) Picture control.* 19
kControlPictureNoTrackProc (305) Non-tracking picture.* Immediately returns kControlPicturePart as the part code hit without tracking. 19
kControlIconProc (320) Icon control.* 20
kControlIconNoTrackProc (321) Non-tracking icon.* 20
kControlIconSuiteProc (322) Icon suite.* 20
kControlIconSuiteNoTrackProc (323) Non-tracking icon suite.* 20
kControlWindowHeaderProc (336) Window header.* 21
kControlWindowListViewHeaderProc (337) Window list view header.* 21
kControlListBoxProc (352) List box.* 21
kControlListBoxAutoSizeProc (353) Autosizing list box.* 21
popupMenuProc (1008) Pre-Appearance standard pop-up menu. 63
popupMenuProc + popupFixedWidth (1009) Pre-Appearance, fixed-width pop-up menu. 63
popupMenuProc +
popupVariableWidth
(1010)
Pre-Appearance, variable-width pop-up menu. 63
popupMenuProc + popupUseAddResMenu (1012) Pre-Appearance pop-up menu with a value of type ResType in the contrlRfCon field of the control structure. The Menu Manager adds resources of this type to the menu. 63
popupMenuProc + popupUseWFont (1016) Pre-Appearance pop-up menu with a control title in the window font. 63
kControlPopupButtonProc (400) Appearance-compliant standard pop-up menu.* 25
kControlPopupButtonProc + kControlPopupFixedWidthVariant (1) Appearance-compliant fixed-width pop-up menu.* 25
kControlPopupButtonProc + kControlPopupVariableWidthVariant (2) Appearance-compliant variable-width pop-up menu.* 25
kControlPopupButtonProc + kControlPopupUseAddResMenuVariant (4) Appearance-compliant pop-up menu with a value of type ResType in the contrlRfCon field of the control structure.* The Menu Manager adds resources of this type to the menu. 25
kControlPopupButtonProc + kControlPopupUseWFontVariant (8) Appearance-compliant pop-up menu with control title in window font.* 25
kControlRadioGroupProc (416) Radio group.* Embedder control for controls that have set the feature bit kControlHasRadioBehavior . 26

* This control definition is new with the Appearance Manager and is not supported unless the Appearance Manager is available.

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