Class: Cliptic::Windows::Bar
- Defined in:
- lib/cliptic/windows.rb
Direct Known Subclasses
Constant Summary
Constants included from Chars
Chars::Block, Chars::HL, Chars::LL, Chars::LS, Chars::LU, Chars::MS, Chars::Nums, Chars::RL, Chars::RS, Chars::RU, Chars::TD, Chars::TL, Chars::TR, Chars::TU, Chars::Tick, Chars::VL, Chars::XX
Instance Attribute Summary collapse
-
#bg_col ⇒ Object
readonly
Returns the value of attribute bg_col.
Attributes inherited from Window
#centered_x, #centered_y, #col, #line, #x, #y
Instance Method Summary collapse
- #add_str(y: 0, x:, str:, bold: false, cp: bg_col) ⇒ Object
- #draw ⇒ Object
-
#initialize(line:, bg_col: ) ⇒ Bar
constructor
A new instance of Bar.
- #time_str(x:, str:, t: 5, cp: bg_col, bold: false) ⇒ Object
Methods inherited from Window
#bold, #clear, #color, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #wrap_str
Methods included from Chars
Constructor Details
#initialize(line:, bg_col: ) ⇒ Bar
Returns a new instance of Bar.
188 189 190 191 |
# File 'lib/cliptic/windows.rb', line 188 def initialize(line:, bg_col:$colors[:bar]) super(y:1, x:0, line:line, col:0) @bg_col = bg_col end |
Instance Attribute Details
#bg_col ⇒ Object (readonly)
Returns the value of attribute bg_col.
187 188 189 |
# File 'lib/cliptic/windows.rb', line 187 def bg_col @bg_col end |
Instance Method Details
#add_str(y: 0, x:, str:, bold: false, cp: bg_col) ⇒ Object
192 193 194 |
# File 'lib/cliptic/windows.rb', line 192 def add_str(y:0, x:, str:, bold:false, cp:bg_col) super(y:0, x:x, str:str, bold:bold, cp:cp) end |
#draw ⇒ Object
198 199 200 |
# File 'lib/cliptic/windows.rb', line 198 def draw bkgd(Curses.color_pair(bg_col)); self end |
#time_str(x:, str:, t: 5, cp: bg_col, bold: false) ⇒ Object
195 196 197 |
# File 'lib/cliptic/windows.rb', line 195 def time_str(x:, str:, t:5, cp:bg_col, bold:false) super(y:0, x:x, str:str, t:5, cp:cp, bold:bold) end |