![]() |
CtlCTab |
Header: Controls.h |
struct CtlCTab { SInt32 ccSeed; SInt16 ccRider; SInt16 ctSize; ColorSpec ctTable[4]; }; typedef CtlCTab CCTabPtr;
Reserved. Set to 0.
Reserved. Set to 0.
The number of ColorSpec structures in the next field. For controls drawn with the standard definition function, this field is always 3, because a standard control has three parts: frame, control body, and scroll box for scroll bars, and frame, control body, and text for other controls. If you want to supply ColorSpec structures for additional parts, you must define your own controls, as described in ControlDefProcPtr.
An array of QuickDraw ColorSpec structures. Each ColorSpec structure describes the color of a different control part. There are two parts to a ColorSpec structure: a RGBColor structure that defines the color values to be used, and an integer that identifies the color part to which the color is to be applied; see
When highlighted, buttons exchange their body and text colors; checkboxes and radio buttons change their appearance without changing colors. All three types indicate deactivation by dimming their text with no change in colors.
A number of ColorSpec structures are used to describe the parts of scroll bars.
When highlighted, scroll arrows are filled with the foreground color. A deactivated scroll bar shows no scroll box and displays its gray areas in a solid background color with no pattern.
The ColorSpec structures for a control can appear in any order. If you include a part identifier that is not found, the Control Manager uses the first ColorSpec structure with an identifiable part. If you do not specify a part identifier, the Control Manager uses the default color for that part.
The \control color table structure is not recommend with the Appearance Manager. When the Appearance Manager is available and you are using standard controls, the control color table structure is ignored and the colors are determined by the current theme. If you are creating your own control definition function, you can use the control color table structure along with the function
Alternatively, you can use nonstandard colors for a control you define in a control resource by creating a control color table resource of type 'cctb' with the same resource ID as the control resource; see 'CNTL' for more information. Be aware that controls in nonstandard colors may initially confuse your users.
When you create a control color table structure, your application should not deallocate it if another control is still using it.
When drawing a control, the standard control definition functions search the linked list of auxiliary control structures for the structure whose acOwner field points to that control. If a standard control definition function finds such a structure, it uses the color table designated by that structure; otherwise, it uses the default system colors. Each control using colors other than the system default has its own auxiliary control structure, even if that control uses the same control color table structure as another control; two or more auxiliary structures can share the same control color table structure. For more information, see ControlRecord.
If you create a control definition function as explained in ControlDefProcPtr
, you can use color tables of any desired size and define their contents in any way you wish, except that part indices 0 through 127 are reserved for system definition. Any such nonstandard control definition function should bypass the defaulting mechanism by allocating an explicit auxiliary structure for every control it creates.
The CtlCTab data type defines a control color table structure. The CCTabHandle data type is a handle to a control color table structure.
© 2000 Apple Computer, Inc. (Last Updated 5/8/2000)