Class: RETerm::Components::Dial
- Inherits:
-
RETerm::Component
- Object
- RETerm::Component
- RETerm::Components::Dial
- Includes:
- RETerm::ComponentInput
- Defined in:
- lib/reterm/components/dial.rb
Constant Summary
Constants included from RETerm::ComponentInput
RETerm::ComponentInput::DEC_CONTROLS, RETerm::ComponentInput::INC_CONTROLS, RETerm::ComponentInput::QUIT_CONTROLS
Instance Attribute Summary collapse
-
#increment ⇒ Object
Returns the value of attribute increment.
-
#initial_value ⇒ Object
Returns the value of attribute initial_value.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#range ⇒ Object
Returns the value of attribute range.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from RETerm::Component
Instance Method Summary collapse
- #activatable? ⇒ Boolean
- #activate! ⇒ Object
- #draw! ⇒ Object
-
#initialize(args = {}) ⇒ Dial
constructor
Enapsulating window should be at least 4x4 for decent effect, at least 7x7 provides best resolution.
Methods included from RETerm::ComponentInput
Methods inherited from RETerm::Component
#colored?, #colors=, #finalize!
Constructor Details
#initialize(args = {}) ⇒ Dial
Enapsulating window should be at least 4x4 for decent effect, at least 7x7 provides best resolution
22 23 24 25 26 27 28 |
# File 'lib/reterm/components/dial.rb', line 22 def initialize(args={}) @initial_value = 0 @increment = 0.01 @range = [0, 1] @labels = true @value = initial_value end |
Instance Attribute Details
#increment ⇒ Object
Returns the value of attribute increment.
6 7 8 |
# File 'lib/reterm/components/dial.rb', line 6 def increment @increment end |
#initial_value ⇒ Object
Returns the value of attribute initial_value.
6 7 8 |
# File 'lib/reterm/components/dial.rb', line 6 def initial_value @initial_value end |
#labels ⇒ Object
Returns the value of attribute labels.
6 7 8 |
# File 'lib/reterm/components/dial.rb', line 6 def labels @labels end |
#range ⇒ Object
Returns the value of attribute range.
6 7 8 |
# File 'lib/reterm/components/dial.rb', line 6 def range @range end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/reterm/components/dial.rb', line 8 def value @value end |
Instance Method Details
#activatable? ⇒ Boolean
34 35 36 |
# File 'lib/reterm/components/dial.rb', line 34 def activatable? true end |
#activate! ⇒ Object
38 39 40 41 42 |
# File 'lib/reterm/components/dial.rb', line 38 def activate! refresh_win handle_input @value end |
#draw! ⇒ Object
30 31 32 |
# File 'lib/reterm/components/dial.rb', line 30 def draw! refresh_win end |