Class: Zgomot::UI::TableCellWindow
- 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.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #display(value, value_color) ⇒ Object
-
#initialize(value, color, width, top, left, value_color) ⇒ TableCellWindow
constructor
A new instance of TableCellWindow.
Methods included from Utils
Constructor Details
#initialize(value, color, width, top, left, value_color) ⇒ TableCellWindow
Returns a new instance of TableCellWindow.
391 392 393 394 |
# File 'lib/zgomot/ui/windows.rb', line 391 def initialize(value, color, width, top, left, value_color) @color, @value, @left, @top, @width = color, value, left, top, width display(value, value_color) end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
390 391 392 |
# File 'lib/zgomot/ui/windows.rb', line 390 def color @color end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
390 391 392 |
# File 'lib/zgomot/ui/windows.rb', line 390 def left @left end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
390 391 392 |
# File 'lib/zgomot/ui/windows.rb', line 390 def top @top end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
390 391 392 |
# File 'lib/zgomot/ui/windows.rb', line 390 def value @value end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
390 391 392 |
# File 'lib/zgomot/ui/windows.rb', line 390 def width @width end |
Instance Method Details
#display(value, value_color) ⇒ Object
395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/zgomot/ui/windows.rb', line 395 def display(value, value_color) offset = 0 set_color(color) { if left == 0 write(top, left, '|') offset = 1 end write(top, left+width-1-offset, '|') } set_color(value_color) { write(top, left+offset, "%-#{width-offset-2}s" % value) } end |