ScrollableBar

class ScrollableBar(content: Node? = null) : WrappedNode<ThreeRow>

A scrollable bar, with scroll buttons on the left and right (when horizontal) or at the top and bottom (when vertical).

You may also scroll using a trackpad drag gestures as well as a mouse's scroll-wheel.

This is implemented using a ScrollPane using ScrollBarPolicy.NEVER (so scroll bars are never displayed). The ScrollPane is the center of a ThreeRow, with left and right for the scroll buttons. The scroll buttons only appear when needed (i.e. when there is insufficient space to show the whole of the content).

Anatomy

╭─────────────ScrollableBar─────────────╮
│ ╭──────────────ThreeRow─────────────╮ │
│ │     ╭───────ScrollPane──────╮     │ │
│ │  <  │        content        │  >  │ │
│ │     ╰───────────────────────╯     │ │
│ ╰───────────────────────────────────╯ │
╰───────────────────────────────────────╯

The scroll buttons (displayed above a < and >) are only visible when content is wider than the available space.

Constructors

Link copied to clipboard
constructor(content: Node? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The center of threeRow.

Link copied to clipboard

Scroll buttons are on the left and right (or top and bottom), The center is a scrollPane whose content is bound to this control's content.

Functions

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

Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinHeight. The default implementation returns 0.

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

Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinWidth. The default implementation returns 0.

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 scrollTo(contentDescendant: Node)
Link copied to clipboard
fun scrollToX(contentX: Float)
Link copied to clipboard
fun scrollToY(contentY: Float)