Class: WxIRB::TerminalSplitter

Inherits:
Wx::SplitterWindow
  • Object
show all
Defined in:
lib/wxirb.rb

Overview

This window object is parent to the Input and Output text areas. It provides a sliding splitter control between the top and bottom text boxes.

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ TerminalSplitter

Returns a new instance of TerminalSplitter.



346
347
348
349
350
# File 'lib/wxirb.rb', line 346

def initialize(parent)
  super(parent, :style => Wx::SP_LIVE_UPDATE)
  self.set_sash_gravity(1.0)
  evt_splitter_dclick self, :on_dclick
end

Instance Method Details

#on_dclick(evt) ⇒ Object



352
353
354
# File 'lib/wxirb.rb', line 352

def on_dclick(evt)
  set_sash_position(- @bottom.best_size.height)
end

#split_horizontally(top, bottom, pos = nil) ⇒ Object



356
357
358
359
360
361
362
363
# File 'lib/wxirb.rb', line 356

def split_horizontally(top, bottom, pos=nil)
  @top ||= top
  @bottom ||= bottom
  minsz = @bottom.best_size.height
  set_minimum_pane_size(minsz) # this also prevents unsplitting.
  pos ||= - minsz
  super(@top, @bottom, pos)
end