Dock

class Dock : Div(source)

Panels in groups, of which each shows one panel at a time under the tabs of all, and in splits of groups next to and above each other. A panel is added with panel; dragging its tab onto another group docks it there: in the middle as a tab, at a side next to the group. A panel dragged out of the window, or of which the tab is double clicked, goes into a window of its own, and back into the dock when that window is closed.

The groups are dock-groups with a dock-tab-bar of dock-tabs, the tab of the panel that shows is :selected; the content of a panel is a dock-content.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

the attributes of the element, which attribute selectors like [label="OK"] select, see setAttribute

Link copied to clipboard
val changed: Event<Dock>

the layout changed

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

the panels that are closed, see close

Link copied to clipboard
Link copied to clipboard

builds the menu that opens when the element is clicked with the right button, null for none

Link copied to clipboard

The radius of the corners of this in pixels, of its org.openrndr.panel.style.borderRadius: in pixels, or a percentage of its shorter side; at most half of it

Link copied to clipboard
Link copied to clipboard

what the element does in drag and drop, see DragAndDrop

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

the history of the control manager of this element, null when it is not in one

Link copied to clipboard

the panels that are taken out into windows of their own

Link copied to clipboard
open val handlesDoubleClick: Boolean = false
Link copied to clipboard
open val handlesKeyboardFocus: Boolean = false
Link copied to clipboard
open val heightHint: Double?
Link copied to clipboard
var id: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var layoutOffset: Vector2

an offset of the element from where it is laid out, while it moves there, see org.openrndr.panel.animateMoveFrom

Link copied to clipboard

false for elements that place their children themselves, like the spans of RichText

Link copied to clipboard

The largest scrollLeft: how far the content of the element extends beyond its right side, as found by the last layout.

Link copied to clipboard

The largest scrollTop: how far the content of the element extends beyond its bottom, as found by the last layout.

Link copied to clipboard
Link copied to clipboard
val Element.ownTransform: Matrix44?

The transform of the element itself, in the coordinates of the window, around its transform origin; null when it has none

Link copied to clipboard
open val paintArea: Rectangle

The area the element draws in, on the screen: its box and what is drawn around it, like knobs, focus rings and outlines. Only the areas of the elements that changed are drawn again, a control that draws further than this gives a larger area.

Link copied to clipboard

a panel was closed, see close

Link copied to clipboard

a panel that was closed was opened again, see open

Link copied to clipboard

all panels: docked, in windows of their own and closed

Link copied to clipboard

the text of the control manager of the element, null when it is not in one

Link copied to clipboard
Link copied to clipboard

the layout, null when the dock has no panels

Link copied to clipboard
val screenArea: Rectangle
Link copied to clipboard
val screenPosition: Vector2
Link copied to clipboard
val Element.screenTransform: Matrix44?

the transform of the element by its own transform and those of its ancestors, null when there are none

Link copied to clipboard

how far the content of an element that scrolls is scrolled to the left, in pixels

Link copied to clipboard
val scrollTarget: Vector2

where the content is scrolled to: the end of smooth scrolling, or the scroll position

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val textInputArea: TextInputArea?

Where text is typed in this element while it has the focus: the line of the caret, in the coordinates of the window, with the caret from its left edge. The control manager gives it to the window, so that input methods place their candidates and on-screen keyboards next to the caret; null for elements that do not take text.

Link copied to clipboard
open var tooltip: String?

the text shown next to the pointer when it rests on the element, null for none

Link copied to clipboard
Link copied to clipboard

the bindings of values of the element, checked every frame, see org.openrndr.panel.binding.bindValue

Link copied to clipboard
open val widthHint: Double?
Link copied to clipboard
var windowBackground: ColorRGBa

the color of the windows that panels are taken out into, under the panels

Functions

Link copied to clipboard
Link copied to clipboard
fun Element.animateMoveFrom(from: Vector2)

Moves the element from from, a point of the window where its top-left corner was, to where it is laid out in the next frame, like when it moved to another place in a list

Link copied to clipboard
inline fun append(builder: Element.() -> Unit)
open fun append(element: Element)
Link copied to clipboard
fun attribute(name: String): String?

the value of the attribute name, null when the element does not have it

Link copied to clipboard
fun TextElement.bind(property: KMutableProperty0<String>, program: Program? = null): Binding0<Unit, String>
Link copied to clipboard
fun <T> Element.bindValue(changed: Event<*>, property: KMutableProperty0<T>, elementValue: () -> T, setElementValue: (T) -> Unit): PropertyBinding<T>

binds the value of this element to property, see bindValue

fun <T> Element.bindValue(changed: Event<*>, get: () -> T, set: (T) -> Unit, elementValue: () -> T, setElementValue: (T) -> Unit): PropertyBinding<T>

Binds the value of this element to get and set: when changed happens, elementValue is set with set, and when get changes, setElementValue shows it in the element

Link copied to clipboard
fun Element.button(vararg classes: String, label: String = "button", init: Button.() -> Unit): Button
Link copied to clipboard
fun Element.canvas(vararg classes: String, init: Canvas.() -> Unit): Canvas
Link copied to clipboard
fun childIndex(element: Element): Int?
Link copied to clipboard
Link copied to clipboard
fun close(panel: DockPanel)

Closes panel when it is DockPanel.closable: takes it out of its group, and the group out of the layout when it is empty, or out of its window, which closes. The panel and its content are kept, neither laid out nor drawn, until open brings it back where it was.

open override fun close()
Link copied to clipboard
fun Element.colorEditor(vararg classes: String, init: ColorEditor.() -> Unit): ColorEditor
Link copied to clipboard
fun Element.colorpicker(vararg classes: String, init: Colorpicker.() -> Unit): Colorpicker
Link copied to clipboard
Link copied to clipboard
fun Element.console(vararg classes: String, init: Console.() -> Unit = {}): Console

a Console, init sets it up

Link copied to clipboard
fun Element.containsScreenPoint(position: Vector2): Boolean

true when the point position of the window is in the box of the element as it is drawn, transformed

Link copied to clipboard

sets the menu that opens when this element is clicked with the right button, see Element.contextMenu

Link copied to clipboard
fun Element.curveEditor(vararg classes: String, init: CurveEditor.() -> Unit): CurveEditor
Link copied to clipboard
fun <T> Element.dataTable(rows: List<T>, columns: List<Column<T>>, vararg classes: String, rowHeight: Double = 24.0, init: DataTable<T>.() -> Unit = {}): DataTable<T>
Link copied to clipboard
Link copied to clipboard
fun Element.div(vararg classes: String, init: Div.() -> Unit): Div
Link copied to clipboard
fun dock(panel: DockPanel, group: DockNode.Group?, zone: DockZone)

docks panel in zone of group, the root when null, out of where it is

Link copied to clipboard
fun Element.dock(vararg classes: String, init: Dock.() -> Unit): Dock

a Dock, init adds its panels with Dock.panel

Link copied to clipboard
fun dockFromWindow(panel: DockPanel, group: DockNode.Group? = null, zone: DockZone = DockZone.CENTER)

puts panel back into zone of group from its window in the next frame of the dock, the last group when null

Link copied to clipboard
open override fun draw(drawer: Drawer)

draws the background and the border of the box when they are set, the text is drawn by its text nodes

Link copied to clipboard
fun Element.dropdownButton(vararg classes: String, id: String? = null, label: String = "button", init: DropdownButton.() -> Unit): DropdownButton
Link copied to clipboard
inline fun <reified T> elementWithId(id: String): T?
Link copied to clipboard
Link copied to clipboard
fun Element.envelopeButton(vararg classes: String, init: EnvelopeButton.() -> Unit): EnvelopeButton
Link copied to clipboard
fun Element.envelopeEditor(vararg classes: String, init: EnvelopeEditor.() -> Unit): EnvelopeEditor
Link copied to clipboard
fun Element.expressionArea(vararg classes: String, init: ExpressionArea.() -> Unit): ExpressionArea
Link copied to clipboard
fun Element.fadeIn(duration: Double = 0.15)

fades the element in over duration seconds

Link copied to clipboard
fun Element.fcurveEditor(vararg classes: String, init: FCurveEditor.() -> Unit): FCurveEditor
Link copied to clipboard
Link copied to clipboard
fun Element.findAll(predicate: (Element) -> Boolean): List<Element>
Link copied to clipboard
Link copied to clipboard
fun findFirst(element: Element, matches: (Element) -> Boolean): Element?
Link copied to clipboard
fun findNext(premise: (Element) -> Boolean): Element?
Link copied to clipboard
fun findPrevious(premise: (Element) -> Boolean): Element?
Link copied to clipboard
Link copied to clipboard
fun float(panel: DockPanel, position: IntVector2? = null, size: Vector2? = null)

takes panel out of the dock into a window of its own, at position on the screen, next to the window when null

Link copied to clipboard
fun Element.gradientEditor(vararg classes: String, init: GradientEditor.() -> Unit): GradientEditor
Link copied to clipboard

the group that panel is docked in, null when it is not docked

Link copied to clipboard
fun Element.h1(vararg classes: String, init: H1.() -> String): H1
Link copied to clipboard
fun Element.h2(vararg classes: String, init: H2.() -> String): H2
Link copied to clipboard
fun Element.h3(vararg classes: String, init: H3.() -> String): H3
Link copied to clipboard
open fun heightForWidth(width: Double): Double?

the height of the content of the element when it is width wide, for content that wraps; null when it has none

Link copied to clipboard
fun Element.histogram(vararg classes: String, init: Histogram.() -> Unit): Histogram
Link copied to clipboard
fun <T : Element> Element.initElement(classes: Array<out String>, element: T, init: T.() -> Unit): T
Link copied to clipboard

the styles of this element and its descendants are computed again before the next redraw

Link copied to clipboard
Link copied to clipboard

Determines whether the current element, or any of its ancestors, has a display style of Display.NONE.

Link copied to clipboard
fun isOpen(panel: DockPanel): Boolean

true when panel is not closed, see close

Link copied to clipboard
fun Element.knob(vararg classes: String, init: Knob.() -> Unit): Knob
Link copied to clipboard
fun Element.label(vararg classes: String, init: Label.() -> String): Label
Link copied to clipboard

the layout as it is now: the groups and splits, the tabs that show and the windows of panels taken out

Link copied to clipboard
fun Element.layout(init: Element.() -> Unit)
Link copied to clipboard
fun Element.localPosition(position: Vector2): Vector2

position, a point of the window, in the coordinates of the element before its transforms

Link copied to clipboard
fun Element.menuBar(vararg classes: String, init: MenuBar.() -> Unit): MenuBar

a MenuBar that init adds menus to

Link copied to clipboard
fun move(steps: Int)
Link copied to clipboard
fun next(): Element?
Link copied to clipboard
fun Element.nodeEditor(vararg classes: String, init: NodeEditor.() -> Unit): NodeEditor

a NodeEditor, init adds its nodes and wires

Link copied to clipboard
fun Element.numberField(vararg classes: String, init: NumberField.() -> Unit): NumberField
Link copied to clipboard
fun open(panel: DockPanel)

Opens panel where it was when it was closed: in its group, next to the panels it was next to, or in its window; where it was added when that is gone. It shows, as by select. A panel that is open is only selected.

Link copied to clipboard
fun Element.p(vararg classes: String, init: P.() -> String): P
Link copied to clipboard
fun panel(title: String, zone: DockZone = DockZone.CENTER, next: DockPanel? = null, closable: Boolean = false, init: Div.() -> Unit): DockPanel

adds a panel with title, built by init, in zone of the group next to, the last group when null; a closable panel can be closed, see close

Link copied to clipboard
fun persist(file: File)

Restores the layout from file when it exists, and saves the layout to it whenever it changes, like when a panel is docked elsewhere, a splitter is dragged, or a window of a panel is moved

Link copied to clipboard
fun Element.plot(vararg classes: String, init: Plot.() -> Unit): Plot
Link copied to clipboard
open override fun prepare()

Called in every frame before the styles are computed, by the control manager, so that the element can change its children for what is in view, like a VirtualList

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Element.rangeSlider(vararg classes: String, init: RangeSlider.() -> Unit): RangeSlider
Link copied to clipboard
fun redock(panel: DockPanel)

puts panel back into the dock from its window, which closes

Link copied to clipboard
fun remove(element: Element): Element?
Link copied to clipboard
open fun replace(builder: Element.() -> Unit)
Link copied to clipboard
fun replaceText(text: String)
Link copied to clipboard

The layout is computed again before the next redraw, of the element and its descendants, and of the elements around it as far as its size can change theirs, see org.openrndr.panel.document.Document.layoutRequests

Link copied to clipboard

Draws the element again, what it shows changed. The layout is computed again when the size hints of the element changed; changes to the children, the classes, states and styles of elements and to scrolling lay out again by themselves, other changes that move or size elements call Element.requestLayout.

Link copied to clipboard
fun restore(layout: DockLayout)

Arranges the panels as layout has them, found by their titles; panels that it does not have are added to the last group, and the panels that it has in windows of their own go there once the dock is in a control manager. The closable panels that it has closed are closed, and open again where they were added.

Link copied to clipboard
fun Element.richText(vararg classes: String, init: RichText.() -> Unit): RichText

a RichText that init adds spans to

Link copied to clipboard
fun root(): Element
Link copied to clipboard
fun Element.scope(vararg classes: String, init: Scope.() -> Unit): Scope
Link copied to clipboard
fun scrollIntoView(margin: Double = 0.0)

Scrolls the elements that scroll this element so that it is in view, with margin pixels around it, each by its StyleSheet.scrollBehavior

Link copied to clipboard
fun scrollTo(left: Double = scrollTarget.x, top: Double = scrollTarget.y, smooth: Boolean? = null)

Scrolls the content to left and top, within the content: smoothly when the StyleSheet.scrollBehavior of the element is smooth and smooth is not false, and the element is in a control manager

Link copied to clipboard
fun select(panel: DockPanel)

shows panel, selecting its tab

Link copied to clipboard
fun Element.sequenceEditor(vararg classes: String, init: SequenceEditor.() -> Unit): SequenceEditor
Link copied to clipboard
fun setAttribute(name: String, value: String?)

sets the attribute name to value, or removes it when value is null; the styles are computed again

Link copied to clipboard
fun Element.slideOut(x: Double, y: Double, width: Double, height: Double, vararg classes: String, aboveY: Double? = null, closeDelayMillis: Long = 0, init: SlideOut.() -> Unit): SlideOut
Link copied to clipboard
fun Element.slider(vararg classes: String, init: Slider.() -> Unit): Slider
Link copied to clipboard
fun Element.slidersVector2(vararg classes: String, init: SlidersVector2.() -> Unit): SlidersVector2
Link copied to clipboard
fun Element.slidersVector3(vararg classes: String, init: SlidersVector3.() -> Unit): SlidersVector3
Link copied to clipboard
fun Element.slidersVector4(vararg classes: String, init: SlidersVector4.() -> Unit): SlidersVector4
Link copied to clipboard
fun Element.splitPane(vararg classes: String, vertical: Boolean = false, init: SplitPane.() -> Unit): SplitPane

a SplitPane, see there

Link copied to clipboard
fun Element.style(function: StyleSheet.() -> Unit): StyleSheet

Applies the provided styling function to the element's stylesheet. If the element does not already have a stylesheet, a new one is created and the function is applied to it.

Link copied to clipboard
fun Element.tabs(vararg classes: String, init: Tabs.() -> Unit): Tabs

adds Tabs, init adds their pages with Tabs.tab

Link copied to clipboard
fun text(text: String)
Link copied to clipboard
fun Element.textArea(vararg classes: String, init: TextArea.() -> Unit): TextArea
Link copied to clipboard
inline fun <reified T : TextElement> Element.textElement(classes: Array<out String>, init: T.() -> String): T
Link copied to clipboard
fun Element.textfield(vararg classes: String, init: Textfield.() -> Unit): Textfield
Link copied to clipboard
fun Element.textInput(vararg classes: String, init: TextInput.() -> Unit): TextInput
Link copied to clipboard
fun Element.timeline(vararg classes: String, init: Timeline.() -> Unit): Timeline
Link copied to clipboard
fun Element.toggle(vararg classes: String, init: Toggle.() -> Unit): Toggle
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun <T> Element.treeView(roots: List<T>, childrenOf: (T) -> List<T>, label: (T) -> String = { it.toString() }, vararg classes: String, rowHeight: Double = 24.0, init: TreeView<T>.() -> Unit = {}): TreeView<T>

a TreeView of roots, whose children childrenOf gives, labeled by label

Link copied to clipboard
fun Element.viewBox(viewBox: ViewBox)
fun Element.viewBox(program: Program, f: ViewBox.() -> Unit): ViewBoxElement
Link copied to clipboard
fun <T> Element.virtualList(items: List<T>, rowHeight: Double, vararg classes: String, row: Div.(item: T, index: Int) -> Unit): VirtualList<T>

a VirtualList of items with rows of rowHeight pixels that row builds

Link copied to clipboard
fun Element.visit(function: Element.() -> Unit)
Link copied to clipboard
fun Element.visitVisible(function: Element.() -> Unit)
Link copied to clipboard
fun <T : Any> Element.watchListDiv(vararg classes: String, watchList: List<T>, builder: WatchListDiv<T>.(T) -> Unit)
Link copied to clipboard
fun <T : Any> Element.watchObjectDiv(vararg classes: String, watchObject: T, builder: WatchObjectDiv<T>.(T) -> Unit): WatchObjectDiv<T>

Creates a Div element with the provided classes, and runs builder to populate the Div any time watchObject changes.

Link copied to clipboard
fun <T : Any> Element.watchPropertyDiv(vararg classes: String, watchProperty: KMutableProperty0<T>, builder: WatchPropertyDiv<T>.(T) -> Unit)
Link copied to clipboard
fun Element.xyPad(vararg classes: String, init: XYPad.() -> Unit): XYPad