Sha256: 8f28752b59b9eed74cbc84b02de188b5572baf3b07728ed24b4edda91e1c4de2

Contents?: true

Size: 1.97 KB

Versions: 14

Compression:

Stored size: 1.97 KB

Contents

#!/usr/bin/env ruby
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
begin
  require 'rubygems' 
rescue LoadError
end
require 'wx'



$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

14 entries across 14 versions & 1 rubygems

Version Path
wxruby3-0.9.2-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.1-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.rc.3-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.rc.2-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.rc.1-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.14-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.13-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.11-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.10-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.9-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.8-x64-mingw-ucrt samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.2-x64-mingw-ucrt-3.2-3.2.2 samples/bigdemo/wxGrid.rbw
wxruby3-0.9.0.pre.beta.1-x64-mingw-ucrt-3.2 samples/bigdemo/wxGrid.rbw