class PM::Geometry
Defines positions and sizes of windows. Rects contain [height, width, top, left], which is the order used by Curses::Window.new.
Public Class Methods
new()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 9 def initialize @top_height = (lines() - 1) * 2 / 3 @bot_height = (lines() - 1) - @top_height @top_width = cols() / 3 @sls_height = @top_height / 3 @sl_height = @top_height - @sls_height @info_width = cols() - (@top_width * 2) @info_left = @top_width * 2 end
Public Instance Methods
help_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 49 def help_rect [lines() - 6, cols() - 6, 3, 3] end
info_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 45 def info_rect [@top_height, @info_width, 0, @info_left] end
message_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 41 def message_rect [1, cols(), lines()-1, 0] end
patch_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 37 def patch_rect [@bot_height, cols(), @top_height, 0] end
song_list_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 21 def song_list_rect [@sl_height, @top_width, 0, 0] end
song_lists_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 29 def song_lists_rect [@sls_height, @top_width, @sl_height, 0] end
song_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 25 def song_rect [@sl_height, @top_width, 0, @top_width] end
trigger_rect()
click to toggle source
# File lib/patchmaster/curses/geometry.rb, line 33 def trigger_rect [@sls_height, @top_width, @sl_height, @top_width] end