class Gemthief::Executive::WindowManagement::Panel

Public Class Methods

new(screen_x, screen_y, screen_width, screen_height, content_width, content_height, content_x=0, content_y=0) click to toggle source
# File lib/gemthief/executive/window_management.rb, line 32
def initialize(screen_x, screen_y, screen_width, screen_height, content_width, content_height, content_x=0, content_y=0)
  @screen_x       = screen_x
  @screen_y       = screen_y
  @screen_width   = screen_width
  @screen_height  = screen_height
  @content_width  = content_width
  @content_height = content_height
  @content_x      = content_x
  @content_y      = content_y

  @outer = Curses::Pad.new(@content_height, @content_width)
  @inner = @outer.subpad(@content_height, @content_width,1,1)
end

Public Instance Methods

addstr(char) click to toggle source
# File lib/gemthief/executive/window_management.rb, line 53
def addstr(char)
  @inner.addstr("@")
end
clear() click to toggle source

TODO: Use Forwardable for these and other methods

# File lib/gemthief/executive/window_management.rb, line 47
def clear
  @inner.clear
end
dimensions() click to toggle source
# File lib/gemthief/executive/window_management.rb, line 71
def dimensions
  { x: @width, y: @height }
end
noutrefresh() click to toggle source
# File lib/gemthief/executive/window_management.rb, line 57
def noutrefresh
  @outer.noutrefresh(
    @content_y, @content_x, 
    @screen_y, @screen_x, 
    screen_maxrow, screen_maxcol
  )
  @outer.box(?|, ?-)
  @inner.noutrefresh(
    @content_y, @content_x,
    @screen_y+1, @screen_x+1,
    screen_maxrow-2, screen_maxcol-2
  )
end
screen_maxcol() click to toggle source
# File lib/gemthief/executive/window_management.rb, line 79
def screen_maxcol
  @screen_x + @screen_width
end
screen_maxrow() click to toggle source
# File lib/gemthief/executive/window_management.rb, line 75
def screen_maxrow
  @screen_y + @screen_height
end
setpos(at_line, at_col) click to toggle source
# File lib/gemthief/executive/window_management.rb, line 50
def setpos(at_line, at_col)
  @inner.setpos(at_line, at_col)
end