Class: Zgomot::UI::TextWithValueWindow
- Includes:
- Utils
- Defined in:
- lib/zgomot/ui/windows.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#value_color ⇒ Object
readonly
Returns the value of attribute value_color.
Instance Method Summary collapse
- #display(new_value = nil) ⇒ Object
-
#initialize(text, value, color, top, left, value_color = nil) ⇒ TextWithValueWindow
constructor
A new instance of TextWithValueWindow.
Methods included from Utils
Constructor Details
#initialize(text, value, color, top, left, value_color = nil) ⇒ TextWithValueWindow
Returns a new instance of TextWithValueWindow.
351 352 353 354 355 |
# File 'lib/zgomot/ui/windows.rb', line 351 def initialize(text, value, color, top, left, value_color=nil) @color, @text, @top, @left, @value = color, text, top, left, value @value_color = value_color || color display(value) end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
350 351 352 |
# File 'lib/zgomot/ui/windows.rb', line 350 def color @color end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
350 351 352 |
# File 'lib/zgomot/ui/windows.rb', line 350 def left @left end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
350 351 352 |
# File 'lib/zgomot/ui/windows.rb', line 350 def text @text end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
350 351 352 |
# File 'lib/zgomot/ui/windows.rb', line 350 def top @top end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
350 351 352 |
# File 'lib/zgomot/ui/windows.rb', line 350 def value @value end |
#value_color ⇒ Object (readonly)
Returns the value of attribute value_color.
350 351 352 |
# File 'lib/zgomot/ui/windows.rb', line 350 def value_color @value_color end |
Instance Method Details
#display(new_value = nil) ⇒ Object
356 357 358 359 360 361 362 363 364 365 |
# File 'lib/zgomot/ui/windows.rb', line 356 def display(new_value=nil) @value = new_value || value text_len = text.length + 2 set_color(color) { write(top, left, "#{text}: ") } set_color(value_color) { write(top, left+text_len, value) } end |