# GraffitiPopupMenu
Class Inherits GraffitiSuite.BaseCanvas
## About
GraffitiPopupMenu is a drop-in replacement for the standard Xojo popupmenu control that supports custom-drawing events for rows and the currently selected value, multiple columns, and has a beautiful platform- and theme-aware design to make it look and feel at home in any UI.
## Preview


Previous
Next
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Desktop
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Attributes
| Name | Value |
| --- | --- |
| DefaultEvent | "Change" |
## Constants
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| SeparatorText | String | - | Text to use for creating a separator item. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| CellBackgroundPaint | g as Graphics <br> row as Integer <br> column as Integer | Boolean | Raised when the cell's background is being drawn. |
| CellTextPaint | g as Graphics <br> row as Integer <br> column as Integer <br> x as Integer <br> y as Integer | Boolean | Raise when the cell's text is being drawn. |
| Change | (None) | (None) | Raised when the user makes a selection. |
| KeyDown | Key as String | Boolean | Raised when the user presses a key on their keyboard while the component has focus. |
| Opening | (None) | (None) | |
| SeparatorPaint | g as Graphics <br> row as Integer <br> column as Integer | Boolean | Raised when a separator is being drawn. |
| ShowMenu | (None) | (None) | Raised when the menu is shown. |
| ValuePaint | g as Graphics <br> byRef bounds as Xojo.Rect | Boolean | Raised when drawing the value in the primary display area. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Sub | AddRow | (None) | Adds a row of content. |
| Function | Cell | As | Returns the content of the specified cell. |
| Sub | Cell | (None) | Returns the content of the specified cell. |
| Function | CellTag | As | Returns the content of the specified cell. |
| Sub | CellTag | (None) | Returns the content of the specified cell. |
| Sub | Constructor | (None) | Creates a new instance of the class. |
| Function | Heading | As | Returns the current text assigned to the column header at the specified index. |
| Sub | Heading | (None) | Returns the current text assigned to the column header at the specified index. |
| Sub | InsertRow | (None) | Inserts the specified text at the provided index. |
| Function | LastIndex | As | Returns the last row's index. |
| Function | ListCount | As | Returns the number of items added. |
| Sub | PopUp | (None) | Shows the menu. |
| Sub | RemoveAllRows | (None) | Removes all rows from the control. |
| Sub | RemoveRow | (None) | Removes the specified row. |
| Function | Row | As | Returns the content of the specified cell. |
| Sub | Row | (None) | Returns the content of the specified cell. |
| Function | RowTag | As | Returns the content of the specified cell. |
| Sub | RowTag | (None) | Returns the content of the specified cell. |
| Function | Text | As | Returns the currently drawn item text within the display. |
| Sub | Text | (None) | Returns the currently drawn item text within the display. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Bold | Boolean | Nil | Font weight. |
| ColumnCount | Integer | Nil | Number of columns in dropdown list. |
| ColumnWidths | String | Nil | Widths of columns in dropdown list. |
| HasHeading | Boolean | Nil | Header in dropdown list. |
| HeaderHeight | Integer | Nil | Header height in dropdown list. |
| InitialValue | String | Nil | Default values; columns separated by Tab character, rows by EndOfLine. |
| Italic | Boolean | Nil | Font obliqueness. |
| ListIndex | Integer | Nil | Currently selected index. |
| ListIndexHover | Integer | Nil | Currently hovered index. |
| MenuHeight | Integer | Nil | |
| MenuHeightMax | Integer | Nil | |
| menuListbox | GraffitiListbox | Nil | |
| MenuWidth | Integer | Nil | |
| menuWindow | GraffitiMenuWindow | Nil | |
| mListIndex | Integer | Nil | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | = | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | = | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| RowHeight | Integer | Nil | Row height in dropdown list. |
| TextFont | String | Nil | Font used to draw value. |
| TextSize | Integer | Nil | Font size used to draw value. |
| TextUnit | REALbasic.FontUnits | Nil | |
| Underline | Boolean | Nil | Text decoration used to draw value. |