Class: Cliptic::Interface::Resizer
- Inherits:
-
Menu_Box
- Object
- Curses::Window
- Windows::Window
- Menu_Box
- Cliptic::Interface::Resizer
- 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
Attributes inherited from Menu_Box
#bot_b, #draw_bars, #logo, #top_b
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #x, #y
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize ⇒ Resizer
constructor
A new instance of Resizer.
- #line ⇒ Object
- #prompt ⇒ Object
- #show ⇒ Object
- #title ⇒ Object
Methods inherited from Menu_Box
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
#initialize ⇒ Resizer
Returns a new instance of Resizer.
79 80 81 |
# File 'lib/cliptic/interface.rb', line 79 def initialize super(y:8, title:title) end |
Instance Method Details
#draw ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/cliptic/interface.rb', line 85 def draw Screen.clear reset_pos super wrap_str(str:prompt, line:5) refresh end |
#line ⇒ Object
101 102 103 |
# File 'lib/cliptic/interface.rb', line 101 def line (Curses.lines-8)/2 end |
#prompt ⇒ Object
98 99 100 |
# File 'lib/cliptic/interface.rb', line 98 def prompt "Screen too small. Increase screen size to run cliptic." end |
#show ⇒ Object
92 93 94 95 96 97 |
# File 'lib/cliptic/interface.rb', line 92 def show while Screen.too_small? draw exit if (c = getch) == ?q || c == 3 end end |
#title ⇒ Object
82 83 84 |
# File 'lib/cliptic/interface.rb', line 82 def title "Screen too small" end |