Class: Shoes::InputBox
Constant Summary
Common::State::DISABLED_STATE
Common::Style::DEFAULT_STYLES, Common::Style::STYLE_GROUPS
Instance Attribute Summary
#app, #dimensions, #gui, #parent
Instance Method Summary
collapse
#after_initialize, #enabled?, #state=
#focus, #focused?
#change
#safely_evaluate
#add_to_parent, #after_initialize, #create_backend, #create_dimensions, #initialize, #needs_rotate?, #painted?, #redraw_height, #redraw_left, #redraw_top, #redraw_width, #update_fill, #update_stroke
#applicable_app_styles, #create_style_hash, included, #style, #style_init
#remove
#_position, #displace, #move
#hidden?, #hidden_from_view?, #hide, #outside_parent_view?, #show, #toggle, #visible?
#inspect, #to_s
#attached_to
Instance Method Details
#before_initialize(styles, text) ⇒ Object
9
10
11
|
# File 'shoes-core/lib/shoes/input_box.rb', line 9
def before_initialize(styles, text)
styles[:text] = text.to_s
end
|
#caret_to(index) ⇒ Object
31
32
33
|
# File 'shoes-core/lib/shoes/input_box.rb', line 31
def caret_to(index)
@gui.caret_to(index)
end
|
#handle_block(blk) ⇒ Object
13
14
15
16
|
# File 'shoes-core/lib/shoes/input_box.rb', line 13
def handle_block(blk)
change(&blk) if blk
update_visibility
end
|
#highlight_text(start_index, final_index) ⇒ Object
27
28
29
|
# File 'shoes-core/lib/shoes/input_box.rb', line 27
def highlight_text(start_index, final_index)
@gui.highlight_text(start_index, final_index)
end
|
#readonly? ⇒ Boolean
35
36
37
|
# File 'shoes-core/lib/shoes/input_box.rb', line 35
def readonly?
state.to_s == "readonly"
end
|
#text ⇒ Object
18
19
20
|
# File 'shoes-core/lib/shoes/input_box.rb', line 18
def text
@gui.text
end
|
#text=(value) ⇒ Object
22
23
24
25
|
# File 'shoes-core/lib/shoes/input_box.rb', line 22
def text=(value)
style(text: value.to_s)
@gui.text = value.to_s
end
|
#update_from_state ⇒ Object
39
40
41
42
|
# File 'shoes-core/lib/shoes/input_box.rb', line 39
def update_from_state
super
@gui.readonly = readonly?
end
|