Class: IPlayer::GUI::Frame
- Inherits:
-
Wx::Frame
- Object
- Wx::Frame
- IPlayer::GUI::Frame
- Extended by:
- Forwardable
- Includes:
- Wx
- Defined in:
- lib/iplayer/gui/frame.rb
Direct Known Subclasses
Defined Under Namespace
Classes: SizerProxy
Constant Summary collapse
- AUTO =
-1
Instance Method Summary collapse
- #button(handler, text) ⇒ Object
- #field(default_text = "", options = {}) ⇒ Object
- #gauge ⇒ Object
- #h_sizer(&blk) ⇒ Object
- #label(text) ⇒ Object
- #sizer(alignment, &blk) ⇒ Object
- #status_bar(widths) ⇒ Object
- #v_sizer(&blk) ⇒ Object
Instance Method Details
#button(handler, text) ⇒ Object
64 65 66 67 68 |
# File 'lib/iplayer/gui/frame.rb', line 64 def (handler, text) b = Button.new(self, -1, text) (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="", ={}) width = [:width] || -1 height = [:height] || -1 tool_tip = [:tool_tip] enter = [: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 |
#gauge ⇒ Object
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 (widths) @status_bar = StatusBar.new(self, -1, 0) @status_bar.set_fields_count(widths.length) @status_bar.set_status_widths(widths) (@status_bar) end |
#v_sizer(&blk) ⇒ Object
43 |
# File 'lib/iplayer/gui/frame.rb', line 43 def v_sizer(&blk) sizer(VERTICAL, &blk); end |