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.
318 319 320 321 |
# File 'lib/zgomot/ui/windows.rb', line 318 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.
317 318 319 |
# File 'lib/zgomot/ui/windows.rb', line 317 def color @color end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
317 318 319 |
# File 'lib/zgomot/ui/windows.rb', line 317 def left @left end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
317 318 319 |
# File 'lib/zgomot/ui/windows.rb', line 317 def top @top end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
317 318 319 |
# File 'lib/zgomot/ui/windows.rb', line 317 def value @value end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
317 318 319 |
# File 'lib/zgomot/ui/windows.rb', line 317 def width @width end |
Instance Method Details
#display(value, value_color) ⇒ Object
322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/zgomot/ui/windows.rb', line 322 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 |