Class: Cliptic::Interface::Resizer

Inherits:
Menu_Box show all
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

Methods inherited from Menu_Box

#add_title, #reset_pos

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

small_num

Constructor Details

#initializeResizer

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

#drawObject



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

#lineObject



101
102
103
# File 'lib/cliptic/interface.rb', line 101

def line
  (Curses.lines-8)/2
end

#promptObject



98
99
100
# File 'lib/cliptic/interface.rb', line 98

def prompt
  "Screen too small. Increase screen size to run cliptic."
end

#showObject



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

#titleObject



82
83
84
# File 'lib/cliptic/interface.rb', line 82

def title
  "Screen too small"
end