DropDownBox
Collapsible container widget with an expandable header button and popup or inline content host.
Overview
DropDownBox manages an expandable content area triggered by a toggleable header button. Supports both inline layout expansion and overlay popup layers, with automatic arrow indicators and scroll containment.
Basic DropDownBox
DropDownBox dropdown = new DropDownBox()
.headerText("Advanced Settings")
.content(new VBox().children(setting1, setting2))
.useOverlay();
API
DropDownBox::close()
Close Dropdown
Collapses dropdown content.
Returns DropDownBox.
DropDownBox::content(Widget)
Set Content Widget
Sets child content widget hosted in dropdown.
| Parameter | Type | Description |
|---|---|---|
content |
Widget |
— |
Returns DropDownBox.
DropDownBox::contentHost()
Content Host
Returns container hosting dropdown content widget.
Returns Box.
DropDownBox::contentScroll()
Content ScrollView
Returns ScrollView wrapping dropdown content.
Returns ScrollView.
DropDownBox::dropDownWidth()
Get DropDown Width
Returns explicit dropdown popup width or 0 for auto.
Returns float.
DropDownBox::dropDownWidth(float)
Set DropDown Width
Sets explicit dropdown popup width.
| Parameter | Type | Description |
|---|---|---|
width |
float |
— |
Returns DropDownBox.
DropDownBox::headerText(String)
Set Header Text
Sets header button plain text label.
| Parameter | Type | Description |
|---|---|---|
headerText |
String |
— |
Returns DropDownBox.
DropDownBox::maxContentHeight()
Max Content Height
Returns maximum dropdown scroll height.
Returns float.
DropDownBox::maxContentHeight(float)
Set Max Content Height
Sets maximum dropdown scroll height before scrolling is enabled.
| Parameter | Type | Description |
|---|---|---|
height |
float |
— |
Returns DropDownBox.
DropDownBox::open()
Open Dropdown
Expands dropdown content.
Returns DropDownBox.
DropDownBox::opened()
Is Opened
Returns whether dropdown content is currently expanded.
Returns boolean.
DropDownBox::richHeaderText()
Get Rich Header Text
Returns formatted header button rich text.
Returns RichText.
DropDownBox::richHeaderText(RichText)
Set Rich Header Text
Sets formatted header button rich text.
| Parameter | Type | Description |
|---|---|---|
headerText |
RichText |
— |
Returns DropDownBox.
DropDownBox::toggle()
Toggle Dropdown
Toggles dropdown expanded state.
Returns DropDownBox.
DropDownBox::useInline()
Use Inline Mode
Switches dropdown to expand inline within parent layout.
Returns DropDownBox.
DropDownBox::useOverlay()
Use Overlay Mode
Switches dropdown to popup overlay layer above other widgets.
Returns DropDownBox.