public class FontLightBox extends LightBox
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 as ActionEvent): label.font = chooser.selectedFont
window.centralWidget.add(chooser)
chooser.open()| Modifier and Type | Member | Description |
|---|---|---|
| public property | previewTextpreviewText as String |
Text rendered in the preview area. |
| public readonly property | selectedFontselectedFont as Font |
Font selected by the last accepted interaction. |
| public property | titletitle as String |
Heading displayed inside the lightbox. |
| Modifier and Type | Member | Description |
|---|---|---|
| public event | acceptedaccepted as ActionEvent |
Emitted after the user accepts the selected font. |
| public event | cancelledcancelled as ActionEvent |
Emitted when the user cancels with the button, Escape key, or close icon. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | FontLightBoxFontLightBox(
selectedFont as Font = Font(),
title as String = "Select font"
) |
Creates an inactive font-selection lightbox. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | closeclose() as Void |
Cancels and closes the active font chooser. |
| public | openopen() as Void |
Opens the lightbox over its containing window. |