# GraffitiButton
Class Inherits GraffitiSuite.BaseCanvas
## About
GraffitiButton is highly flexible and configurable allowing the user to define their own color schemes, or use the default/system colors. With over 60 different visual styles, you’ll most definitely be happy with this custom control in your Xojo applications.
**
Features:
**
*
Each button has 4-States
*
Definable pictures (4-state)
*
Supports left and right clicks
*
Show/Hide Focus Rect
*
Use System or Custom Colors/Fonts
*
Shadow Text
*
CheckBoxBehavior (Sticky, Boolean)
*
Default and Cancel (Return and Escape keys) handling
*
Mock-Toolbar styles
*
Text and Picture Alignments
*
Blurred Text Shadows
*
Drop-Down menu buttons
## Preview


Previous
Next
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Desktop
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Attributes
| Name | Value |
| --- | --- |
| DefaultEvent | "Action" |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| Positions | PositionCenter <br> PositionLeft <br> PositionRight | Placement of icon within button, relative to text. |
| Styles | Windows16Bit <br> Windows32Bit <br> WindowsXP <br> Aqua <br> KDE2 <br> MacClassic <br> OfficeXP <br> Gel <br> ThreeDHover <br> Faded <br> WordPress <br> Firefox <br> OvalPopup <br> ImageButton <br> TabXP <br> InsetOrb <br> PlasticOrb <br> NeonAndSteel <br> InsetRect <br> Office2003 <br> Sleek <br> AYBFramed <br> SimpleFlat <br> Dented <br> Riveted <br> Aurora <br> LongView <br> LongViewDuo <br> Flock <br> LongViewTrio <br> VintageAOL <br> DualGripXP <br> PictureFrame <br> KeyboardKeys <br> GlassTech <br> BoxedLeft <br> BoxedRight <br> ProOutlinedBevel <br> GlowingTool <br> GelCap <br> Diamonesque <br> Banded <br> Electric <br> Stock <br> ThinPill <br> Yahoo <br> LongViewQuatro <br> HotNET <br> LongViewQuint <br> LongViewHexad <br> BandedTop <br> RoundMedia <br> SoftBevelXP <br> Win16DropDown <br> Firefox2Middle <br> Firefox2Left <br> Firefox2Right <br> Win32Dropdown <br> WinXPDropdown <br> PlasticMiddle <br> PlasticLeft <br> PlasticRight <br> WinXPDropdownDivided <br> SoftBevelXPDropdown <br> Win7Default | Available drawing styles. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Action | Button as Integer <br> X as Integer <br> Y as integer | (None) | Fires when the user clicks the control. Button is the mouse button which was clicked, 0 for Left, 1 for right. X and Y are the coordinates of the mouse position when clicked. |
| DropDownClick | (None) | (None) | Fires when the user clicks the drop down portion of buttons whose style have a drop down button. |
| FocusLost | (None) | (None) | |
| FocusReceived | (None) | (None) | |
| KeyPress | Key as String | (None) | Fires when the user presses a key on their keyboard while the control has focus. |
| MouseEnter | (None) | (None) | Fires when the mouse enters the control’s bounds. |
| MouseExit | (None) | (None) | Fires when the mouse leaves the control’s bounds. |
| MouseMove | X As Integer <br> Y As Integer | (None) | Fires when the mouse is moved over the control. X and Y are the coordinates of the mouse when the event fires. |
| Opening | (None) | (None) | |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Sub | Push | (None) | Signals the control to fire the Action event. |
| Function | StyleCount | As | Returns the number of styles currently available for display. For enumeration, use StyleCount – 1 |
| Function | StyleName | As | Returns the name of the style corresponding to the Index passed. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| BackColor | Color | Nil | The background color of the control. |
| BackDown | Color | Nil | The background color of the control when the mouse is down. |
| BackOver | Color | Nil | The background color of the control when the mouse is hovering over it. |
| BGPictureDisabled | Picture | Nil | When using style 13, Image Button, this will be the background of the control when it is disabled. |
| BGPictureDown | Picture | Nil | When using style 13, Image Button, this will be the background of the control when the mouse is down. |
| BGPictureNormal | Picture | Nil | When using style 13, Image Button, this will be the background of the control in an idle state. |
| BGPictureOver | Picture | Nil | When using style 13, Image Button, this will be the background of the control when the mouse is hovering over it. |
| Bold | Boolean | Nil | Determines the font weight of the text. |
| BorderColorDark | Color | Nil | Dark border color when the control is in an idle state. |
| BorderColorDarkDown | Color | Nil | Dark border color when the mouse is down over the control. |
| BorderColorDarkOver | Color | Nil | Dark border color when the mouse is hovering over the control. |
| BorderColorLight | Color | Nil | Light border color of the control in an idle state. |
| BorderColorLightDown | Color | Nil | Light border color when the mouse is down over the control. |
| BorderColorLightOver | Color | Nil | Light border color when the mouse is hovering over the control. |
| Cancel | Boolean | Nil | Determines whether this control reacts when the user presses the ESC key on it’s window. |
| CheckBoxBehavior | Boolean | Nil | Sets whether the control’s state is sticky. |
| CheckValue | Boolean | Nil | When CheckBoxBehavior is True, this will reflect the current value of the button. |
| Default | Boolean | Nil | Determines whether this control reacts when the user presses the Enter or Return keys on the keyboard. |
| DropDownBackColor | Color | Nil | Determines the background color of the drop down portion of the button in an idle state. |
| DropDownBackDown | Color | Nil | Determines the background color of the drop down portion of the button when the mouse is down. |
| DropDownBackOver | Color | Nil | Determines the background color of the drop down portion of the button when the mouse is hovering over it. |
| DropDownBorderDark | Color | Nil | Determines the dark border color of the drop down portion of the control in an idle state. |
| DropDownBorderDarkDown | Color | Nil | Determines the dark border color of the drop down portion of the control when the mouse is down. |
| DropDownBorderDarkOver | Color | Nil | Determines the dark border color of the drop down portion of the control when the mouse is hovering above it. |
| DropDownBorderLight | Color | Nil | Determines the light border color of the drop down portion of the control in an idle state. |
| DropDownBorderLightDown | Color | Nil | Determines the light border color of the drop down portion of the control when the mouse is down. |
| DropDownBorderLightOver | Color | Nil | Determines the light border color of the drop down portion of the control when the mouse is hovering over it. |
| DropDownTriangle | Color | Nil | Determines the background color of the drop down disclosure triangle. |
| DropDownTriangleDown | Color | Nil | Determines the background color of the drop down disclosure triangle when the mouse is down. |
| DropDownTriangleOver | Color | Nil | Determines the background color of the drop down disclosure triangle when the mouse is hovering over it. |
| FontName | String | Nil | Sets the font used to display text in the control. |
| FontSize | Integer | Nil | Sets the size of the fond used to display text in the control. |
| ForeColor | Color | Nil | |
| IconPosition | Integer | Nil | Position of icon relative to text. |
| Italic | Boolean | Nil | Determines whether the text will be displayed in italics. |
| PictureDisabled | Picture | Nil | Sets the icon to be displayed within the button when the control is disabled. |
| PictureDisabled2X | Picture | Nil | Picture drawn when the control is disabled. |
| PictureDown | Picture | Nil | Sets the icon to be displayed within the button when the mouse is down. |
| PictureDown2X | Picture | Nil | Picture drawn when control is pressed. |
| PictureNormal | Picture | Nil | Sets the icon to be displayed within the button when in an idle state. |
| PictureNormal2X | Picture | Nil | Background picture. |
| PictureOver | Picture | Nil | Sets the icon to be displayed within the button when the mouse is hovering over it. |
| PictureOver2X | Picture | Nil | Picture drawn when the mouse is hovered over the control. |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | Nil | |
| ShowFocusRect | Boolean | Nil | Determines whether the control will draw a focus rectangle when it has focus. |
| Style | Styles | Nil | Sets the display style of the control. |
| Text | String | Nil | The text of the button. You can use an ampersand (&) to display an underline on a character to signify a corresponding menu operation. |
| TextColorDisabled | Color | Nil | Color of the text when the control is disabled. |
| TextColorDown | Color | Nil | Color of the text when the mouse is down. |
| TextColorNormal | Color | Nil | Color of the text when the control is in an idle state. |
| TextColorOver | Color | Nil | Color of the text when the mouse is hovering over the control. |
| TextPosition | Positions | Nil | Position of the text and picture within the control. |
| Underline | Boolean | Nil | Sets the decoration of the text. |
| UseSystemColors | Boolean | Nil | Determines whether the control will use the custom color properties, or the default colors for the styles. |