kvision / pl.treksoft.kvision.window / Window

Window

open class Window : SimplePanel

Floating window container.

Constructors

<init>

Window(caption: String? = null, contentWidth: CssSize? = CssSize(0, UNIT.auto), contentHeight: CssSize? = CssSize(0, UNIT.auto), isResizable: Boolean = true, isDraggable: Boolean = true, closeButton: Boolean = false, maximizeButton: Boolean = false, minimizeButton: Boolean = false, icon: String? = null, classes: Set<String> = setOf(), init: (Window.() -> Unit)? = null)

Properties

caption

var caption: String?

Window caption text.

closeButton

var closeButton: Boolean

Determines if Close button is visible.

contentHeight

var contentHeight: CssSize?

Window content height.

contentOverflow

var contentOverflow: Overflow?

Window content height.

contentWidth

var contentWidth: CssSize?

Window content width.

icon

var icon: String?

Window icon.

isDraggable

var isDraggable: Boolean

Determines if the window is draggable.

isResizable

var isResizable: Boolean

Determines if the window is resizable.

maximizeButton

var maximizeButton: Boolean

Determines if Maximize button is visible.

minimizeButton

var minimizeButton: Boolean

Determines if Maximize button is visible.

Functions

add

open fun add(child: Component): SimplePanel

Adds given component to the current container.

addAll

open fun addAll(children: List<Component>): SimplePanel

Adds a list of components to the current container.

afterCreate

open fun afterCreate(node: VNode): Unit

Method called after creating Snabbdom vnode.

afterDestroy

open fun afterDestroy(): Unit

Method called after destroying Snabbdom vnode.

close

open fun close(): Unit

Close the window.

focus

open fun focus(): Unit

Makes the current window focused.

getChildren

open fun getChildren(): List<Component>

Returns a list of children of the current container.

remove

open fun remove(child: Component): SimplePanel

Removes given component from the current container.

removeAll

open fun removeAll(): SimplePanel

Removes all children from the current container.

toFront

open fun toFront(): Unit

Moves the current window to the front.

toggleMaximize

open fun toggleMaximize(): Unit

Maximize or restore the window size.

toggleMinimize

open fun toggleMinimize(): Unit

Minimize or restore the window size.

Inherited Functions

addInternal

fun addInternal(child: Component): SimplePanel

Protected and final method to add given component to the current container.

childrenVNodes

open fun childrenVNodes(): Array<VNode>

Returns the array of the children Snabbdom vnodes.

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

Companion Object Functions

window

fun Container.window(caption: String? = null, contentWidth: CssSize? = CssSize(0, UNIT.auto), contentHeight: CssSize? = CssSize(0, UNIT.auto), isResizable: Boolean = true, isDraggable: Boolean = true, closeButton: Boolean = false, maximizeButton: Boolean = false, minimizeButton: Boolean = false, icon: String? = null, classes: Set<String> = setOf(), init: (Window.() -> Unit)? = null): Window

DSL builder extension function.

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.