Class: IPlayer::GUI::Frame

Inherits:
Wx::Frame
  • Object
show all
Extended by:
Forwardable
Includes:
Wx
Defined in:
lib/iplayer/gui/frame.rb

Direct Known Subclasses

MainFrame

Defined Under Namespace

Classes: SizerProxy

Constant Summary collapse

AUTO =
-1

Instance Method Summary collapse

Instance Method Details

#button(handler, text) ⇒ Object



64
65
66
67
68
# File 'lib/iplayer/gui/frame.rb', line 64

def button(handler, text)
  b = Button.new(self, -1, text)
  evt_button(b.get_id){ |e| __send__(handler, e) }
  b
end

#field(default_text = "", options = {}) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/iplayer/gui/frame.rb', line 50

def field(default_text="", options={})
  width    = options[:width] || -1
  height   = options[:height] || -1
  tool_tip = options[:tool_tip]
  enter    = options[:enter]
  f = TextCtrl.new(self, -1, default_text, DEFAULT_POSITION, Size.new(width, height))
  f.set_tool_tip(tool_tip) if tool_tip
  f
end

#gaugeObject



60
61
62
# File 'lib/iplayer/gui/frame.rb', line 60

def gauge
  Gauge.new(self, -1, 1, DEFAULT_POSITION, DEFAULT_SIZE, GA_HORIZONTAL|GA_SMOOTH)
end

#h_sizer(&blk) ⇒ Object



44
# File 'lib/iplayer/gui/frame.rb', line 44

def h_sizer(&blk) sizer(HORIZONTAL, &blk); end

#label(text) ⇒ Object



46
47
48
# File 'lib/iplayer/gui/frame.rb', line 46

def label(text)
  StaticText.new(self, -1, text)
end

#sizer(alignment, &blk) ⇒ Object



37
38
39
40
41
42
# File 'lib/iplayer/gui/frame.rb', line 37

def sizer(alignment, &blk)
  s = BoxSizer.new(alignment)
  proxy = SizerProxy.new(self, s)
  blk.call(proxy) if block_given?
  s
end

#status_bar(widths) ⇒ Object



70
71
72
73
74
75
# File 'lib/iplayer/gui/frame.rb', line 70

def status_bar(widths)
  @status_bar = StatusBar.new(self, -1, 0)
  @status_bar.set_fields_count(widths.length)
  @status_bar.set_status_widths(widths)
  set_status_bar(@status_bar)
end

#v_sizer(&blk) ⇒ Object



43
# File 'lib/iplayer/gui/frame.rb', line 43

def v_sizer(&blk) sizer(VERTICAL, &blk); end