# GraffitiPanelSelector
Class Inherits GraffitiUIControl
## About
GraffitiPanelSelector is a control that is designed to provide a mechanism for selecting between a short list of items in an appealing vertical or horizontal display.
Features:
*
Custom color properties for the entire control or individual items
*
Custom drawing events
*
Keyboard-based selection change
*
Custom item width definitions
*
Beautiful animations
## Preview
## Attributes
| Name | Value |
| --- | --- |
| DefaultEvent | "SelectionChanged" |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| Orientations | Horizontal <br> Vertical | Supported display directions. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Closing | (None) | (None) | |
| DrawItemDescription | g as Graphics <br> item as GraffitiPanelSelectorItem <br> bounds as Rect | Boolean | Raised when an item's description is being drawn. Return True if you do not wish for the component to draw the default. Modify bounds to reposition. |
| DrawItemIcon | g as Graphics <br> item as GraffitiPanelSelectorItem <br> bounds as Rect | Boolean | Raised when an item's icon is being drawn. Return True if you do not wish for the component to draw the default. Modify bounds to reposition. |
| DrawItemTitle | g as Graphics <br> item as GraffitiPanelSelectorItem <br> bounds as Rect | Boolean | Raised when an item's title is being drawn. Return True if you do not wish for the component to draw the default. Modify bounds to reposition. |
| DrawSelectionRect | g as Graphics <br> bounds as Rect | Boolean | Raised when the selection rect is being drawn. Return True if you do not wish for the component to draw the default. Modify bounds to reposition. |
| ItemMouseEnter | item as GraffitiPanelSelectorItem | (None) | Raised when the user's cursor enters an item's area. |
| ItemMouseExit | item as GraffitiPanelSelectorItem | (None) | Raised when the user's cursor exits an item's area. |
| ItemPressed | item as GraffitiPanelSelectorItem <br> position as Point | Boolean | Raised when the user presses an item. Return True to cancel selection change. Position is relative to that item's Left/Top. |
| MouseEnter | (None) | (None) | |
| MouseExit | (None) | (None) | |
| Opening | (None) | (None) | |
| PaintBackground | g as Graphics | Boolean | Raised when the background of the component is being drawn. Return True to cancel default drawing. |
| PaintItemBackground | g as graphics <br> item as GraffitiPanelSelectorItem | Boolean | Raised when an item's background is being drawn. Return True to cancel default drawing. |
| SelectionChanged | (None) | (None) | Raised when the selection has changed. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Add | item as GraffitiPanelSelectorItem | (None) | Adds a new item. |
| AddAt | index as Integer <br> item as GraffitiPanelSelectorItem | (None) | Adds a new item at the specified index. |
| IndexOf | item as GraffitiPanelSelectorItem | Integer | Returns the index of the specified item. |
| InvalidateAll | (None) | (None) | Causes the component to destroy all cached images of items and redraw fresh. |
| ItemAt | index as Integer | GraffitiPanelSelectorItem | Returns the item at the specified index. |
| LastIndex | (None) | Integer | Returns the last index of the items array. |
| Attributes | Hidden | raiseDrawItemDescription | |
| Attributes | Hidden | raiseDrawItemIcon | |
| Attributes | Hidden | raiseDrawItemTitle | |
| Attributes | Hidden | raisePaintItemBackground | |
| RemoveAll | (None) | (None) | Removes all items from the component. |
| RemoveAt | index as Integer | (None) | Removes the item at the specified index. |
| ScrollTo | item as GraffitiPanelSelectorItem <br> immediate as Boolean = False | (None) | Scrolls the display to show the specified item. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| AnimationEasing | GraffitiAnimator.Easings | Nil | Determines the animation algorithm used for scroll or selection operations. |
| AnimationLength | Integer | 800 | Determines the length of animations. |
| Attributes | contentsChanged | Boolean | |
| Attributes | mouseOverItem | GraffitiPanelSelectorItem | |
| BackgroundColor | ColorGroup | Nil | Colors used to draw the background of the component. |
| BorderColor | ColorGroup | Nil | Colors used to draw the border of the component. |
| BorderSize | Integer | Nil | Point size of the border of the component. |
| DescriptionColorDefault | ColorGroup | Nil | Colors used to draw the description text of items when neither hovered or selected. |
| DescriptionColorHovered | ColorGroup | Nil | Colors used to draw the description text of items when hovered. |
| DescriptionColorSelected | ColorGroup | Nil | Colors used to draw the description text of items when selected. |
| DescriptionFont | Font | Nil | Font used to draw description text. |
| HasBackgroundColor | Boolean | Nil | Controls whether a background color is drawn. |
| HasBorder | Boolean | Nil | Determines whether a border should be drawn. |
| Orientation | Orientations | Nil | Controls whether the control operates vertically or horizontally. |
| Padding | Integer | Nil | Outside padding applied between component and item edges. |
| PanelBackgroundColorDefault | ColorGroup | Nil | Colors used to draw the background of items when neither hovered or selected. |
| PanelBackgroundColorHovered | ColorGroup | Nil | Colors used to draw the background of items when hovered. |
| PanelBackgroundColorSelected | ColorGroup | Nil | Colors used to draw the background of items when selected. |
| PanelBorderRadius | Integer | Nil | Corner radius applied to items. |
| PanelBorderSize | Double | Nil | Size of border drawn around items. |
| PanelPadding | Integer | Nil | Padding, in points, used for spacing inside items. |
| ScrollPosition | Integer | Nil | Current offset of the items within the component's display. |
| SelectedItem | GraffitiPanelSelectorItem | Nil | The currently selected item. |
| SelectionColor | ColorGroup | Nil | Colors used for drawing the selection rect. |
| TitleColorDefault | ColorGroup | Nil | Colors used for drawing item titles when neither hovered or selected. |
| TitleColorHovered | ColorGroup | Nil | Colors used for drawing item titles when hovered. |
| TitleColorSelected | ColorGroup | Nil | Colors used for drawing item titles when selected. |
| TitleFont | Font | Nil | Font used to draw title text. |