TabWidget
class in package klyn.gui.windows

    public class TabWidget extends Container:

Widget
└ Container
└ TabWidget

Closable tab container.

    tabs = TabWidget()
    tabs.addTab("Welcome", Label("Ready"), false)
    tabs.addTab("Query.sql", editor, true)

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | activeIndex `activeIndex as Int:` | Index of the currently visible tab.
public readonly property | activeTitle `activeTitle as String:` | Title of the selected tab.
public readonly property | activeWidget `activeWidget as Widget:` | Widget currently hosted by the selected tab, or `null` when empty.
public property | addButtonWidth `addButtonWidth as Int = 34` | Width of the optional leading add-tab button.
public override readonly property | childCount `childCount as ULong:` | Number of hosted tab widgets.
public property | closeAreaWidth `closeAreaWidth as Int = 30` | Area reserved at the right of a closeable tab for its close button.
public property | showAddButton `showAddButton as Boolean = false` | Whether a leading `+` button is displayed before the tab list.
public property | showTabBar `showTabBar as Boolean = true` | Whether the tab strip is visible at the configured tab position.
public property | tabHeight `tabHeight as Int = 34` | Tab header height in pixels.
public property | tabPosition `tabPosition as TabPosition = TabPosition.TOP` | Edge used to display the tab strip.

Inherited Properties
property Inherited Properties from Container: autoRelayout, childCount, layout, padding
property Inherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Events

Modifier and Type | Member | Description
--- | --- | ---
public event | addTabRequested `addTabRequested as ActionEvent` | Emitted when the optional leading add-tab button is clicked.
public event | tabClosed `tabClosed as TabEvent` | Emitted after a closeable tab has been removed.

Inherited Events
event Inherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | TabWidget `TabWidget():` | Creates an empty tab widget.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | addTab `addTab(title as String, widget as Widget, closeable as Boolean = true) as Void:` | Adds a tab.
public override | applyLayout `applyLayout(recursive as Boolean = true) as Void:` | No summary.
public | closeTab `closeTab(index as Int) as Boolean:` | Closes a closeable tab by index.
public | findTab `findTab(title as String) as Int:` | Returns the index of a tab by title, or `-1` when absent.
public | isModifiedAt `isModifiedAt(index as Int) as Boolean:` | Reports whether the tab displays its modified-document badge.
public | onTabClosed `onTabClosed(widget as Widget) as Void:` | Hook called after a closeable tab has been removed.
public | onTabSelected `onTabSelected(widget as Widget) as Void:` | Hook called after a tab becomes active.
public override | paint `paint(painter as Painter) as Void:` | No summary.
public | select `select(index as Int) as Boolean:` | Selects a tab by index.
public override | setBounds `setBounds(x as Int, y as Int, width as Int, height as Int) as Void:` | No summary.
public | setModifiedAt `setModifiedAt(index as Int, modified as Boolean) as Boolean:` | Shows or hides the modified-document badge for a tab.
public | setTitleAt `setTitleAt(index as Int, title as String) as Boolean:` | Updates a tab title without replacing its widget.
public | titleAt `titleAt(index as Int) as String:` | Returns the tab title at `index`.
public | widgetAt `widgetAt(index as Int) as Widget:` | Returns the hosted widget at `index`, or `null` when out of range.

Inherited Methods
method Inherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
method Inherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Inherited Operators
operator Inherited Operators from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: