Table of Contents
Preview #
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
Enumerations #
Name | Values |
---|---|
Orientations | Horizontal Vetical |
ScrollbarVisibilities | Auto Always Never |
Constants #
This class exposes no constants.
Events #
Name | Parameters | Return Type | Description |
---|---|---|---|
DrawItemDescription | g as Graphics item as GraffitiPanelSelectorItem 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 item as GraffitiPanelSelectorItem 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 item as GraffitiPanelSelectorItem 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 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 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. |
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 item as GraffitiPanelSelectorItem | Boolean | Raised when an item’s background is being drawn. Return True to cancel default drawing. |
Methods #
Name | Parameters | Return Type | Description |
---|---|---|---|
Add | item as GraffitiTabBarItem | None | Adds a new TabBarItem. |
AddAt | index as Integer item as GraffitiTabBarItem | None | Adds a new TabBarItem at the specified index. |
IndexOf | item as GraffitiTabBarItem | 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 | GraffitiTabBarItem | Returns the item at the specified index. |
LastIndex | None | Integer | Returns the last index of the items array. |
Remove | item as GraffitiTabBarItem | None | Removes the specified item. |
RemoveAll | None | None | Removes all items from the component. |
RemoveAt | index as Integer | None | Removes the item at the specified index. |
ScrollTo | item as GraffitiTabBarItem | None | Scrolls the display to show the specified item. |
Properties #
Name | Type | Default Value | Description |
---|---|---|---|
AllowDragScrolling | Boolean | False | Controls whether users may scroll the display by dragging. |
AnimationEasing | GraffitiAnimator.Easings | GraffitiAnimator.Easings.Linear | Determines the animation algorithm used for scroll or selection operations. |
AnimationLength | Integer | 800 | Determines the length of animations. |
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 | 2 | 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. |
HasBackground | Boolean | True | Determines whether a background should be drawn. |
HasBorder | Boolean | True | Determines whether a border should be drawn. |
Orientation | Orientations | Orientations.Horizontal | Controls whether the control operates vertically or horizontally. |
Padding | Integer | 0 | 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 | 14 | Corner radius applied to items. |
PanelBorderSize | Integer | 0 | Size of border drawn around items. |
PanelPadding | Integer | 4 | Padding, in points, used for spacing inside items. |
ScrollbarVisibility | ScrollbarVisibilities | ScrollbarVisibilities.Auto | Determines the behavior of the scrollbar, when necessary. |
ScrollPosition | Integer | 0 | 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. |