Sha256: cfba9a1be2c88f14aa8c7d32d3be4ceb322e64af172f5365c5544cde56be5e9c

Contents?: true

Size: 1.87 KB

Versions: 20

Compression:

Stored size: 1.87 KB

Contents

#!/usr/bin/env ruby

begin
  require 'wx'
rescue LoadError => no_wx_err
  begin
    require 'rubygems'
    require 'wx'
  rescue LoadError
    raise no_wx_err
  end
end

$buttonDefs = {
    814 => ['GridSimple',      ' Simple wxGrid'] # , catching all events '] ,
    # 815 => ['GridStdEdRend',   ' wxGrid showing Editors and Renderers '],
    # 818 => ['GridHugeTable',   ' A wxGrid with a HUGE table [100 MILLION cells!] '],
    # 817 => ['GridCustTable',   ' wxGrid using a custom Table, with non-string data '],
    # 819 => ['GridEnterHandler',' Remapping keys to behave differently '],
    # 820 => ['GridCustEditor',  ' Shows how to create a custom Cell Editor '],
    # 821 => ['GridDragable',    ' A wxGrid with dragable rows and columns '],
    # 822 => ['GridDragAndDrop', 'Shows how to make a grid a drop target for files'],
    }

class ButtonPanel < Wx::Panel
    def initialize(parent, log)
        super(parent, -1)
        @log = log
        
        box = Wx::BoxSizer.new(Wx::VERTICAL)
        box.add(20,30)
        keys = $buttonDefs.keys().sort()
        keys.each do |key| 
            text = $buttonDefs[key][1]
            btn = Wx::Button.new(self, key, text)
            box.add(btn, 0, Wx::ALIGN_CENTER | Wx::ALL, 10)
            evt_button(key) {|event| on_button(event)}
        end
        set_sizer(box)
    end
    
    def on_button(event)
        modName = $buttonDefs[event.get_id()][0]
        mod_file = File.join(File.dirname(__FILE__), modName + ".rbw")
        load mod_file
        
        frame = GridDemo::TestFrame.new(nil, @log)
        frame.show()
    end
end

module Demo
    def Demo.run(frame,nb,log)
        win = ButtonPanel.new(nb, log)
        return win
    end
    
    def Demo.overview
        "A simple grid."
    end
end


if __FILE__ == $0
  run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
  load run_solo_lib
  run File.basename($0)
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
wxruby-1.9.3-i386-mswin32 samples/bigdemo/wxGrid.rbw
wxruby-1.9.2-powerpc-darwin8.10.0 samples/bigdemo/wxGrid.rbw
wxruby-1.9.2-i686-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.2-i686-darwin8.8.2 samples/bigdemo/wxGrid.rbw
wxruby-1.9.1-powerpc-darwin8.3.0 samples/bigdemo/wxGrid.rbw
wxruby-1.9.1-i686-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.1-i686-darwin8.4.1 samples/bigdemo/wxGrid.rbw
wxruby-1.9.0-powerpc-darwin8.10.0 samples/bigdemo/wxGrid.rbw
wxruby-1.9.0-i686-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.0-i686-darwin8.4.1 samples/bigdemo/wxGrid.rbw
wxruby-1.9.0-i386-mswin32 samples/bigdemo/wxGrid.rbw
wxruby-1.9.1-x86_64-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.2-x86_64-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.3-universal-darwin samples/bigdemo/wxGrid.rbw
wxruby-1.9.3-x86-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.4-x86_64-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.4-x86-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.5-universal-darwin-9 samples/bigdemo/wxGrid.rbw
wxruby-1.9.5-x86-linux samples/bigdemo/wxGrid.rbw
wxruby-1.9.5-x86_64-linux samples/bigdemo/wxGrid.rbw