SplitMenuButton

class SplitMenuButton(text: String, graphic: Node? = null) : ButtonBase, WithItems

A Button split into two parts. The left part acts like a regular Button, the right part acts like a MenuButton, which display items in a PopupMenu when clicked.

Theme DSL

"split_menu_button" {
    child( ".arrow_button" ) { // A Button

        child(".graphic") {
            image( image : Image )
            image( images : NamedImages, imageName : String )

            tint( tint : Color )
        }
    }
}

SplitMenuButton inherits all features of ButtonBase.

".arrow_button" also is a Button, which also inherits all features of ButtonBase.

Constructors

Link copied to clipboard
constructor(text: String, graphic: Node? = null)

Properties

Link copied to clipboard
open override val items: MutableObservableList<Node>
Link copied to clipboard
Link copied to clipboard

An event handler which is performed after the button is clicked, but before the popup menu is built.

Link copied to clipboard
Link copied to clipboard

Set to true, after the button is clicked, and before the PopupMenu is displayed. It is reset to false when the PopupMenu is closed.

Functions

Link copied to clipboard
open override fun nodePrefHeight(): Float

Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.

Link copied to clipboard
open override fun nodePrefWidth(): Float

Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.

Link copied to clipboard
fun onShowing(handlerCombination: HandlerCombination = HandlerCombination.AFTER, block: (event: ActionEvent) -> Unit)

Add an event handler which is performed after the button is clicked, but before the popup menu is built.