Class: RETerm::Components::ScrollingArea
- Inherits:
-
RETerm::Component
- Object
- RETerm::Component
- RETerm::Components::ScrollingArea
- Includes:
- RETerm::CDKComponent
- Defined in:
- lib/reterm/components/scrolling_area.rb
Overview
Scrolling Area CDK Component
Direct Known Subclasses
Constant Summary
Constants included from LogHelpers
Instance Attribute Summary collapse
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from RETerm::Component
#activatable, #activate_focus, #highlight_focus, #window
Instance Method Summary collapse
- #<<(item) ⇒ Object
-
#activatable? ⇒ Boolean
XXX swindow results in weird keyboard interactions, disable for now.
-
#initialize(args = {}) ⇒ ScrollingArea
constructor
Initialize the ScrollingArea component.
- #requested_cols ⇒ Object
- #requested_rows ⇒ Object
Methods included from RETerm::CDKComponent
#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
#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 = {}) ⇒ ScrollingArea
Initialize the ScrollingArea component
15 16 17 18 19 |
# File 'lib/reterm/components/scrolling_area.rb', line 15 def initialize(args={}) super @title = args[:title] || "" @lines = args[:lines] || 10 end |
Instance Attribute Details
#lines ⇒ Object
Returns the value of attribute lines.
7 8 9 |
# File 'lib/reterm/components/scrolling_area.rb', line 7 def lines @lines end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/reterm/components/scrolling_area.rb', line 7 def title @title end |
Instance Method Details
#<<(item) ⇒ Object
34 35 36 |
# File 'lib/reterm/components/scrolling_area.rb', line 34 def <<(item) component.add item, CDK::BOTTOM end |
#activatable? ⇒ Boolean
XXX swindow results in weird keyboard interactions, disable for now
22 23 24 |
# File 'lib/reterm/components/scrolling_area.rb', line 22 def activatable? false end |
#requested_cols ⇒ Object
30 31 32 |
# File 'lib/reterm/components/scrolling_area.rb', line 30 def requested_cols [@title.size, 10].min end |
#requested_rows ⇒ Object
26 27 28 |
# File 'lib/reterm/components/scrolling_area.rb', line 26 def requested_rows 10 end |