Sha256: 65ca10f6df5c3b234dcde47e42c542f554eb3b4299654ae3689923111d61a10e

Contents?: true

Size: 1.44 KB

Versions: 20

Compression:

Stored size: 1.44 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

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

20 entries across 20 versions & 1 rubygems

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