Class: RETerm::Components::Entry
- Inherits:
-
RETerm::Component
- Object
- RETerm::Component
- RETerm::Components::Entry
- Includes:
- RETerm::CDKComponent
- Defined in:
- lib/reterm/components/entry.rb
Overview
CDK Entry Component
Direct Known Subclasses
Constant Summary
Constants included from LogHelpers
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from RETerm::Component
#activatable, #activate_focus, #highlight_focus, #window
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Entry
constructor
Initialize the Entry component.
- #requested_cols ⇒ Object
- #requested_rows ⇒ Object
- #value ⇒ Object
- #value=(v) ⇒ Object
Methods included from RETerm::CDKComponent
#activatable?, #activate!, #bind_key, #cdk?, #colors=, #component, #deactivate!, #draw!, #early_exit?, #erase, #escape_hit?, #init?, #init_cdk, #normal_exit?, #strip_formatting, #title_attrib=
Methods inherited from RETerm::Component
#activatable?, #activate!, #activate_focus?, #cdk?, #colored?, #colors=, #deactivate!, #deactivate?, #distance_from, #extra_padding, #finalize!, #highlight_focus?, #reactivate!, #resize, #sync!, #sync_getch
Methods included from KeyBindings
#bind_key, #invoke_key_bindings, #key_bindings, #key_bound?
Methods included from LogHelpers
Methods included from EventDispatcher
Constructor Details
permalink #initialize(args = {}) ⇒ Entry
Initialize the Entry component
18 19 20 21 22 23 24 25 |
# File 'lib/reterm/components/entry.rb', line 18 def initialize(args={}) super @title = args[:title] || "" @label = args[:label] || "" @min_len = args[:min] || 0 @max_len = args[:max] || 100 @min_size = args[:size] || 0 end |
Instance Attribute Details
permalink #title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/reterm/components/entry.rb', line 7 def title @title end |
Instance Method Details
permalink #requested_cols ⇒ Object
[View source]
31 32 33 |
# File 'lib/reterm/components/entry.rb', line 31 def requested_cols [@title.size, @label.size, @min_size].max + 3 end |
permalink #requested_rows ⇒ Object
[View source]
27 28 29 |
# File 'lib/reterm/components/entry.rb', line 27 def requested_rows 5 end |
permalink #value ⇒ Object
[View source]
35 36 37 |
# File 'lib/reterm/components/entry.rb', line 35 def value component.getValue end |
permalink #value=(v) ⇒ Object
[View source]
39 40 41 |
# File 'lib/reterm/components/entry.rb', line 39 def value=(v) component.setValue(v) end |