| Framework | Carbon/Carbon.h |
| Declared in | Appearance.h |
The Appearance Manager coordinates the look of human interface elements in Mac OS X. You can use the Appearance Manager to adapt any nonstandard interface elements in your program to the same coordinated look as the rest of Mac OS X. The Appearance Manager also provides many standard human interface elements, such as focus rings and group boxes, that can eliminate the need to create and maintain your own custom solutions.
In Mac OS X v10.3 and later, the Appearance Manager provides a new API called HITheme for drawing appearance primitives. Currently, this API is documented in the HITheme.h interface file. The HITheme API is similar to the legacy Appearance Manager API, but many parameters have been modified to use Quartz 2D types instead of QuickDraw types. For example, HITheme functions draw into a Quartz graphics context instead of the current QuickDraw graphics port. The legacy Appearance Manager API is implemented on top of the HITheme API, so using the new API can provide a significant performance advantage.
CopyThemeIdentifier
GetTheme
GetThemeMetric
GetThemeFont Deprecated in Mac OS X v10.5
IsValidAppearanceFileType Deprecated in Mac OS X v10.5
IterateThemes Deprecated in Mac OS X v10.5
SetTheme Deprecated in Mac OS X v10.5
UseThemeFont Deprecated in Mac OS X v10.5
GetThemeCheckBoxStyle
GetThemeScrollBarArrowStyle
GetThemeScrollBarThumbStyle
DrawThemeButton Deprecated in Mac OS X v10.5
DrawThemeChasingArrows Deprecated in Mac OS X v10.5
DrawThemeEditTextFrame Deprecated in Mac OS X v10.5
DrawThemeFocusRect Deprecated in Mac OS X v10.5
DrawThemeFocusRegion Deprecated in Mac OS X v10.5
DrawThemeGenericWell Deprecated in Mac OS X v10.5
DrawThemeListBoxFrame Deprecated in Mac OS X v10.5
DrawThemePlacard Deprecated in Mac OS X v10.5
DrawThemePopupArrow Deprecated in Mac OS X v10.5
DrawThemePrimaryGroup Deprecated in Mac OS X v10.5
DrawThemeScrollBarArrows Deprecated in Mac OS X v10.5
DrawThemeSecondaryGroup Deprecated in Mac OS X v10.5
DrawThemeSeparator Deprecated in Mac OS X v10.5
DrawThemeTab Deprecated in Mac OS X v10.5
DrawThemeTabPane Deprecated in Mac OS X v10.5
DrawThemeTickMark Deprecated in Mac OS X v10.5
DrawThemeTrack Deprecated in Mac OS X v10.5
DrawThemeTrackTickMarks Deprecated in Mac OS X v10.5
GetThemeButtonBackgroundBounds Deprecated in Mac OS X v10.5
GetThemeButtonContentBounds Deprecated in Mac OS X v10.5
GetThemeButtonRegion Deprecated in Mac OS X v10.5
GetThemeScrollBarTrackRect Deprecated in Mac OS X v10.5
GetThemeTabRegion Deprecated in Mac OS X v10.5
GetThemeTrackBounds Deprecated in Mac OS X v10.5
GetThemeTrackDragRect Deprecated in Mac OS X v10.5
GetThemeTrackLiveValue Deprecated in Mac OS X v10.5
GetThemeTrackThumbPositionFromOffset Deprecated in Mac OS X v10.5
GetThemeTrackThumbPositionFromRegion Deprecated in Mac OS X v10.5
GetThemeTrackThumbRgn Deprecated in Mac OS X v10.5
HitTestThemeScrollBarArrows Deprecated in Mac OS X v10.5
HitTestThemeTrack Deprecated in Mac OS X v10.5
GetThemeMenuBarHeight
GetThemeMenuItemExtra
GetThemeMenuSeparatorHeight
GetThemeMenuTitleExtra
DrawThemeMenuBackground Deprecated in Mac OS X v10.5
DrawThemeMenuBarBackground Deprecated in Mac OS X v10.5
DrawThemeMenuItem Deprecated in Mac OS X v10.5
DrawThemeMenuSeparator Deprecated in Mac OS X v10.5
DrawThemeMenuTitle Deprecated in Mac OS X v10.5
GetThemeMenuBackgroundRegion Deprecated in Mac OS X v10.5
DrawThemeModelessDialogFrame Deprecated in Mac OS X v10.5
DrawThemeScrollBarDelimiters Deprecated in Mac OS X v10.5
DrawThemeStandaloneGrowBox Deprecated in Mac OS X v10.5
DrawThemeStandaloneNoGrowBox Deprecated in Mac OS X v10.5
DrawThemeTitleBarWidget Deprecated in Mac OS X v10.5
DrawThemeWindowFrame Deprecated in Mac OS X v10.5
DrawThemeWindowHeader Deprecated in Mac OS X v10.5
DrawThemeWindowListViewHeader Deprecated in Mac OS X v10.5
GetThemeStandaloneGrowBoxBounds Deprecated in Mac OS X v10.5
GetThemeWindowRegion Deprecated in Mac OS X v10.5
GetThemeWindowRegionHit Deprecated in Mac OS X v10.5
The theme sound functions do nothing in Mac OS X.
IsAppearanceClient Deprecated in Mac OS X v10.5
RegisterAppearanceClient Deprecated in Mac OS X v10.5
UnregisterAppearanceClient Deprecated in Mac OS X v10.5
DisposeThemeDrawingState
GetThemeBrushAsColor
GetThemeDrawingState
GetThemeTextColor
NormalizeThemeDrawingState
SetThemeDrawingState
ApplyThemeBackground Deprecated in Mac OS X v10.5
GetThemeAccentColors Deprecated in Mac OS X v10.5
IsThemeInColor Deprecated in Mac OS X v10.5
SetThemeBackground Deprecated in Mac OS X v10.5
SetThemePen Deprecated in Mac OS X v10.5
SetThemeTextColor Deprecated in Mac OS X v10.5
GetThemeTextShadowOutset
DrawThemeTextBox Deprecated in Mac OS X v10.5
GetThemeTextDimensions Deprecated in Mac OS X v10.5
TruncateThemeText Deprecated in Mac OS X v10.5
DisposeMenuItemDrawingUPP Deprecated in Mac OS X v10.5
DisposeMenuTitleDrawingUPP Deprecated in Mac OS X v10.5
DisposeThemeButtonDrawUPP Deprecated in Mac OS X v10.5
DisposeThemeEraseUPP Deprecated in Mac OS X v10.5
DisposeThemeIteratorUPP Deprecated in Mac OS X v10.5
DisposeThemeTabTitleDrawUPP Deprecated in Mac OS X v10.5
DisposeWindowTitleDrawingUPP Deprecated in Mac OS X v10.5
InvokeMenuItemDrawingUPP Deprecated in Mac OS X v10.5
InvokeMenuTitleDrawingUPP Deprecated in Mac OS X v10.5
InvokeThemeButtonDrawUPP Deprecated in Mac OS X v10.5
InvokeThemeEraseUPP Deprecated in Mac OS X v10.5
InvokeThemeIteratorUPP Deprecated in Mac OS X v10.5
InvokeThemeTabTitleDrawUPP Deprecated in Mac OS X v10.5
InvokeWindowTitleDrawingUPP Deprecated in Mac OS X v10.5
NewMenuItemDrawingUPP Deprecated in Mac OS X v10.5
NewMenuTitleDrawingUPP Deprecated in Mac OS X v10.5
NewThemeButtonDrawUPP Deprecated in Mac OS X v10.5
NewThemeEraseUPP Deprecated in Mac OS X v10.5
NewThemeIteratorUPP Deprecated in Mac OS X v10.5
NewThemeTabTitleDrawUPP Deprecated in Mac OS X v10.5
NewWindowTitleDrawingUPP Deprecated in Mac OS X v10.5
Continuously plays a theme-specific sound associated with the user’s movement of a given interface object.
OSStatus BeginThemeDragSound ( ThemeDragSoundKind kind );
A value of type ThemeDragSoundKind.
Pass a constant specifying the sound to play; see “Theme Drag Sounds” for
descriptions of possible values.
A result code. See “Appearance Manager Result Codes.”
The Appearance Manager automatically plays drag sounds for
standard user interface elements and for Drag Manager drag actions.
Your application may call BeginThemeDragSound,
typically upon detecting a drag initiation, to play a drag sound
for a custom element. BeginThemeDragSound plays
the specified sound in a continuous loop until your application
calls the function EndThemeDragSound,
typically upon receiving a mouse-up event.
Note that the BeginThemeDragSound function
automatically tracks the current mouse position and handles any
panning or variations in pitch for the sound.
This function is not implemented in Mac OS X.
Appearance.h
Retrieves a string identifying the current theme variant.
OSStatus CopyThemeIdentifier ( CFStringRef *outIdentifier );
A pointer to a string that, on output, contains the current theme variant. When you no longer need the string, you should release it.
A result code. See “Appearance Manager Result Codes.”
Appearance.h
Releases the memory associated with a reference to a graphics port’s drawing state.
OSStatus DisposeThemeDrawingState ( ThemeDrawingState inState );
A value of type ThemeDrawingState. Pass a value specifying
the previous drawing state for the current graphics port. You may
obtain this value from the outState parameter
of GetThemeDrawingState.
A result code. See “Appearance Manager Result Codes.”
Also see the function SetThemeDrawingState.
Appearance.h
Terminates the playing of a sound associated with the user’s movement of a given interface object.
OSStatus EndThemeDragSound ( void );
A result code. See “Appearance Manager Result Codes.”
The Appearance Manager automatically starts and stops drag
sounds for standard user interface elements and for Drag Manager
drag actions. Your application may call BeginThemeDragSound, typically upon
detecting a drag initiation, to play a drag sound for a custom element.
Call the EndThemeDragSound function
to turn off a drag sound when the drag is completed, typically upon
receipt of a mouse-up event.
This function is not implemented in Mac OS X.
Appearance.h
Obtains a collection containing data describing the current theme.
OSStatus GetTheme ( Collection ioCollection );
A value of type Collection.
Pass a reference to a collection object, such as that created by
calling the Collection Manager function NewCollection.
On return, the collection contains data describing attributes of
the current theme.
A result code. See “Appearance Manager Result Codes.”
The GetTheme function
obtains a collection containing a copy of the data for the current theme.
The theme data is in the form of collection items, each corresponding
to an attribute of the theme. For a given theme, the actual number
of collection items may vary, depending upon how fully the theme’s
attributes are specified. See “Theme Collection Tags” for
descriptions of the possible theme collection items.
Your application can use theme collection tags, along with various Collection Manager functions, to access the data in the collection.
Also see the function SetTheme.
Appearance.h
Obtains the color that corresponds to a given theme brush type under the current theme.
OSStatus GetThemeBrushAsColor ( ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev, RGBColor *outColor );
A value of type ThemeBrush.
Pass a constant specifying the theme brush type for which you wish
to obtain a color; see “Theme Brushes” for descriptions of possible values.
A signed 16-bit integer. Pass a value specifying the bit depth (in bits per pixel) of the current graphics port.
A value of type Boolean.
Pass true to indicate
that you are drawing on a color device. Pass false for
a monochrome device.
A pointer to a structure of type RGBColor.
On return, the structure contains a color corresponding to the color
or pattern used by the specified theme brush under the current theme.
A result code. See “Appearance Manager Result Codes.”
The GetThemeBrushAsColor function
obtains a color that corresponds to that which is in use for a specified
theme brush. If, in the current theme, the specified brush draws
with a pattern instead of a color, a theme-specified approximate
color is obtained. Your application should call GetThemeBrushAsColor only
when you must use an RGBColor value for a specific
operation; typically, your application should call the functions SetThemeBackground and SetThemePen for greatest
fidelity with the current theme.
Appearance.h
Obtains the system preference for the type of mark to use in a checkbox.
OSStatus GetThemeCheckBoxStyle ( ThemeCheckBoxStyle *outStyle );
A pointer to a value of type ThemeCheckBoxStyle. On
return, the value specifies the type of mark being used. See “Theme Checkbox Styles” for descriptions
of possible values.
A result code. See “Appearance Manager Result Codes.”
Because international systems may specify the use of one type
of mark to use in checkboxes over another, your application should
call GetThemeCheckBoxStyle to
obtain the correct type of mark to use on the current system.
Appearance.h
Obtains the drawing state of the current graphics port.
OSStatus GetThemeDrawingState ( ThemeDrawingState *outState );
A pointer to a value of type ThemeDrawingState. On return, GetThemeDrawingState sets
the outState parameter
to point to a copy of the drawing state for the current graphics
port.
A result code. See “Appearance Manager Result Codes.”
Your application may call the GetThemeDrawingState function
before performing an operation that modifies the drawing state of
a graphics port. To return the graphics port to its previous drawing
state and release the memory allocated for the drawing state reference,
your application should call SetThemeDrawingState,
providing the reference obtained in the outState parameter
of GetThemeDrawingState.
You can also call DisposeThemeDrawingState to
release the allocated memory.
Appearance.h
Obtains the height of a menu bar.
OSStatus GetThemeMenuBarHeight ( SInt16 *outHeight );
A pointer to a signed 16-bit integer. On return, the integer value represents the height (in pixels) of the menu bar.
A result code. See “Appearance Manager Result Codes.”
The GetThemeMenuBarHeight function
obtains the specified height of a menu bar in the current theme.
This is in contrast to the Menu Manager function GetMBarHeight,
which obtains the actual space that the menu bar is currently occupying
on the screen. In most instances, the values produced by these two
functions are the same. But, when the menu bar is hidden, GetMBarHeight produces
a value of 0, and GetThemeMenuBarHeight still provides
the “ideal” menu bar height.
Because menu bar heights may vary among appearances by one
or more pixels, you should check the current menu bar height after
a theme switch. Specifically, your application should respond to
the theme-switch Apple event, kAEAppearanceChanged,
by checking the current menu bar height. See “Appearance Manager Apple Events” for
more details on kAEAppearanceChanged.
It is important to check the menu bar height before positioning any windows. Failure to do so may result in the menu bar overlapping your application’s windows.
Appearance.h
Obtains a measurement of the space surrounding a menu item.
OSStatus GetThemeMenuItemExtra ( ThemeMenuItemType inItemType, SInt16 *outHeight, SInt16 *outWidth );
A value of type ThemeMenuItemType.
Pass a constant identifying the type of menu item for which you
are interested in getting a measurement. See “Theme Menu Item Types.”
A pointer to a signed 16-bit integer. On return,
the integer value represents the total amount of padding between
the content of the menu item and the top and bottom of its frame
(in pixels). Your content’s height plus the measurement provided
by the outHeight parameter
equals the total item height.
A pointer to a signed 16-bit integer. On return,
the integer value represents the total amount of padding between
the content of the menu item and the left and right limits of the
menu (in pixels). Your content’s width plus the measurement provided
by the outWidth parameter
equals the total item width.
A result code. See “Appearance Manager Result Codes.”
Your application should call the GetThemeMenuItemExtra function
when you are writing your own menu definition function and wish
to be theme-compliant. Once you have determined the height and width
of the content of a menu item, call GetThemeMenuItemExtra to
get a measurement in pixels of the space surrounding a menu item,
including any necessary inter-item spacing, in the current theme.
By combining the values for your menu item’s content and the extra
padding needed by the theme, you can derive the size of the rectangle
needed to encompass both the content and the theme element together.
Appearance.h
Obtains the height of a menu separator line.
OSStatus GetThemeMenuSeparatorHeight ( SInt16 *outHeight );
A pointer to a signed 16-bit integer. On return, the integer value represents the height (in pixels) of the menu separator line.
A result code. See “Appearance Manager Result Codes.”
The GetThemeMenuSeparatorHeight function
obtains the height of a menu separator line under the current theme.
Your application should call the GetThemeMenuSeparatorHeight function
when you are writing your own menu definition function and wish
to calculate a menu rectangle for a separator to match the current
theme.
Appearance.h
Obtains a measurement of the space to either side of a menu title.
OSStatus GetThemeMenuTitleExtra ( SInt16 *outWidth, Boolean inIsSquished );
A pointer to a signed 16-bit integer. On return, the integer value represents the horizontal distance (in pixels) between the menu title and the bounds of its containing rectangle.
A value of type Boolean.
If all the titles do not fit in the menu bar and you wish to condense
the menu title’s spacing to fit, pass true.
If you pass false, the
menu title is not condensed.
A result code. See “Appearance Manager Result Codes.”
Once you have determined the height and width of the content
of a menu title, call GetThemeMenuTitleExtra to
get the space surrounding the menu title in the current theme.
Appearance.h
Retrieves the value of a metric property of a user interface element.
OSStatus GetThemeMetric ( ThemeMetric inMetric, SInt32 *outMetric );
The user interface metric to retrieve. See “Theme Metrics” for a list of possible metrics.
A pointer to an integer value. On output, contains the value of the specified metric property, generally in points.
A result code. See “Appearance Manager Result Codes.”
Appearance.h
Obtains the system preference for the type of scroll bar arrows to be used.
OSStatus GetThemeScrollBarArrowStyle ( ThemeScrollBarArrowStyle *outStyle );
A pointer to a value of type ThemeScrollBarArrowStyle. On
return, the value specifies the type of scroll bar arrows being
used. See “Theme Scroll Bar Arrow Styles” for descriptions of possible
values.
A result code. See “Appearance Manager Result Codes.”
Because the user can specify varying types of scroll bar arrows
on a theme-specific basis, your application should call GetThemeScrollBarArrowStyle to
obtain the preferred style under the current theme.
Appearance.h
Obtains the system preference for the type of scroll box to be used.
OSStatus GetThemeScrollBarThumbStyle ( ThemeScrollBarThumbStyle *outStyle );
A pointer to a value of type ThemeScrollBarThumbStyle. On
return, the value specifies the type of scroll box being used. See “Theme Scroll Box Styles” for descriptions
of possible values.
A result code. See “Appearance Manager Result Codes.”
Because the user can specify either proportional or fixed-size
scroll boxes (also known as “scroll indicators” or “thumbs”)
on a theme-specific basis, your application should call GetThemeScrollBarThumbStyle to
obtain the preferred style under the current theme.
Appearance.h
Obtains the text color used for a specified element under the current theme.
OSStatus GetThemeTextColor ( ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev, RGBColor *outColor );
A value of type ThemeTextColor.
Pass a constant specifying the element for which you wish to obtain
the current text color; see “Theme Text Colors” for descriptions
of possible values.
A signed 16-bit integer. Pass a value specifying the bit depth (in bits per pixel) of the current graphics port.
A value of type Boolean.
Pass true to indicate
that you are drawing on a color device. Pass false for
a monochrome device.
A pointer to a structure of type RGBColor.
On return, the structure contains the text color used for the specified
element under the current theme.
A result code. See “Appearance Manager Result Codes.”
Also see the function SetThemeTextColor.
Appearance.h
Tells you the amount of space taken up by the shadow for a given font and drawing state combination.
OSStatus GetThemeTextShadowOutset ( ThemeFontID inFontID, ThemeDrawState inState, Rect *outOutset );
The ThemeFontID describing
the font you'd like the shadow characteristics of. Font and drawing
state both determine the amount of shadow that will be used on rendered
text. See “Theme Font IDs” for the values you can use here.
The ThemeDrawState which
matches the drawing state you'd like the shadow characteristics
of. Font and state both determine the amount of shadow that will
be used on rendered text. See “Theme Drawing States” for the
values you can use here.
On output, this parameter contains the amount
of space the shadow will take up beyond each edge of the text bounding
rectangle returned by GetThemeTextDimensions.
The fields of this parameter will either be positive values or zero.
A result code. See “Appearance Manager Result Codes.”
GetThemeTextShadowOutset passes
back the maximum amount of space the shadow will take up for text
drawn in the specified font and state. While GetThemeTextDimensions tells you
how much space is taken up by the character glyphs themselves, it
does not incorporate the font or state shadow into its calculations.
If you need to know how much total space including the shadow will
be taken up, call GetThemeTextDimensions followed by GetThemeTextShadowOutset.
Appearance.h
Sets the current graphics port to a default drawing state.
OSStatus NormalizeThemeDrawingState ( void );
A result code. See “Appearance Manager Result Codes.”
The NormalizeThemeDrawingState function
sets the background of a graphics port to white; the pen of the
port to a size of 1 pixel by 1 pixel, a pattern mode of patCopy,
and a pattern of black; and the text mode of the port to srcOr. NormalizeThemeDrawingState also
flushes from memory any color foreground or background patterns
saved in the port’s GrafPort.pnPat or GrafPort.bkPat fields,
respectively.
Appearance.h
Plays an asynchronous sound associated with the specified state change.
OSStatus PlayThemeSound ( ThemeSoundKind kind );
A value of type ThemeSoundKind.
Pass a constant specifying the sound to play; see “Theme Sounds” for
descriptions of possible values.
A result code. See “Appearance Manager Result Codes.”
The Appearance Manager automatically plays theme sounds for
standard user interface elements. Your application can call the PlayThemeSound function
to play a theme sound for a custom element. The sound plays asynchronously
until complete, stopping automatically.
This function is not implemented in Mac OS X.
Appearance.h
Animates a version of the specified cursor type that is consistent with the current theme.
OSStatus SetAnimatedThemeCursor ( ThemeCursor inCursor, UInt32 inAnimationStep );
A value of type ThemeCursor.
Pass a constant specifying the type of cursor to set; see “Theme Cursors” for
a description of the possible values. Note that only cursors designated
as able to be animated should be used for this function. If you
specify an unanimatable cursor type, SetAnimatedThemeCursor returns
the error themeBadCursorIndexErr (–30565).
An unsigned 32-bit value. Pass a value specifying
the current animation step of the cursor. To animate the cursor,
increment the value by 1 with each call to SetAnimatedThemeCursor.
A result code. See “Appearance Manager Result Codes.”
Appearance Manager 1.1 introduces cursors that can change appearance with a theme change. In order to be theme-compliant, your program should use these theme-specific cursors whenever possible, instead of the classic black-and-white cursors.
Your application should call the SetAnimatedThemeCursor function
to ensure that its animated cursors are theme-compliant, rather
than using any QuickDraw cursor utilities functions such as SetCursor, SetCCursor, SpinCursor,
or RotateCursor. If you wish a non-animated
cursor to be theme-compliant, call the function SetThemeCursor.
Because these are color cursors, they currently cannot be set from interrupt time. Therefore, if you support animated cursors that are changed at interrupt time you should continue to use your own cursors for now.
Do not call SetAnimatedThemeCursor at
interrupt time.
Appearance.h
Sets the cursor to a version of the specified cursor type that is consistent with the current theme.
OSStatus SetThemeCursor ( ThemeCursor inCursor );
A value of type ThemeCursor.
Pass a constant specifying the type of cursor to set; see “Theme Cursors” for
a description of possible values.
A result code. See “Appearance Manager Result Codes.”
Appearance Manager 1.1 introduces cursors that can change appearance with a theme change. In order to be theme-compliant, your program should use these theme-specific cursors whenever possible, instead of the classic black-and-white cursors. Because these are color cursors, they currently cannot be set from interrupt time.
Your application should call the SetThemeCursor function
to ensure that its cursors are theme-compliant, rather than the
QuickDraw cursor utilities functions SetCursor or SetCCursor.
If you wish an animatable cursor to be theme-compliant, call the
function SetAnimatedThemeCursor.
Do not call SetThemeCursor at
interrupt time.
Appearance.h
Sets the drawing state of the current graphics port.
OSStatus SetThemeDrawingState ( ThemeDrawingState inState, Boolean inDisposeNow );
A value of type ThemeDrawingState. Pass a ThemeDrawingState value
such as that produced in the outState parameter
of GetThemeDrawingState.
A value of type Boolean.
Pass a value of true to
release the memory allocated for the drawing state reference. Pass false if
you wish to continue using the drawing state and do not want to
dispose of the memory at this time; you must call DisposeThemeDrawingState to dispose
of the memory any time before your application terminates.
A result code. See “Appearance Manager Result Codes.”
Your application can save the port state by calling the function GetThemeDrawingState and restore
the port state by calling the function SetThemeDrawingState,
supplying the value obtained in the outState parameter
of GetThemeDrawingState, after you
have completed all of your drawing.
Appearance.hDraws a menu item.
typedef void ( *MenuItemDrawingProcPtr) ( const Rect * inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData );
If you name your function MyMenuItemDrawingCallback, you would declare it like this:
void MyMenuItemDrawingCallback ( const Rect * inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData );
A pointer to a structure of type Rect. You are passed a rectangle specifying the dimensions and position in which you should draw your menu item content. Your menu item drawing function is called clipped to the rectangle in which you are allowed to draw your content; do not draw outside this region.
A signed 16-bit integer. You are passed the bit depth (in bits per pixel) of the current graphics port.
A value of type Boolean. You are passed true to indicate that you are drawing on a color device; inIsColorDevice is false for a monochrome device.
You are passed data specifying how to draw the menu item content from the inUserData parameter of DrawThemeMenuItem.
At the time your menu item drawing function is called, the foreground text color and mode is already set to draw in the correct state (enabled, selected, disabled) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the inDepth value and the value of the inIsColorDevice parameter to the function IsThemeInColor to determine whether or not you should draw the menu item content in color.
Note that the Appearance Manager calls your MyMenuItemDrawingCallback function for every device that the inBounds rectangle intersects.
You should refer to your MyMenuItemDrawingCallback function using a MenuItemDrawingUPP, which you can create with NewMenuItemDrawingUPP.
You typically use the NewMenuItemDrawingUPP function like this:
MenuItemDrawingUPP myMenuItemDrawingUPP; |
myMenuItemDrawingUPP = NewMenuItemDrawingUPP(MyMenuItemDrawingCallback); |
The Appearance Manager draws the background of the menu item prior to calling your menu item drawing function, so you should not erase the item’s background from this function.
This function is available with Appearance Manager 1.0.1 and later.
Appearance.h