Class: Cliptic::Windows::Bar

Inherits:
Window
  • Object
show all
Defined in:
lib/cliptic/windows.rb

Direct Known Subclasses

Interface::Bottom_Bar, Interface::Top_Bar

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

Attributes inherited from Window

#centered_x, #centered_y, #col, #line, #x, #y

Instance Method Summary collapse

Methods inherited from Window

#bold, #clear, #color, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #wrap_str

Methods included from Chars

small_num

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_colObject (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

#drawObject



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