Class: RETerm::Components::MultiLineEntry
- Inherits:
-
RETerm::Component
- Object
- RETerm::Component
- RETerm::Components::MultiLineEntry
- Includes:
- RETerm::CDKComponent
- Defined in:
- lib/reterm/components/multi_line_entry.rb
Overview
CDK MultiLineEntry Component
Constant Summary
Constants included from LogHelpers
Instance Attribute Summary
Attributes inherited from RETerm::Component
#activatable, #activate_focus, #highlight_focus, #window
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ MultiLineEntry
constructor
Initialize the MultiLineEntry component.
- #requested_cols ⇒ Object
- #requested_rows ⇒ 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=, #value
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
#initialize(args = {}) ⇒ MultiLineEntry
Initialize the MultiLineEntry component
17 18 19 20 21 22 23 |
# File 'lib/reterm/components/multi_line_entry.rb', line 17 def initialize(args={}) super @title = args[:title] || "" @label = args[:label] || "" @min_len = args[:min] || 0 @rows = args[:rows] || nil end |
Instance Method Details
#requested_cols ⇒ Object
29 30 31 |
# File 'lib/reterm/components/multi_line_entry.rb', line 29 def requested_cols [@title.size, @label.size + 5].min end |
#requested_rows ⇒ Object
25 26 27 |
# File 'lib/reterm/components/multi_line_entry.rb', line 25 def requested_rows 3 + @rows end |