class

TUI::Form::FormFieldCell(M)

Inherits TUI::Widget < Reference < Object

One form row as its own composited Widget: a label plus whichever FormField edit session field.build constructs (or, for a dropdown_options field, a TUI::DropdownPicker popup pushed through popup instead — see #start_editing). Grid (src/tui/layout/grid.cr) positions and focuses one of these per field; Form::Host builds one FormFieldCell per FieldSpec and attaches them into its internal Grid, rather than looping over @fields and hand-computing row/column coordinates itself the way it used to.

field.get/field.set are the only way this class reads or writes @model — a FieldSpec cannot exist without both, so every cell rendered or committed here is guaranteed to be backed by a real accessor on M, never a value invented independently of the model. This mirrors the invariant Form::Host itself used to state.

Constants

DEFAULT_MAX_ERROR_WIDTH = 40
DEFAULT_MIN_VALUE_WIDTH = 20

Constructors

new(x : Int32, y : Int32, width : Int32, height : Int32, field : FieldSpec(M), model : M, popup : PopupHost, label_width : Int32, min_value_width : Int32 = DEFAULT_MIN_VALUE_WIDTH, max_error_width : Int32 = DEFAULT_MAX_ERROR_WIDTH)
Source

Instance methods

error_style
Source
error_style=(error_style : Style)
Source
handle_key(ev : KeyEvent) : Bool

Returns true if the key was consumed.

Source
label_error_style
Source
label_error_style=(label_error_style : Style)
Source
label_style
Source
label_style=(label_style : Style)
Source
render

Draw into @buffer using LOCAL coordinates (0, 0 = this widget's own top-left). Widgets never need to know their own x/y offset to draw themselves — that arithmetic is handled entirely by composite.

Source
status_hint

Plain text describing the actions available in the widget's current state. Rendered by the App in the global status bar at the bottom of the screen — widgets must NOT draw their own hint lines.

Source