Legacy Documentclose button

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

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 5 - Control Manager / Control Manager Reference
Resources


The Control Color Table Resource

On color monitors, the Control Manager automatically draws control parts so that they match the colors of the controls used by system software.

If you feel absolutely compelled to use nonstandard colors, the Control Manager
allows you to do so. Your application can specify these by creating a control color table ('cctb') resource; you must give the control color table resource for a control the
same resource ID as its control ('CNTL') resource, which is described on page 5-111
. When you call the GetNewControl function to create the control, the Control Manager automatically attempts to load a control color table resource with the same resource ID as the control resource specified to GetNewControl. The Control Manager also creates
an auxiliary control record for the control; the auxiliary control record is described
on page 5-69.

Note
Using nonstandard colors in your controls may initially confuse
your users.
Generally, you use a control color table resource for a control that you define in a control resource. To change a control's colors, or to use nonstandard colors in a control
you create using NewControl, create a control color table record and use the SetControlColor procedure. The control color table record is described on page 5-71; the SetControlColor procedure is described on page 5-94.

A control color table resource is of type 'cctb'. All control color table resources must have resource ID numbers greater than 128. Figure 5-26 on the next page shows the format of a control color table resource. Note that DisposeControl does not delete
a control color table resource; therefore, you should make each control color table resource purgeable.

Figure 5-26 Structure of a compiled control color table ('cctb') resource

You define a control color table resource by specifying these elements in a resource with the 'cctb' resource type:

CONST
   cFrameColor       = 0;  {frame color; for scroll bars, used to produce }
                           { foreground color for scroll arrows & gray area}
   cBodyColor        = 1;  {body color; for scroll bars, used to produce }
                           { colors in the scroll box}
   cTextColor        = 2;  {text color; unused for scroll bars}
   cArrowsColorLight = 5;  {Used to produce colors in arrows & scroll bar }
                           { background color}
   cArrowsColorDark  = 6;  {Used to produce colors in arrows & scroll bar }
                           { background color}
   cThumbLight       = 7;  {Used to produce colors in scroll box}
   cThumbDark        = 8;  {Used to produce colors in scroll box}
   cHiliteLight      = 9;  {Use same value as wHiliteColorLight in 'wctb'}
   cHiliteDark       = 10; {Use same value as wHiliteColorDark in 'wctb'}
   cTitleBarLight    = 11; {Use same value as wTitleBarLight in 'wctb'}
   cTitleBarDark     = 12; {Use same value as wTitleBarDark in 'wctb'}
   cTingeLight       = 13; {Use same value as wTingeLight in 'wctb'}
   cTingeDark        = 14; {Use same value as wTingeDark in 'wctb'}

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996