# GraffitiPopupMenu
Class Inherits GraffitiWebUIControl
## About
An amazing replacement for the standard PopupMenu control with support for icons, search, per-item styling, and much more!
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Web
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| SearchTypes | Contains <br > BeginsWith | Supported search type models. |
| SortDirections | Ascending <br > Descending | Supported sort directions. |
| States | Unvalidated <br > Valid <br > Invalid | Supported validation states. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| DoubleClick | (None) | (None) | Fires when the user double-clicks the field in MultiSelect. |
| GotFocus | (None) | (None) | Raised when the control receives focus. |
| HeightChanged | oldHeight as Integer | (None) | Raised when the height of the control has changed. Typically used with the AdaptiveHeight property set to True. |
| ItemPressed | item as GraffitiPopupMenuItem | (None) | Raised when an item is pressed |
| LostFocus | (None) | (None) | Raised when the control loses focus. |
| Open | (None) | (None) | (None) |
| PopupButtonPressed | (None) | (None) | Raised when the user clicks the button embedded in the popup menu. |
| PopupHidden | (None) | (None) | Raised when the user has hidden the popup menu. |
| PopupShown | (None) | (None) | Raised when the user has shown the popup menu. |
| SelectionAdded | theItem as GraffitiPopupMenuItem | (None) | Fires when an item is selected in MultiSelect. |
| SelectionChanged | theItem as GraffitiPopupMenuItem | (None) | This event is fired when one or more items in the popupmenu are selected. |
| SelectionCleared | (None) | (None) | This event is raised when the user has cleared the selected items. |
| SelectionRemoved | theItem as GraffitiPopupMenuItem | (None) | Fires when an items is deselected in MultiSelect. |
| Shown | (None) | (None) | (None) |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| AddItem | NewItem as GraffitiPopupMenuItem | (None) | Adds a new item to the list of items in the popupmenu. |
| AddItem | ItemText as String | (None) | Adds a new item to the list of items in the popupmenu. |
| AddItemAt | index as Integer <br> item as GraffitiPopupMenuItem | (None) | Adds the specified item at the provided index. |
| AddItems | items() as GraffitiPopupMenuItem | (None) | Adds the specified array of items to the popupmenu in a single operation. |
| ClosePopup | (None) | (None) | Closes the popup, if it is shown. |
| DeselectAll | DoLockUpdate as Boolean = False | (None) | Clears the current selection. When DoLockUpdate is True, regardless of the value of the LockUpdate property, execution is deferred. |
| ItemAt | index as Integer | GraffitiPopupMenuItem | Returns the item as the specified index within the internal items array. |
| ItemFromTag | theTag as Variant | GraffitiPopupMenuItem | Returns the item whose tag matches theTag . |
| ItemFromText | itemText as String | GraffitiPopupMenuItem | Returns the item whose text matches theText . |
| ItemIndex | theItem as GraffitiPopupMenuItem | Integer | Returned the integer index of the provided item within the internal item array. |
| LastItemIndex | (None) | Integer | Returns the index of the last row of items added to the PopupMenu. |
| OpenPopup | (None) | (None) | Opens the popup. |
| RemoveAllItems | (None) | (None) | Removes all items from the popupmenu and updates the display. |
| RemoveItem | ItemIndex as Integer | (None) | Removes the specified item from the list of items in the popupmenu. |
| RemoveItem | ItemText as String | (None) | Removes the specified item from the list of items in the popupmenu. |
| SelectedItemAt | index as Integer | Boolean | Returns the Selected property value of the item at the specified index. |
| SelectedItemAt | index as Integer <br> assigns value as Boolean | (None) | Sets the Selected property value of the item at the specified index. |
| SelectedItems | (None) | GraffitiPopupMenuItem | Returns the currently selected item(s). |
| SelectedItemsIndexes | (None) | Integer | Returns the indexes of the currently selected item(s). |
| SetFocus | (None) | (None) | (None) |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| AdaptiveHeight | Boolean | (None) | When True, the control will resize vertically based on the height of the selected items and raise the HeightChanged event. |
| AllowAdd | Boolean | (None) | When MultipleSelect = False, AllowAdd being True will cause GraffitiPopupMenu to behave more like a combobox, allowing custom item input. |
| AllowClear | Boolean | (None) | When True, a clear button is displayed in the UI that allows users to clear their previous selection. |
| DropdownStyle | GraffitiStyle | (None) | GraffitiStyle used to apply CSS to the dropdown menu. |
| Enabled | Boolean | (None) | (None) |
| IsPopupVisible | Boolean | (None) | Determines the visible state of the popup menu. |
| LocaleCustom | Boolean | (None) | When True, will use the other Locale properties in place of the default text. |
| LocaleInputTooLong | String | (None) | Text to display when the user has entered too many characters in the search field. |
| LocaleInputTooShort | String | (None) | Text to display when the user hasn't entered enough text in the search field. |
| LocaleNoMatches | String | (None) | Text displayed when the user's search returns an empty set of results. |
| LocaleSelectionTooLarge | String | (None) | Text to display when the user has selected too many items. |
| LockUpdate | Boolean | (None) | When True, code execution to manipulate and update items in the browser is deferred until set to False. |
| MaxSelectedItems | Integer | (None) | Limits the possible amount of selected items. |
| MinimumInputLength | Integer | (None) | Minimum number of characters user must enter before a search will be performed. If 0, all items will be shown by default. |
| MultipleSelect | Boolean | (None) | Determines whether the popupmenu will support selection of multiple items. |
| PlaceholderSearchText | String | (None) | Text to display in the search box for instances where MultipleSelect = False. |
| PlaceholderText | String | (None) | The text to display when there are no items selected. |
| PopupButtonIndicator | WebUIControl.Indicators | (None) | Bootstrap style to apply to the popup button. |
| PopupButtonStyle | GraffitiStyle | (None) | GraffitiStyle to apply to the popup button. |
| PopupButtonText | String | (None) | When populated, a button will be displayed on the popup that, upon click, will raise the PopupButtonPressed event. |
| ReadOnly | Boolean | (None) | If True, the user cannot change the value of the control. |
| ReserveIconSpace | Boolean | (None) | If True, all items will have whitespace on the left of their text whether they have an icon or not. |
| SearchThreshold | Integer | (None) | The number of characters required to trigger the search algorithm. Set to -1 to remove the search field. |
| SearchType | SearchTypes | (None) | Method used when performing a search from the search box for GraffitiPopupMenuItems. |
| SelectedItem | GraffitiPopupMenuItem | (None) | Returns the currently selected item. |
| SortDirection | SortDirections | (None) | Direction to sort items. |
| SortItems | Boolean | (None) | When True, items will be sorted within the dropdown menu. |
| State | States | (None) | Alters the display to convey a validation state. |
| StyleTag | GraffitiStyle | (None) | Style applied to tags when MultipleSelect = True. |
| Text | String | (None) | Current text value of the control. Only applicable when MultipleSelect = False and AllowAdd = True. |