public class Button extends Widget:
Clickable terminal button with the standard Klyn terminal style.
The default background matches the terminal menu bar. Screens that need a semantic variant, such as destructive Delete buttons, should override the color properties on the instance instead of redefining the generic default.
saveButton = Button("Save", null)
saveButton.centered = true
saveButton.size = (20u, UInt(Button.DEFAULT_HEIGHT))| Modifier and Type | Member | Description |
|---|---|---|
| public static const | DEFAULT_BG_FOCUSDEFAULT_BG_FOCUS as String = "\u001b[48;2;0;200;255m" |
No summary. |
| public static const | DEFAULT_BG_NORMALDEFAULT_BG_NORMAL as String = "\u001b[48;2;0;120;160m" |
No summary. |
| public static const | DEFAULT_FG_FOCUSDEFAULT_FG_FOCUS as String = "\u001b[38;2;255;255;255m" |
No summary. |
| public static const | DEFAULT_FG_NORMALDEFAULT_FG_NORMAL as String = "\u001b[38;2;255;255;255m" |
No summary. |
| public static const | DEFAULT_HEIGHTDEFAULT_HEIGHT as Int = 3 |
No summary. |
| public static const | DEFAULT_HORIZONTAL_PADDINGDEFAULT_HORIZONTAL_PADDING as Int = 3 |
No summary. |
| public static const | DEFAULT_VERTICAL_PADDINGDEFAULT_VERTICAL_PADDING as Int = 1 |
No summary. |
| Modifier and Type | Member | Description |
|---|---|---|
| public property | bgFocusbgFocus as String = Button.DEFAULT_BG_FOCUS |
No summary. |
| public property | bgNormalbgNormal as String = Button.DEFAULT_BG_NORMAL |
No summary. |
| public property | centeredcentered as Boolean = false |
No summary. |
| public property | fgFocusfgFocus as String = Button.DEFAULT_FG_FOCUS |
No summary. |
| public property | fgNormalfgNormal as String = Button.DEFAULT_FG_NORMAL |
No summary. |
| public override readonly property | focusablefocusable as Boolean = true |
No summary. |
| public override property | focusedfocused as Boolean: |
No summary. |
| public property | horizontalPaddinghorizontalPadding as Int = Button.DEFAULT_HORIZONTAL_PADDING |
No summary. |
| public property | hoveredhovered as Boolean = false |
No summary. |
| public property | idid as String = "" |
No summary. |
| public property | labellabel as String = "" |
No summary. |
| public property | onClickonClick as Object = null |
No summary. |
| public property | verticalPaddingverticalPadding as Int = Button.DEFAULT_VERTICAL_PADDING |
No summary. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Button | No summary. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static | focusRenderStylefocusRenderStyle() as RenderStyle: |
Returns the standard visual style for a focused or hovered button. |
| public override | handleEvent | No summary. |
| public override | handleMouseEvent | No summary. |
| public static | normalRenderStylenormalRenderStyle() as RenderStyle: |
Returns the standard visual style for an idle button. |
| public override | paintToFrame | No summary. |