# 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) | (None) |
| FocusReceived | (None) | (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) | (None) |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Push | MouseButton as Integer | (None) | Signals the control to fire the Action event. |
| StyleCount | (None) | Integer | Returns the number of styles currently available for display. For enumeration, use StyleCount – 1 |
| StyleName | StyleIndex as Integer | String | Returns the name of the style corresponding to the Index passed. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| BackColor | Color | (None) | The background color of the control. |
| BackDown | Color | (None) | The background color of the control when the mouse is down. |
| BackOver | Color | (None) | The background color of the control when the mouse is hovering over it. |
| BGPictureDisabled | Picture | (None) | When using style 13, Image Button, this will be the background of the control when it is disabled. |
| BGPictureDown | Picture | (None) | When using style 13, Image Button, this will be the background of the control when the mouse is down. |
| BGPictureNormal | Picture | (None) | When using style 13, Image Button, this will be the background of the control in an idle state. |
| BGPictureOver | Picture | (None) | When using style 13, Image Button, this will be the background of the control when the mouse is hovering over it. |
| Bold | Boolean | (None) | Determines the font weight of the text. |
| BorderColorDark | Color | (None) | Dark border color when the control is in an idle state. |
| BorderColorDarkDown | Color | (None) | Dark border color when the mouse is down over the control. |
| BorderColorDarkOver | Color | (None) | Dark border color when the mouse is hovering over the control. |
| BorderColorLight | Color | (None) | Light border color of the control in an idle state. |
| BorderColorLightDown | Color | (None) | Light border color when the mouse is down over the control. |
| BorderColorLightOver | Color | (None) | Light border color when the mouse is hovering over the control. |
| Cancel | Boolean | (None) | Determines whether this control reacts when the user presses the ESC key on it’s window. |
| CheckBoxBehavior | Boolean | (None) | Sets whether the control’s state is sticky. |
| CheckValue | Boolean | (None) | When CheckBoxBehavior is True, this will reflect the current value of the button. |
| Default | Boolean | (None) | Determines whether this control reacts when the user presses the Enter or Return keys on the keyboard. |
| DropDownBackColor | Color | (None) | Determines the background color of the drop down portion of the button in an idle state. |
| DropDownBackDown | Color | (None) | Determines the background color of the drop down portion of the button when the mouse is down. |
| DropDownBackOver | Color | (None) | Determines the background color of the drop down portion of the button when the mouse is hovering over it. |
| DropDownBorderDark | Color | (None) | Determines the dark border color of the drop down portion of the control in an idle state. |
| DropDownBorderDarkDown | Color | (None) | Determines the dark border color of the drop down portion of the control when the mouse is down. |
| DropDownBorderDarkOver | Color | (None) | Determines the dark border color of the drop down portion of the control when the mouse is hovering above it. |
| DropDownBorderLight | Color | (None) | Determines the light border color of the drop down portion of the control in an idle state. |
| DropDownBorderLightDown | Color | (None) | Determines the light border color of the drop down portion of the control when the mouse is down. |
| DropDownBorderLightOver | Color | (None) | Determines the light border color of the drop down portion of the control when the mouse is hovering over it. |
| DropDownTriangle | Color | (None) | Determines the background color of the drop down disclosure triangle. |
| DropDownTriangleDown | Color | (None) | Determines the background color of the drop down disclosure triangle when the mouse is down. |
| DropDownTriangleOver | Color | (None) | Determines the background color of the drop down disclosure triangle when the mouse is hovering over it. |
| FontName | String | (None) | Sets the font used to display text in the control. |
| FontSize | Integer | (None) | Sets the size of the fond used to display text in the control. |
| ForeColor | Color | (None) | (None) |
| IconPosition | Integer | (None) | Position of icon relative to text. |
| Italic | Boolean | (None) | Determines whether the text will be displayed in italics. |
| PictureDisabled | Picture | (None) | Sets the icon to be displayed within the button when the control is disabled. |
| PictureDisabled2X | Picture | (None) | Picture drawn when the control is disabled. |
| PictureDown | Picture | (None) | Sets the icon to be displayed within the button when the mouse is down. |
| PictureDown2X | Picture | (None) | Picture drawn when control is pressed. |
| PictureNormal | Picture | (None) | Sets the icon to be displayed within the button when in an idle state. |
| PictureNormal2X | Picture | (None) | Background picture. |
| PictureOver | Picture | (None) | Sets the icon to be displayed within the button when the mouse is hovering over it. |
| PictureOver2X | Picture | (None) | Picture drawn when the mouse is hovered over the control. |
| ShowFocusRect | Boolean | (None) | Determines whether the control will draw a focus rectangle when it has focus. |
| Style | Styles | (None) | Sets the display style of the control. |
| Text | String | (None) | 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 | (None) | Color of the text when the control is disabled. |
| TextColorDown | Color | (None) | Color of the text when the mouse is down. |
| TextColorNormal | Color | (None) | Color of the text when the control is in an idle state. |
| TextColorOver | Color | (None) | Color of the text when the mouse is hovering over the control. |
| TextPosition | Positions | (None) | Position of the text and picture within the control. |
| Underline | Boolean | (None) | Sets the decoration of the text. |
| UseSystemColors | Boolean | (None) | Determines whether the control will use the custom color properties, or the default colors for the styles. |