Module: reefvision.widgets.checkbox
Source: ./reefvision/widgets/checkbox.reef
Overview
reefvision.widgets.checkbox — toggle with "[X] label" / "[ ] label"
object Checkbox extends view.View. Space / Enter / left-click toggles. wants_focus true. Insertion is Group.add.
Usage: let box = new checkbox.Checkbox(cell.rect(1, 2, 38, 1), "Enable", false) win.add(box) if box.checked() ...
Objects
Checkbox
Extends: view.View
Fields:
| Name | Type |
|---|---|
label |
string |
checked |
bool |
proc init(bounds: cell.Rect, label: string, checked: bool)
Methods:
override shared fn wants_focus(): bool
shared fn label(): string
shared fn checked(): bool
exclusive proc set_checked(checked: bool)
exclusive proc set_label(label: string)
exclusive proc toggle()
override exclusive proc draw(buf: cell.CellBuffer, abs: cell.Rect, clip: cell.Rect, focused: bool, th: theme.Theme)
override exclusive fn handle_event(e: event.Event): view.EventResult
Functions
fn is_activate_key(e: event.Event): bool
fn is_left_click(e: event.Event): bool
Generated by reefc doc