class Tessell::Kit::Input

Defined in:

tessell/kit/input.cr

Constructors

Instance Method Summary

Instance methods inherited from class Tessell::Kit::Component

a11y_active_cell : Bool | Nil a11y_active_cell, a11y_children_count : Int32 | Nil a11y_children_count, a11y_col : Int32 | Nil a11y_col, a11y_col_count : Int32 | Nil a11y_col_count, a11y_col_index_text : String | Nil a11y_col_index_text, a11y_enabled : Bool a11y_enabled, a11y_first_visible_index : Int32 | Nil a11y_first_visible_index, a11y_name : String a11y_name, a11y_role : A11y::Role a11y_role, a11y_row : Int32 | Nil a11y_row, a11y_row_count : Int32 | Nil a11y_row_count, a11y_row_index_text : String | Nil a11y_row_index_text, a11y_scroll_offset : Int32 a11y_scroll_offset, a11y_selected : Bool | Nil a11y_selected, a11y_value : String a11y_value, arrange(ctx : Context, bounds : Rect) : Nil arrange, attach(child : Component) : Component attach, bounds : Rect bounds, bounds=(bounds : Rect) bounds=, clip_bounds : Rect | Nil clip_bounds, collect_components(sink : Array(Component)) : Nil collect_components, dispose : Nil dispose, emit(b : UI::Builder, ctx : Context) : Nil emit, enabled : Bool enabled, enabled=(enabled : Bool) enabled=, focusable? : Bool focusable?, focused : Bool focused, focused=(focused : Bool) focused=, handle(event : Event, ctx : Context) : Bool handle, hit?(point : Point) : Bool hit?, key : UI::UiKey key, mark_structure_dirty : Nil mark_structure_dirty, measure(ctx : Context, constraints : Constraints) : Size measure, on_focus_changed(focused : Bool) : Nil on_focus_changed, paint(p : Painter, ctx : Context) : Nil paint, paint_token : UInt32 paint_token, parent : Component | Nil parent, parent=(value : Component | Nil) : Nil parent=, signal_owner : Tessell::Signal::Owner signal_owner, signal_owner? : Tessell::Signal::Owner | Nil signal_owner?, structure_dirty : Bool structure_dirty, structure_dirty=(structure_dirty : Bool) structure_dirty=, take_structure_dirty : Bool take_structure_dirty, tick(now_ms : Int64, ctx : Context) : Nil tick, tooltip_delay_ms : Int32 tooltip_delay_ms, tooltip_delay_ms=(tooltip_delay_ms : Int32) tooltip_delay_ms=, tooltip_text : String | Nil tooltip_text, tooltip_text=(tooltip_text : String | Nil) tooltip_text=, visible : Bool visible, visible=(visible : Bool) visible=, wants_tab? : Bool wants_tab?, watch(&handler : -> Nil) : Tessell::Signal::Effect watch

Constructor methods inherited from class Tessell::Kit::Component

new(key : UI::UiKey, enabled : Bool = true, visible : Bool = true) new

Constructor Detail

def self.new(key : UI::UiKey, text : String = "", placeholder : String = "", label : String = "", size : ControlSize = ControlSize::Medium, read_only : Bool = false, invalid : Bool = false, enabled : Bool = true, submit_on_tab : Bool = false) #

[View source]

Instance Method Detail

def a11y_name : String #

[View source]
def a11y_role : A11y::Role #

[View source]
def a11y_value : String #

[View source]
def arrange(ctx : Context, bounds : Rect) : Nil #

[View source]
def caret_index_at(ctx : Context, x : Float32) : Int32 #

[View source]
def clipboard : Clipboard #

[View source]
def clipboard=(clipboard : Clipboard) #

[View source]
def commit_preedit : Bool #

[View source]
def editing : TextEditing #

[View source]
def emit(b : UI::Builder, ctx : Context) : Nil #

[View source]
def ensure_caret_visible(ctx : Context) : Nil #

[View source]
def error_text : String #

[View source]
def error_text=(error_text : String) #

[View source]
def field_rect(ctx : Context) : Rect #

[View source]
def focusable? : Bool #

[View source]
def handle(event : Event, ctx : Context) : Bool #

[View source]
def hovered : Bool #

[View source]
def invalid : Bool #

[View source]
def invalid=(invalid : Bool) #

[View source]
def label : String #

[View source]
def label=(label : String) #

[View source]
def measure(ctx : Context, constraints : Constraints) : Size #

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

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

[View source]
def on_focus_changed(focused : Bool) : Nil #

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

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

[View source]
def paint(p : Painter, ctx : Context) : Nil #

[View source]
def paint_token : UInt32 #
Description copied from class Tessell::Kit::Component

声明里的 paint token:状态变化时改变,UI.apply 只把该节点标 Paint。


[View source]
def placeholder : String #

[View source]
def placeholder=(placeholder : String) #

[View source]
def pressed : Bool #

[View source]
def read_only : Bool #

[View source]
def read_only=(read_only : Bool) #

[View source]
def scroll_x : Float32 #

[View source]
def set_preedit(value : String) : Nil #

[View source]
def set_text(value : String) : Nil #

[View source]
def size : ControlSize #

[View source]
def size=(size : ControlSize) #

[View source]
def submit_on_tab : Bool #

Tab 提交语义(issue #32):true 时 KeyDown Tab 触发 on_submit 并消费 事件;wants_tab? 随之变 true,Root 会先把 Tab 投递给聚焦的 Input (否则走焦点环)。「提交并前进到下一字段」需应用在 on_submit 里 自行推进焦点(root.focus(next))。


[View source]
def submit_on_tab=(submit_on_tab : Bool) #

Tab 提交语义(issue #32):true 时 KeyDown Tab 触发 on_submit 并消费 事件;wants_tab? 随之变 true,Root 会先把 Tab 投递给聚焦的 Input (否则走焦点环)。「提交并前进到下一字段」需应用在 on_submit 里 自行推进焦点(root.focus(next))。


[View source]
def text : String #

[View source]
def text_area(ctx : Context) : Rect #

[View source]
def wants_tab? : Bool #

issue #32:submit_on_tab 时声明 wants_tab?,Root 才会把 Tab 先投递 给本组件(普通 Tab 进入焦点环前先问焦点组件)。


[View source]