DrawThemeButton
Draws a theme compliant button on MacOS systems.
FUNCTION DrawThemeButton(r as Rect
inKind as Integer,
inNewInfo as ThemeButtonDrawInfo,
inPrevInfo as ThemeButtonDrawInfo,
inEraseProc as Object,
inLabelProc as ThemeButtonDrawUPP,
inUserData as Variant) as Integer
r:
Pass a rectangle specifying the boundary of the button,
in window coordinates.
inKind:
Pass a constant specifying the type of button to draw.
0 = ThemePushButton
1 = ThemeCheckBox
2 = ThemeRadioButton
3 = ThemeMediumBevelButton
4 = ThemeArrowButton
5 = ThemePopupButton
6 = ThemeDisclosureButton
7 = ThemeIncDecButton
8 = ThemeSmallBevelButton
9 = ThemeLargeBevelButton
10 = ThemeListHeaderButton
11 = ThemeRoundButton
12 = ThemeLargeRoundButton
13 = ThemeSmallCheckBox
14 = ThemeSmallRadioButton
15 = ThemeRoundedBevelButton
inNewInfo:
Before calling DrawThemeButton , set the class instance to contain
the new state, value, and adornment for the button. DrawThemeButton
uses the information passed in the inNewInfo and inPrevInfo
parameters to apply transitional animation or sound effects as the
button state changes, if such are specified under the current theme.
inPrevInfo:
If the button state is changing, set the class instance to contain
the previous state, value, and adornment for the button, to allow
DrawThemeButton to apply any transitional effects. If the button
state is not changing, you can pass nil .
inEraseProc:
Always pass nil to this parameter as we dont currently support custom
erase procs.
inLabelProc:
A value of type ThemeButtonDrawUPP . If you pass a class instance that
inherites from ThemeButtonDrawUPP to the function then DrawThemeButton
calls that function to draw the label of the button. If you pass nil ,
no label is drawn.
inUserData:
Provide any data to be passed in to the callback functions specified in
the inLabelProc and inEraseProc parameters. Pass nil if you do not
wish to provide any data.
Returns:
A result code, see result codes.
Notes:
The DrawThemeButton function draws a theme-compliant button. After the button is drawn, if a ThemeButtonDrawUPP is specified in the inLabelProc parameter, DrawThemeButton calls that function to draw the button's label.
Note that DrawThemeButton also draws any appearance adornments for the button and that these can extend beyond the button's basic bounding rectangle, as specified in the inBounds parameter, and may be of variable shape. You may therefore wish to call the function GetThemeButtonBackgroundBounds to obtain the actual rectangle containing the pixels belonging to a button under the current theme.