class Prostore::TUI::RecordDetail

Defined in:

prostore/tui/widgets/record_detail.cr

Constant Summary

TEXT_EDIT_MAX_ROWS = 8

Ceiling on how many display rows an open text editor may claim — ScrollableField owns its own internal Scroller/scrollbar, so a value longer than this just scrolls inside a fixed-height window instead of growing the field indefinitely (unlike the old bespoke editor, which sized itself to the full wrapped line count).

Constructors

Instance Method Summary

Constructor Detail

def self.for_new_record(x : Int32, y : Int32, width : Int32, height : Int32, browser : Browser, table : String) : RecordDetail #

[View source]
def self.new(x : Int32, y : Int32, width : Int32, height : Int32, browser : Browser, table : String, pk_col : String | Nil, pk_val : String) #

[View source]

Instance Method Detail

def dirty : Set(String) #

Column names mutated since the last load/reload — also useful to an embedding app deciding whether to prompt before discarding an in-progress edit, not just for spec assertions.


[View source]
def field_errors : Hash(String, String) #

Per-column inline validation error messages, keyed by column name.


[View source]
def handle_key(ev : ::TUI::KeyEvent) : Bool #
Description copied from class TUI::Widget

Returns true if the key was consumed.


[View source]
def on_close : Proc(Nil) | Nil #

[View source]
def on_close=(on_close : Proc(Nil) | Nil) #

[View source]
def on_follow_fk : Proc(String, String, Nil) | Nil #

[View source]
def on_follow_fk=(on_follow_fk : Proc(String, String, Nil) | Nil) #

[View source]
def on_pick_fk : Proc(String, String, Nil) | Nil #

[View source]
def on_pick_fk=(on_pick_fk : Proc(String, String, Nil) | Nil) #

[View source]
def reload : Nil #

[View source]
def render : Nil #
Description copied from class TUI::Widget

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.


[View source]
def row : Hash(String, RowVal) #

The current in-memory row (raw stringified values, pre-save).


[View source]
def set_new_mode : Nil #

[View source]
def set_row_value(col_name : String, value : String) : Nil #

[View source]
def status_hint : String #

Context-aware hint surfaced in the App's global status bar. All key bindings reachable from the current state are listed here so the user doesn't have to look in two places.


[View source]