Sha256: 4ebd44eb5b068ff441dcf210e1a339893b856a91e043ac7541c7d5c8dbb9bec1

Contents?: true

Size: 1.53 KB

Versions: 14

Compression:

Stored size: 1.53 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'



class TestCheckBox < Wx::Panel
    def initialize(parent, log)
        @log = log
        super(parent, -1)
        
        Wx::StaticText.new(self, -1, "This example uses the wxCheckBox control", Wx::Point.new(10,10))
        
        cID = Wx::ID_HIGHEST + 1
        cb1 = Wx::CheckBox.new(self, cID, " Apples", Wx::Point.new(65, 40), Wx::Size.new(150,20), Wx::NO_BORDER)
        cb2 = Wx::CheckBox.new(self, cID + 1, " Oranges", Wx::Point.new(65,60), Wx::Size.new(150,20), Wx::NO_BORDER)
        cb3 = Wx::CheckBox.new(self, cID + 2, " Pears", Wx::Point.new(65,80), Wx::Size.new(150,20), Wx::NO_BORDER)
        
        evt_checkbox(cID) {|event| on_check_box(event)}
        evt_checkbox(cID+1) {|event| on_check_box(event)}
        evt_checkbox(cID+2) {|event| on_check_box(event)}
    end
    
    def on_check_box(event)
        @log.write_text("evt_checkbox: " + event.is_checked.to_s)
    end
end


module Demo
    def Demo.run(frame, nb, log)
        win = TestCheckBox.new(nb, log)
        return win
    end
    
    def Demo.overview
        return "A checkbox is a labelled box which is either on (checkmark is visible) or off (no checkmark)."
    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/wxCheckBox.rbw
wxruby3-0.9.1-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.rc.3-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.rc.2-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.rc.1-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.14-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.13-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.11-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.10-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.9-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.8-x64-mingw-ucrt samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.2-x64-mingw-ucrt-3.2-3.2.2 samples/bigdemo/wxCheckBox.rbw
wxruby3-0.9.0.pre.beta.1-x64-mingw-ucrt-3.2 samples/bigdemo/wxCheckBox.rbw