# DropdownNode
Class Inherits FormControlNode
## About
`DropdownNode` represents an HTML select control with an ordered collection of `FormOption` values. It supports name, required and disabled state, multiple selection where available, and option editing through the inspector.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| ActionItem | index As Integer | ToolbarItem | Returns the contextual toolbar item at the specified index. |
| AddOption | caption As String <br> value As String = "" <br> selected As Boolean = False <br> disabled As Boolean = False | (None) | Adds a selectable option. |
| AddVectorPDFAnnotations | pdf As PDFDocument <br> pageNumber As Integer <br> offsetX As Double <br> offsetY As Double <br> usedNames As Dictionary <br> formAction As String = "" | (None) | Adds this node's interactive annotations and form controls to a vector PDF page. Override for custom nodes. |
| ClearOptions | (None) | (None) | Removes all options. |
| Constructor | (None) | (None) | Creates a new dropdown node. |
| Destructor | (None) | (None) | Releases option event handlers owned by this node. |
| Duplicate | (None) | Node | Returns an indepent copy of this node. |
| FromHTML | element As HTMLSupport.HTMLElement | Boolean | Imports a select element. |
| FromJSON | data As JSONItem | Boolean | Restores state from JSON. |
| HandlePress | x As Double <br> y As Double | Boolean | Opens the option menu or updates a visible list option when the dropdown is pressed. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| InspectorSections | (None) | InspectorSection | Returns the user-editable dropdown and option properties exposed by the inspector. |
| LastActionIndex | (None) | Integer | Returns the last zero-based action index supplied by this node, or -1 when there are no actions. |
| LastOptionIndex | (None) | Integer | Returns the last zero-based option index, or -1 when there are no options. |
| LocalizeToolbarItem | strings As GraffitiProEditor.Editor | (None) | Sets this node type's toolbar item text from the supplied editor's localization properties. The editor calls it when the type is registered, when the editor opens, and when a locale pack is applied to the editor. A custom node type can override it to localize its own toolbar item. |
| OptionAt | index As Integer | FormOption | Returns the option at the specified index. |
| PerformAction | index As Integer <br> selectedItem As DesktopMenuItem | (None) | Handles the contextual toolbar action. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of the main-toolbar item. |
| PreferredHeight | g As Graphics <br> availableWidth As Double | Double | Returns the preferred height. |
| RemoveOptionAt | index As Integer | (None) | Removes the option at the specified index. |
| Render | g As Graphics <br> bounds As Rect <br> selected As Boolean | (None) | Draws the dropdown preview. |
| SupportsTextAlignment | (None) | Boolean | Returns whether the node draws text that follows its TextAlignment. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| ToJSON | (None) | JSONItem | Returns the persistent state as JSON. |
| TypeName | (None) | String | Returns the display name. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| AutoComplete | String | (None) | Gets or sets the autocomplete tokens. |
| Multiple | Boolean | (None) | Gets or sets whether multiple options may be selected. |
| Required | Boolean | (None) | Gets or sets whether a selection is required. |
| Size | Integer | (None) | Gets or sets the number of visible options. |
## Notes
The dropdown owns its option collection and default selection.
### JSON Format
`autoComplete` is a string, `multiple` and `required` are Boolean, and `size` is an integer. `options` is an ordered array of `FormOption` objects. Common field state is supplied by `FormControlNode`.
`autoComplete` is omitted when empty, `multiple` and `required` when `False`, and `size` when it is `1`; missing names restore those defaults.
### Options and Interaction
Inspector actions add, insert, remove, and reorder options. Each option has a label, submitted value, disabled state, and default-selection state. Clicking an already selected dropdown node opens its option menu; the first click selects the node without opening the menu.