Class: Zgomot::UI::CCWindow

Inherits:
Object show all
Defined in:
lib/zgomot/ui/windows.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(height, top) ⇒ CCWindow

Returns a new instance of CCWindow.



255
256
257
258
259
260
261
# File 'lib/zgomot/ui/windows.rb', line 255

def initialize(height, top)
  @height, @top = height, top
  @widths = Zgomot::UI::Output::CC_OUTPUT_FORMAT_WIDTHS
  TitleWindow.new('Input CCs', COLOR_BORDER, top, COLOR_BLUE)
  TableRowWindow.new(Zgomot::UI::Output::CC_HEADER, widths, COLOR_BORDER, top + 3, COLOR_BORDER)
  add_ccs(top + 3)
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



254
255
256
# File 'lib/zgomot/ui/windows.rb', line 254

def height
  @height
end

#rowsObject (readonly)

Returns the value of attribute rows.



254
255
256
# File 'lib/zgomot/ui/windows.rb', line 254

def rows
  @rows
end

#topObject (readonly)

Returns the value of attribute top.



254
255
256
# File 'lib/zgomot/ui/windows.rb', line 254

def top
  @top
end

#widthsObject (readonly)

Returns the value of attribute widths.



254
255
256
# File 'lib/zgomot/ui/windows.rb', line 254

def widths
  @widths
end

Instance Method Details

#displayObject



262
263
264
265
266
267
268
269
# File 'lib/zgomot/ui/windows.rb', line 262

def display
  ccs = get_ccs
  if ccs.length == rows.length
    (0..ccs.length-1).each{|i| rows[i].display(ccs[i], cc_color(ccs[i]))}
  else
    add_ccs(top + 3)
  end
end