FontLightBox
classin packageklyn.gui.windows.dialogs
public class FontLightBox extends LightBox:
└ FontLightBox

Modal lightbox that selects a font installed on the operating system.

Add the lightbox to an overlay-capable root container once, subscribe to its events, then call open() whenever a selection is required. Modality is an intrinsic LightBox behavior and is intentionally not configurable.

chooser = FontLightBox(Font("DejaVu Sans", 16))
chooser.accepted += lambda(event: ActionEvent): label.font = chooser.selectedFont
window.centralWidget.add(chooser)
chooser.open()
Properties
Modifier and Type Member Description
public property previewText
previewText as String:
Text rendered in the preview area.
public readonly property selectedFont
selectedFont as Font:
Font selected by the last accepted interaction.
public property title
title as String
Heading displayed inside the lightbox.
Inherited Properties
propertyInherited Properties from LightBox: content, minPanelHeight, minPanelWidth, paddingX, paddingY, panelHeight, panelWidth
propertyInherited Properties from Container: autoRelayout, childCount, layout, padding
propertyInherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, 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 accepted
accepted as ActionEvent
Emitted after the user accepts the selected font.
public event cancelled
cancelled as ActionEvent
Emitted when the user cancels with the button, Escape key, or close icon.
Inherited Events
eventInherited Events from Widget: focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public FontLightBox
FontLightBox( selectedFont as Font = null, title as String = "Select font" ):
Creates an inactive font-selection lightbox.
Methods
Modifier and Type Member Description
public override close
close() as Void:
Cancels and closes the active font chooser.
public open
open() as Void:
Opens the lightbox over its containing window.
Inherited Methods
methodInherited Methods from LightBox: close, paint, setActive, setBounds
methodInherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Inherited Operators
operatorInherited Operators from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: