Class: Cliptic::Interface::Menu_Box
- Inherits:
-
Windows::Window
- Object
- Curses::Window
- Windows::Window
- Cliptic::Interface::Menu_Box
- Includes:
- Cliptic::Interface
- Defined in:
- lib/cliptic/interface.rb
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
-
#bot_b ⇒ Object
readonly
Returns the value of attribute bot_b.
-
#draw_bars ⇒ Object
readonly
Returns the value of attribute draw_bars.
-
#logo ⇒ Object
readonly
Returns the value of attribute logo.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#top_b ⇒ Object
readonly
Returns the value of attribute top_b.
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #x, #y
Instance Method Summary collapse
- #add_title(y: 4, str: title, cp: , bold: true) ⇒ Object
- #draw ⇒ Object
-
#initialize(y:, title: false) ⇒ Menu_Box
constructor
A new instance of Menu_Box.
- #line ⇒ Object
- #reset_pos ⇒ Object
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #move, #refresh, #reset_attrs, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
#initialize(y:, title: false) ⇒ Menu_Box
Returns a new instance of Menu_Box.
51 52 53 54 55 56 57 58 |
# File 'lib/cliptic/interface.rb', line 51 def initialize(y:, title:false) @logo = Logo.new(line:line+1) @title = title super(y:y, x:logo.x+4, line:line, col:nil) @top_b = Top_Bar.new @bot_b = Bottom_Bar.new @draw_bars = true end |
Instance Attribute Details
#bot_b ⇒ Object (readonly)
Returns the value of attribute bot_b.
50 51 52 |
# File 'lib/cliptic/interface.rb', line 50 def bot_b @bot_b end |
#draw_bars ⇒ Object (readonly)
Returns the value of attribute draw_bars.
50 51 52 |
# File 'lib/cliptic/interface.rb', line 50 def @draw_bars end |
#logo ⇒ Object (readonly)
Returns the value of attribute logo.
50 51 52 |
# File 'lib/cliptic/interface.rb', line 50 def logo @logo end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
50 51 52 |
# File 'lib/cliptic/interface.rb', line 50 def title @title end |
#top_b ⇒ Object (readonly)
Returns the value of attribute top_b.
50 51 52 |
# File 'lib/cliptic/interface.rb', line 50 def top_b @top_b end |
Instance Method Details
#add_title(y: 4, str: title, cp: , bold: true) ⇒ Object
69 70 71 |
# File 'lib/cliptic/interface.rb', line 69 def add_title(y:4, str:title, cp:$colors[:title], bold:true) add_str(y:y, str:str, cp:cp, bold:bold) end |
#draw ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/cliptic/interface.rb', line 59 def draw super [top_b, bot_b].each(&:draw) if logo.draw add_title if title self end |
#line ⇒ Object
66 67 68 |
# File 'lib/cliptic/interface.rb', line 66 def line (Curses.lines-15)/2 end |
#reset_pos ⇒ Object
72 73 74 75 76 |
# File 'lib/cliptic/interface.rb', line 72 def reset_pos move(line:line) logo.move(line:line+1) [top_b, bot_b].each(&:reset_pos) end |