Class: Zgomot::UI::StrWindow
Instance Attribute Summary collapse
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
-
#tog_mode ⇒ Object
readonly
Returns the value of attribute tog_mode.
-
#widths ⇒ Object
readonly
Returns the value of attribute widths.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
- #dec_selected ⇒ Object
- #display ⇒ Object
- #inc_selected ⇒ Object
-
#initialize(top) ⇒ StrWindow
constructor
A new instance of StrWindow.
- #set_tog_mode ⇒ Object
- #tog ⇒ Object
Constructor Details
#initialize(top) ⇒ StrWindow
Returns a new instance of StrWindow.
160 161 162 163 164 165 166 |
# File 'lib/zgomot/ui/windows.rb', line 160 def initialize(top) @tog_mode, @selected = false, 0 @widths = Zgomot::UI::Output::STREAM_OUTPUT_FORMAT_WIDTHS TitleWindow.new('Streams', COLOR_BORDER, top, COLOR_BLUE) TableRowWindow.new(Zgomot::UI::Output::STREAM_HEADER, widths, COLOR_BORDER, top + 3, COLOR_BORDER) add_streams(top + 3) end |
Instance Attribute Details
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
159 160 161 |
# File 'lib/zgomot/ui/windows.rb', line 159 def rows @rows end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
159 160 161 |
# File 'lib/zgomot/ui/windows.rb', line 159 def selected @selected end |
#tog_mode ⇒ Object (readonly)
Returns the value of attribute tog_mode.
159 160 161 |
# File 'lib/zgomot/ui/windows.rb', line 159 def tog_mode @tog_mode end |
#widths ⇒ Object (readonly)
Returns the value of attribute widths.
159 160 161 |
# File 'lib/zgomot/ui/windows.rb', line 159 def widths @widths end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
159 160 161 |
# File 'lib/zgomot/ui/windows.rb', line 159 def window @window end |
Instance Method Details
#dec_selected ⇒ Object
178 179 180 181 182 |
# File 'lib/zgomot/ui/windows.rb', line 178 def dec_selected if tog_mode @selected = (selected - 1) % streams.length end end |
#display ⇒ Object
167 168 169 170 171 172 |
# File 'lib/zgomot/ui/windows.rb', line 167 def display (0..streams.length-1).each do |i| stream = streams[i] rows[i].display(stream.info, stream_color(stream, i)) end end |
#inc_selected ⇒ Object
173 174 175 176 177 |
# File 'lib/zgomot/ui/windows.rb', line 173 def inc_selected if tog_mode @selected = (selected + 1) % streams.length end end |
#set_tog_mode ⇒ Object
183 184 185 186 |
# File 'lib/zgomot/ui/windows.rb', line 183 def set_tog_mode @selected = 0 @tog_mode = tog_mode ? false : true end |