wxruby 1.9.5-i386-mswin32 → 1.9.7-i386-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wx/classes/acceleratortable.rb +28 -0
- data/lib/wx/classes/animation.rb +18 -0
- data/lib/wx/classes/bitmap.rb +5 -0
- data/lib/wx/classes/busycursor.rb +12 -0
- data/lib/wx/classes/evthandler.rb +36 -21
- data/lib/wx/classes/functions.rb +44 -0
- data/lib/wx/classes/grid.rb +16 -7
- data/lib/wx/classes/htmlwindow.rb +8 -0
- data/lib/wx/classes/icon.rb +7 -0
- data/lib/wx/classes/iconbundle.rb +3 -0
- data/lib/wx/classes/image.rb +17 -0
- data/lib/wx/classes/imagelist.rb +3 -0
- data/lib/wx/classes/toolbartool.rb +4 -0
- data/lib/wx/classes/xmlresource.rb +21 -0
- data/lib/wx/keyword_ctors.rb +9 -6
- data/lib/wx/keyword_defs.rb +7 -0
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby2.exp +0 -0
- data/lib/wxruby2.lib +0 -0
- data/lib/wxruby2.so +0 -0
- data/samples/aui/aui.rb +6 -10
- data/samples/bigdemo/ColorPanel.rbw +7 -9
- data/samples/bigdemo/GridSimple.rbw +7 -9
- data/samples/bigdemo/MDIDemo.rbw +7 -9
- data/samples/bigdemo/PopupMenu.rbw +7 -9
- data/samples/bigdemo/ShapedWindow.rbw +6 -10
- data/samples/bigdemo/Sizers.rbw +7 -9
- data/samples/bigdemo/bigdemo.rb +24 -25
- data/samples/bigdemo/demoTemplate.rbw +6 -10
- data/samples/bigdemo/run.rb +6 -10
- data/samples/bigdemo/wxArtProvider.rbw +6 -10
- data/samples/bigdemo/wxBitmapButton.rbw +42 -41
- data/samples/bigdemo/wxButton.rbw +7 -9
- data/samples/bigdemo/wxCalendarCtrl.rbw +41 -53
- data/samples/bigdemo/wxCheckBox.rbw +7 -9
- data/samples/bigdemo/wxCheckListBox.rbw +7 -9
- data/samples/bigdemo/wxChoice.rbw +7 -9
- data/samples/bigdemo/wxChoicebook.rbw +7 -9
- data/samples/bigdemo/wxColourDialog.rbw +7 -10
- data/samples/bigdemo/wxComboBox.rbw +7 -9
- data/samples/bigdemo/wxCursor.rbw +6 -10
- data/samples/bigdemo/wxDialog.rbw +7 -9
- data/samples/bigdemo/wxDirDialog.rbw +7 -10
- data/samples/bigdemo/wxDragImage.rbw +6 -10
- data/samples/bigdemo/wxFileDialog.rbw +7 -9
- data/samples/bigdemo/wxFileDialog_Save.rbw +7 -10
- data/samples/bigdemo/wxFindReplaceDialog.rbw +7 -10
- data/samples/bigdemo/wxFontDialog.rbw +7 -10
- data/samples/bigdemo/wxFrame.rbw +7 -9
- data/samples/bigdemo/wxGauge.rbw +7 -9
- data/samples/bigdemo/wxGenericDirCtrl.rbw +6 -10
- data/samples/bigdemo/wxGrid.rbw +7 -9
- data/samples/bigdemo/wxHtmlHelpController.rbw +6 -11
- data/samples/bigdemo/wxListBox.rbw +7 -9
- data/samples/bigdemo/wxListCtrl_virtual.rbw +7 -9
- data/samples/bigdemo/wxMDIWindows.rbw +7 -9
- data/samples/bigdemo/wxMenu.rbw +7 -9
- data/samples/bigdemo/wxMessageDialog.rbw +7 -10
- data/samples/bigdemo/wxMiniFrame.rbw +6 -10
- data/samples/bigdemo/wxMultipleChoiceDialog.rbw +7 -9
- data/samples/bigdemo/wxNotebook.rbw +7 -9
- data/samples/bigdemo/wxProgressDialog.rbw +7 -9
- data/samples/bigdemo/wxRadioBox.rbw +7 -9
- data/samples/bigdemo/wxRadioButton.rbw +7 -9
- data/samples/bigdemo/wxSashWindow.rbw +6 -10
- data/samples/bigdemo/wxScrolledMessageDialog.rbw +7 -9
- data/samples/bigdemo/wxScrolledWindow.rbw +7 -9
- data/samples/bigdemo/wxSingleChoiceDialog.rbw +7 -9
- data/samples/bigdemo/wxSlider.rbw +7 -9
- data/samples/bigdemo/wxSpinButton.rbw +7 -9
- data/samples/bigdemo/wxSpinCtrl.rbw +7 -9
- data/samples/bigdemo/wxSplitterWindow.rbw +7 -9
- data/samples/bigdemo/wxStaticBitmap.rbw +7 -9
- data/samples/bigdemo/wxStaticText.rbw +7 -9
- data/samples/bigdemo/wxStatusBar.rbw +7 -9
- data/samples/bigdemo/wxTextCtrl.rbw +7 -9
- data/samples/bigdemo/wxTextEntryDialog.rbw +7 -10
- data/samples/bigdemo/wxToggleButton.rbw +7 -9
- data/samples/bigdemo/wxToolBar.rbw +7 -9
- data/samples/bigdemo/wxTreeCtrl.rbw +7 -9
- data/samples/calendar/calendar.rb +6 -10
- data/samples/caret/caret.rb +6 -10
- data/samples/controls/controls.rb +6 -10
- data/samples/dialogs/dialogs.rb +10 -11
- data/samples/dragdrop/dragdrop.rb +177 -0
- data/samples/drawing/graphics_drawing.rb +6 -7
- data/samples/drawing/images.rb +5 -10
- data/samples/etc/activation.rb +4 -10
- data/samples/etc/choice.rb +5 -10
- data/samples/etc/miniframe.rb +5 -10
- data/samples/etc/sash.rb +5 -10
- data/samples/etc/scrollwin.rb +4 -10
- data/samples/etc/system_settings.rb +4 -10
- data/samples/etc/threaded.rb +4 -10
- data/samples/etc/wizard.rb +5 -10
- data/samples/event/event.rb +3 -5
- data/samples/grid/grid.rb +5 -9
- data/samples/grid/gridtablebase.rb +134 -0
- data/samples/html/html.rb +4 -10
- data/samples/listbook/listbook.rb +4 -11
- data/samples/mdi/mdi.rb +5 -10
- data/samples/media/mediactrl.rb +4 -10
- data/samples/minimal/minimal.rb +18 -26
- data/samples/minimal/nothing.rb +5 -10
- data/samples/opengl/cube.rb +8 -14
- data/samples/printing/printing.rb +5 -179
- data/samples/text/scintilla.rb +5 -10
- data/samples/text/textctrl.rb +27 -38
- data/samples/text/unicode.rb +6 -2
- data/samples/treectrl/treectrl.rb +4 -10
- data/samples/xrc/xrc_sample.rb +6 -17
- metadata +12 -2
@@ -0,0 +1,177 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
|
+
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
+
begin
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
7
|
+
end
|
8
|
+
require 'wx'
|
9
|
+
|
10
|
+
# This sample demonstrates the use of the Clipboard and Drag and Drop
|
11
|
+
# classes. Whilst the functionality of these is slightly different, they
|
12
|
+
# are both based around the use of the DataObject classes to exchange
|
13
|
+
# data of various sorts between applications (i.e. into and out of
|
14
|
+
# wxRuby)
|
15
|
+
|
16
|
+
# A ListBox that collects file names dropped onto it
|
17
|
+
class FileDropList < Wx::ListBox
|
18
|
+
def initialize(*args)
|
19
|
+
super
|
20
|
+
# Set the handler for drag and drop actions
|
21
|
+
self.drop_target = ListFileDropTarget.new(self)
|
22
|
+
end
|
23
|
+
|
24
|
+
# The class that actually handles the dropped files; it keeps a
|
25
|
+
# reference to the ListBox, and appends items as they are added
|
26
|
+
class ListFileDropTarget < Wx::FileDropTarget
|
27
|
+
def initialize(list)
|
28
|
+
super()
|
29
|
+
@list = list
|
30
|
+
end
|
31
|
+
|
32
|
+
# This method is overridden to specify what happens when a file is
|
33
|
+
# dropped
|
34
|
+
def on_drop_files(x, y, files)
|
35
|
+
files.each { | file | @list.append(file) }
|
36
|
+
true # currently need to return boolean from this method
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class FileDropPane < Wx::Panel
|
42
|
+
LABEL = "Drag and drop files from Explorer/Finder/etc to here\n" +
|
43
|
+
"to add them to the list."
|
44
|
+
def initialize(parent)
|
45
|
+
super
|
46
|
+
sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
47
|
+
txt = Wx::StaticText.new( self, :label => LABEL)
|
48
|
+
sizer.add(txt, 0, Wx::ALL, 4)
|
49
|
+
|
50
|
+
@drop = FileDropList.new(self)
|
51
|
+
sizer.add(@drop, 1, Wx::GROW|Wx::ALL, 4)
|
52
|
+
self.sizer = sizer
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# A canvas which can display a pasted image
|
57
|
+
class PasteCanvas < Wx::Window
|
58
|
+
attr_accessor :bitmap
|
59
|
+
def initialize(parent)
|
60
|
+
super(parent, :style => Wx::SUNKEN_BORDER)
|
61
|
+
self.size = [ 200, 200 ]
|
62
|
+
@bitmap = Wx::NULL_BITMAP
|
63
|
+
evt_paint :on_paint
|
64
|
+
end
|
65
|
+
|
66
|
+
def on_paint(evt)
|
67
|
+
paint do | dc |
|
68
|
+
dc.clear
|
69
|
+
if bitmap.ok?
|
70
|
+
dc.draw_bitmap(bitmap, 0, 0, false)
|
71
|
+
end
|
72
|
+
dc.pen = Wx::BLACK_PEN
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# A Notebook panel to hold an image-paste canvas
|
78
|
+
class PastePane < Wx::Panel
|
79
|
+
LABEL = "Use the buttons below to paste text and images from\n" +
|
80
|
+
"the system clipboard, and then to copy them back."
|
81
|
+
def initialize(parent)
|
82
|
+
super
|
83
|
+
sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
84
|
+
txt = Wx::StaticText.new( self, :label => LABEL)
|
85
|
+
sizer.add(txt, 0, Wx::ALL, 4)
|
86
|
+
|
87
|
+
# Sizer for displaying text and image from the clipboard
|
88
|
+
paste_sizer = Wx::FlexGridSizer.new(2, 2, 2, 2)
|
89
|
+
paste_sizer.add_growable_col(0, 1)
|
90
|
+
paste_sizer.add_growable_col(1, 1)
|
91
|
+
paste_sizer.add_growable_row(1)
|
92
|
+
|
93
|
+
paste_sizer.add( Wx::StaticText.new(self, :label => 'Clipboard text') )
|
94
|
+
paste_sizer.add( Wx::StaticText.new(self, :label => 'Clipboard image') )
|
95
|
+
|
96
|
+
# Target for displaying text from the clipboard
|
97
|
+
@text = Wx::TextCtrl.new(self, :style => Wx::TE_MULTILINE)
|
98
|
+
paste_sizer.add(@text, 1, Wx::GROW)
|
99
|
+
|
100
|
+
# Target for displaying images from the clipboard
|
101
|
+
@canvas = PasteCanvas.new(self)
|
102
|
+
paste_sizer.add(@canvas, 1, Wx::GROW)
|
103
|
+
|
104
|
+
sizer.add(paste_sizer, 1, Wx::ALL|Wx::GROW, 4)
|
105
|
+
|
106
|
+
button_sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
107
|
+
|
108
|
+
@paste_bt = Wx::Button.new(self, :label => 'Paste')
|
109
|
+
evt_button @paste_bt, :on_paste
|
110
|
+
button_sizer.add(@paste_bt, 0, Wx::ALL, 4)
|
111
|
+
|
112
|
+
@copy_img_bt = Wx::Button.new(self, :label => 'Copy image')
|
113
|
+
evt_button @copy_img_bt, :on_copy_image
|
114
|
+
button_sizer.add(@copy_img_bt, 0, Wx::ALL, 4)
|
115
|
+
|
116
|
+
@copy_txt_bt = Wx::Button.new(self, :label => 'Copy text')
|
117
|
+
evt_button @copy_txt_bt, :on_copy_text
|
118
|
+
button_sizer.add(@copy_txt_bt, 0, Wx::ALL, 4)
|
119
|
+
|
120
|
+
sizer.add(button_sizer, 0)
|
121
|
+
self.sizer = sizer
|
122
|
+
end
|
123
|
+
|
124
|
+
# Receive data from the clipboard
|
125
|
+
def on_paste(evt)
|
126
|
+
# Temporarily open the clipboard
|
127
|
+
Wx::Clipboard.open do | clip |
|
128
|
+
# Test if bitmap data is available on the clipboard; if so, copy
|
129
|
+
if clip.supported?(Wx::DF_BITMAP)
|
130
|
+
bmp = Wx::BitmapDataObject.new
|
131
|
+
clip.get_data(bmp) # Fill the data object with bitmap`
|
132
|
+
@canvas.bitmap = bmp.bitmap
|
133
|
+
@canvas.refresh
|
134
|
+
end
|
135
|
+
# Test if text data is available on the clipboard; if so, copy
|
136
|
+
if clip.supported?(Wx::DF_TEXT)
|
137
|
+
txt = Wx::TextDataObject.new
|
138
|
+
clip.get_data(txt) # Fill the data object with text
|
139
|
+
@text.value = txt.text
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Paste an image to the clipboard
|
145
|
+
def on_copy_image
|
146
|
+
Wx::Clipboard.open do | clip |
|
147
|
+
clip.data = Wx::BitmapDataObject.new(@canvas.bitmap)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# Paste text to the clipboard
|
152
|
+
def on_copy_text
|
153
|
+
Wx::Clipboard.open do | clip |
|
154
|
+
clip.data = Wx::TextDataObject.new(@text.value)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
class DataObjectFrame < Wx::Frame
|
160
|
+
def initialize(parent)
|
161
|
+
super
|
162
|
+
panel = Wx::Panel.new(self)
|
163
|
+
panel.sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
164
|
+
nb = Wx::Notebook.new(panel)
|
165
|
+
panel.sizer.add(nb, 1, Wx::ALL|Wx::GROW, 8)
|
166
|
+
fd = FileDropPane.new(nb)
|
167
|
+
nb.add_page(fd, 'Drag and Drop')
|
168
|
+
cv = PastePane.new(nb)
|
169
|
+
nb.add_page(cv, 'Clipboard')
|
170
|
+
# urldrop = URLDropList.new(self)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
Wx::App.run do
|
175
|
+
frame = DataObjectFrame.new(nil)
|
176
|
+
frame.show
|
177
|
+
end
|
@@ -1,12 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
|
+
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
1
4
|
begin
|
2
|
-
require '
|
3
|
-
rescue LoadError
|
4
|
-
begin
|
5
|
-
require 'rubygems'
|
6
|
-
rescue LoadError
|
7
|
-
raise no_wx_err
|
8
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
9
7
|
end
|
8
|
+
require 'wx'
|
10
9
|
|
11
10
|
class GfxInfo
|
12
11
|
attr_accessor :font, :w, :h, :x, :y, :x_axis, :y_axis, :txt, :rotation
|
data/samples/drawing/images.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
9
|
+
|
15
10
|
|
16
11
|
# This sample demonstrates how to draw an image from a file onto a
|
17
12
|
# window. This one uses a small PNG file, but other formats such as JPEG
|
data/samples/etc/activation.rb
CHANGED
@@ -1,17 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
15
9
|
|
16
10
|
# This sample demonstrates the use of Activate Events. These are
|
17
11
|
# generated when a frame becomes active or inactive. This is typically
|
data/samples/etc/choice.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
9
|
+
|
15
10
|
include Wx
|
16
11
|
|
17
12
|
ID_CHOICE = 1000
|
data/samples/etc/miniframe.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
9
|
+
|
15
10
|
|
16
11
|
class MyFrame < Wx::Frame
|
17
12
|
attr_reader :mini
|
data/samples/etc/sash.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
9
|
+
|
15
10
|
|
16
11
|
class MySashFrame < Wx::Frame
|
17
12
|
def initialize(title, pos, size, style = Wx::DEFAULT_FRAME_STYLE)
|
data/samples/etc/scrollwin.rb
CHANGED
@@ -1,17 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
15
9
|
|
16
10
|
# Example demonstrating the use of Wx::ScrolledWindow and the
|
17
11
|
# ScrollWinEvents
|
@@ -1,17 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
15
9
|
|
16
10
|
# This example lists the various system settings that WxRuby knows
|
17
11
|
# about. To use it, run it and use the 'View' menu to list the different
|
data/samples/etc/threaded.rb
CHANGED
@@ -1,17 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
15
9
|
|
16
10
|
# This simple sample demonstrates how to use Ruby 1.8's lightweight
|
17
11
|
# (green) threads to execute non-GUI code in parallel with a wxRuby
|
data/samples/etc/wizard.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require '
|
7
|
-
rescue LoadError
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
require 'wx'
|
11
|
-
rescue LoadError
|
12
|
-
raise no_wx_err
|
13
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
14
7
|
end
|
8
|
+
require 'wx'
|
9
|
+
|
15
10
|
|
16
11
|
class MyFrame < Wx::Frame
|
17
12
|
def initialize(title, pos, size)
|
data/samples/event/event.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# wxRuby2 Sample Code. Copyright (c) 2004-
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
3
|
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
4
|
-
|
5
4
|
begin
|
6
|
-
require 'rubygems'
|
7
|
-
require 'wx'
|
5
|
+
require 'rubygems'
|
8
6
|
rescue LoadError
|
9
|
-
require 'wx'
|
10
7
|
end
|
8
|
+
require 'wx'
|
11
9
|
|
12
10
|
# This sample demonstrates how to dynamically connect and disconnect
|
13
11
|
# event handlers, and how to create custom event types and listeners
|
data/samples/grid/grid.rb
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
|
3
|
+
# Freely reusable code: see SAMPLES-LICENSE.TXT for details
|
2
4
|
begin
|
3
|
-
require '
|
4
|
-
rescue LoadError
|
5
|
-
begin
|
6
|
-
require 'rubygems'
|
7
|
-
load 'wx'
|
8
|
-
rescue
|
9
|
-
raise no_wx_err
|
10
|
-
end
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
11
7
|
end
|
12
|
-
|
8
|
+
require 'wx'
|
13
9
|
|
14
10
|
class GridFrame < Wx::Frame
|
15
11
|
|