Module: reefvision.widgets.radio
Source: ./reefvision/widgets/radio.reef
Overview
reefvision.widgets.radio — exclusive radio group "(*) label" / "( ) label"
object RadioGroup extends view.View. One view, options inside (not N Radio siblings). Keyboard: Up/Down/Home/End. Mouse: click a row. wants_focus true. Insertion is Group.add.
Usage: let rg = new radio.RadioGroup(cell.rect(1, 6, 38, 4), 8) let _ = rg.add_option("WaveOS (amd64)") win.add(rg)
Objects
RadioGroup
Extends: view.View
Fields:
| Name | Type |
|---|---|
labels |
[string] |
capacity |
int |
count |
int |
selected |
int |
proc init(bounds: cell.Rect, capacity: int)
Methods:
override shared fn wants_focus(): bool
shared fn count(): int
shared fn selected(): int
shared fn label(idx: int): string
exclusive fn add_option(text: string): bool
exclusive proc set_selected(idx: int)
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
exclusive fn click_at(abs_bounds: cell.Rect, x: int, y: int): bool
Click row relative to abs_bounds.y. Group/Window deliver mouse in the same space as self.bounds (parent-relative / client-relative).
Functions
fn max_opts(): int
fn is_left_click(e: event.Event): bool
Generated by reefc doc