wxruby 1.9.9-x86-mingw32 → 1.9.10-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +53 -53
- data/README +297 -297
- data/lib/wx.rb +53 -53
- data/lib/wx/classes/bitmap.rb +29 -1
- data/lib/wx/classes/clipboard.rb +19 -3
- data/lib/wx/classes/colour.rb +6 -4
- data/lib/wx/classes/data_object.rb +14 -0
- data/lib/wx/classes/data_object_simple.rb +6 -0
- data/lib/wx/classes/dataformat.rb +23 -0
- data/lib/wx/classes/evthandler.rb +31 -4
- data/lib/wx/classes/genericdirctrl.rb +36 -0
- data/lib/wx/classes/grid.rb +8 -0
- data/lib/wx/classes/hboxsizer.rb +6 -0
- data/lib/wx/classes/icon.rb +12 -1
- data/lib/wx/classes/image.rb +13 -1
- data/lib/wx/classes/listctrl.rb +12 -0
- data/lib/wx/classes/point.rb +8 -0
- data/lib/wx/classes/rect.rb +10 -1
- data/lib/wx/classes/richtextctrl.rb +22 -0
- data/lib/wx/classes/size.rb +9 -0
- data/lib/wx/classes/sizer.rb +18 -3
- data/lib/wx/classes/toolbar.rb +4 -6
- data/lib/wx/classes/vboxsizer.rb +6 -0
- data/lib/wx/classes/window.rb +7 -0
- data/lib/wx/classes/xmlresource.rb +17 -0
- data/lib/wx/helpers.rb +16 -1
- data/lib/wx/keyword_ctors.rb +3 -2
- data/lib/wx/keyword_defs.rb +27 -5
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby2.so +0 -0
- data/samples/SAMPLES-LICENSE.TXT +17 -17
- data/samples/bigdemo/About.rbw +39 -39
- data/samples/bigdemo/ColorPanel.rbw +23 -23
- data/samples/bigdemo/GridSimple.rbw +78 -78
- data/samples/bigdemo/MDIDemo.rbw +57 -57
- data/samples/bigdemo/PopupMenu.rbw +149 -149
- data/samples/bigdemo/Sizers.rbw +543 -543
- data/samples/bigdemo/bigdemo.rb +823 -823
- data/samples/bigdemo/demoTemplate.rbw +33 -33
- data/samples/bigdemo/icons/choice.xpm +27 -27
- data/samples/bigdemo/icons/combo.xpm +27 -27
- data/samples/bigdemo/icons/copy.xpm +25 -25
- data/samples/bigdemo/icons/cut.xpm +24 -24
- data/samples/bigdemo/icons/gauge.xpm +27 -27
- data/samples/bigdemo/icons/help.xpm +25 -25
- data/samples/bigdemo/icons/list.xpm +27 -27
- data/samples/bigdemo/icons/mondrian.xpm +44 -44
- data/samples/bigdemo/icons/new.xpm +24 -24
- data/samples/bigdemo/icons/ogl.ico +0 -0
- data/samples/bigdemo/icons/ogl.xpm +45 -45
- data/samples/bigdemo/icons/open.xpm +26 -26
- data/samples/bigdemo/icons/paste.xpm +38 -38
- data/samples/bigdemo/icons/preview.xpm +26 -26
- data/samples/bigdemo/icons/print.xpm +26 -26
- data/samples/bigdemo/icons/radio.xpm +27 -27
- data/samples/bigdemo/icons/robert.xpm +415 -415
- data/samples/bigdemo/icons/save.xpm +25 -25
- data/samples/bigdemo/icons/smiles.xpm +39 -39
- data/samples/bigdemo/icons/smiley.xpm +42 -42
- data/samples/bigdemo/icons/stattext.xpm +24 -24
- data/samples/bigdemo/icons/test2.bmp +0 -0
- data/samples/bigdemo/icons/test2.xpm +79 -79
- data/samples/bigdemo/icons/text.xpm +27 -27
- data/samples/bigdemo/icons/tog1.xpm +38 -38
- data/samples/bigdemo/icons/tog2.xpm +38 -38
- data/samples/bigdemo/icons/wxwin16x16.xpm +25 -25
- data/samples/bigdemo/tips.txt +7 -7
- data/samples/bigdemo/utils.rb +11 -11
- data/samples/bigdemo/wxButton.rbw +64 -64
- data/samples/bigdemo/wxCalendarCtrl.rbw +60 -60
- data/samples/bigdemo/wxCheckBox.rbw +50 -50
- data/samples/bigdemo/wxCheckListBox.rbw +65 -75
- data/samples/bigdemo/wxChoice.rbw +47 -47
- data/samples/bigdemo/wxColourDialog.rbw +31 -31
- data/samples/bigdemo/wxComboBox.rbw +77 -77
- data/samples/bigdemo/wxDialog.rbw +74 -74
- data/samples/bigdemo/wxDirDialog.rbw +29 -29
- data/samples/bigdemo/wxFileDialog.rbw +37 -37
- data/samples/bigdemo/wxFileDialog_Save.rbw +35 -35
- data/samples/bigdemo/wxFindReplaceDialog.rbw +82 -82
- data/samples/bigdemo/wxFontDialog.rbw +173 -173
- data/samples/bigdemo/wxFrame.rbw +53 -53
- data/samples/bigdemo/wxGauge.rbw +71 -71
- data/samples/bigdemo/wxGrid.rbw +66 -66
- data/samples/bigdemo/wxListBox.rbw +140 -140
- data/samples/bigdemo/wxListCtrl_virtual.rbw +112 -107
- data/samples/bigdemo/wxMDIWindows.rbw +50 -50
- data/samples/bigdemo/wxMenu.rbw +236 -236
- data/samples/bigdemo/wxMessageDialog.rbw +27 -27
- data/samples/bigdemo/wxMultipleChoiceDialog.rbw +32 -32
- data/samples/bigdemo/wxNotebook.rbw +136 -136
- data/samples/bigdemo/wxProgressDialog.rbw +43 -43
- data/samples/bigdemo/wxRadioBox.rbw +72 -72
- data/samples/bigdemo/wxRadioButton.rbw +125 -125
- data/samples/bigdemo/wxSashWindow.rbw +2 -2
- data/samples/bigdemo/wxScrolledMessageDialog.rbw +57 -57
- data/samples/bigdemo/wxScrolledWindow.rbw +199 -199
- data/samples/bigdemo/wxSingleChoiceDialog.rbw +33 -33
- data/samples/bigdemo/wxSlider.rbw +42 -42
- data/samples/bigdemo/wxSpinButton.rbw +50 -50
- data/samples/bigdemo/wxSpinCtrl.rbw +51 -51
- data/samples/bigdemo/wxSplitterWindow.rbw +63 -63
- data/samples/bigdemo/wxStaticBitmap.rbw +51 -51
- data/samples/bigdemo/wxStaticText.rbw +55 -55
- data/samples/bigdemo/wxStatusBar.rbw +126 -126
- data/samples/bigdemo/wxTextCtrl.rbw +149 -149
- data/samples/bigdemo/wxTextEntryDialog.rbw +31 -31
- data/samples/bigdemo/wxToggleButton.rbw +49 -49
- data/samples/bigdemo/wxToolBar.rbw +131 -131
- data/samples/bigdemo/wxTreeCtrl.rbw +191 -190
- data/samples/calendar/calendar.rb +256 -271
- data/samples/caret/caret.rb +282 -282
- data/samples/caret/mondrian.xpm +44 -44
- data/samples/controls/controls.rb +1136 -1136
- data/samples/controls/get_item_sample.rb +87 -87
- data/samples/controls/icons/choice.xpm +27 -27
- data/samples/controls/icons/combo.xpm +27 -27
- data/samples/controls/icons/gauge.xpm +27 -27
- data/samples/controls/icons/list.xpm +27 -27
- data/samples/controls/icons/radio.xpm +27 -27
- data/samples/controls/icons/stattext.xpm +24 -24
- data/samples/controls/icons/text.xpm +27 -27
- data/samples/controls/mondrian.xpm +44 -44
- data/samples/dialogs/dialogs.rb +797 -723
- data/samples/dialogs/tips.txt +18 -18
- data/samples/drawing/images.rb +37 -37
- data/samples/etc/activation.rb +102 -102
- data/samples/etc/choice.rb +67 -67
- data/samples/etc/miniframe.rb +79 -79
- data/samples/etc/sash.rb +130 -130
- data/samples/etc/scrollwin.rb +110 -110
- data/samples/etc/system_settings.rb +252 -252
- data/samples/etc/toolbar_sizer_additem.rb +55 -0
- data/samples/etc/wizard.rb +74 -74
- data/samples/event/update_ui_event.rb +70 -0
- data/samples/grid/gridtablebase.rb +43 -29
- data/samples/listbook/listbook.rb +174 -174
- data/samples/listbook/listbook.xrc +370 -370
- data/samples/mdi/mdi.rb +85 -77
- data/samples/minimal/minimal.rb +77 -77
- data/samples/minimal/nothing.rb +16 -16
- data/samples/text/format-text-bold.png +0 -0
- data/samples/text/format-text-italic.png +0 -0
- data/samples/text/format-text-underline.png +0 -0
- data/samples/text/rich_textctrl.rb +98 -0
- data/samples/text/textctrl.rb +111 -113
- data/samples/text/unicode.rb +242 -242
- data/samples/text/utf8.txt +14 -14
- data/samples/treectrl/treectrl.rb +1166 -1174
- data/samples/xrc/samples.xrc +46 -46
- data/samples/xrc/xrc_sample.rb +76 -96
- metadata +15 -3
data/lib/wx/classes/listctrl.rb
CHANGED
@@ -7,6 +7,18 @@ class Wx::ListCtrl
|
|
7
7
|
0.upto(item_count - 1) { | i | yield i }
|
8
8
|
end
|
9
9
|
|
10
|
+
# Returns an Array containing the indexes of the currently selected
|
11
|
+
# items
|
12
|
+
def get_selections
|
13
|
+
selections = []
|
14
|
+
item = get_next_item(-1, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED)
|
15
|
+
while item >= 0
|
16
|
+
selections << item
|
17
|
+
item = get_next_item(item, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED)
|
18
|
+
end
|
19
|
+
selections
|
20
|
+
end
|
21
|
+
|
10
22
|
# Stub version for LC_VIRTUAL controls that does nothing; may be
|
11
23
|
# overridden in subclasses.
|
12
24
|
def on_get_item_attr(i)
|
data/lib/wx/classes/point.rb
CHANGED
@@ -4,6 +4,14 @@ class Wx::Point
|
|
4
4
|
"#<Wx::Point: (#{x}, #{y})>"
|
5
5
|
end
|
6
6
|
|
7
|
+
# Correct comparison for Points - same if same x and y
|
8
|
+
def ==(other)
|
9
|
+
unless other.kind_of?(Wx::Point)
|
10
|
+
Kernel.raise TypeError, "Cannot compare Point to #{other}"
|
11
|
+
end
|
12
|
+
x == other.x and y == other.y
|
13
|
+
end
|
14
|
+
|
7
15
|
# Return a new Wx::Point with the x and y parameters both divided by
|
8
16
|
# parameter +div+, which should be a Numeric
|
9
17
|
def /(div)
|
data/lib/wx/classes/rect.rb
CHANGED
@@ -4,7 +4,16 @@ class Wx::Rect
|
|
4
4
|
def to_s
|
5
5
|
"#<Wx::Rect: (#{get_left}, #{get_top}) (#{get_right}, #{get_bottom})>"
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
|
+
# Correct comparison for Wx::Rect, are the same if have the same
|
9
|
+
# position and the same size
|
10
|
+
def ==(other)
|
11
|
+
unless other.kind_of?(Wx::Rect)
|
12
|
+
Kernel.raise TypeError, "Cannot compare Rect to #{other}"
|
13
|
+
end
|
14
|
+
get_left == other.get_left and get_top == other.get_top and
|
15
|
+
get_right = other.get_right and get_bottom == other.get_bottom
|
16
|
+
end
|
8
17
|
# More ruby-ish names
|
9
18
|
alias :contains? :contains
|
10
19
|
end
|
@@ -38,4 +38,26 @@ class Wx::RichTextCtrl
|
|
38
38
|
Kernel.raise RuntimeError, "Could not retrieve style at position #{pos}"
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
# Fix to accept a single +pos+ argument and return a Wx::Rect
|
43
|
+
wx_car_pos_for_index = self.instance_method(:get_caret_position_for_index)
|
44
|
+
define_method(:get_caret_position_for_index) do | pos |
|
45
|
+
rect = Wx::Rect.new
|
46
|
+
if wx_car_pos_for_index.bind(self).call(pos, rect)
|
47
|
+
return rect
|
48
|
+
else
|
49
|
+
Kernel.raise RuntimeError, "Could not rect for position #{pos}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Fix to return a pair of col, row values
|
54
|
+
wx_pos_to_xy = self.instance_method(:position_to_xy)
|
55
|
+
define_method(:position_to_xy) do | pos |
|
56
|
+
success, x, y = wx_pos_to_xy.bind(self).call(pos)
|
57
|
+
if success
|
58
|
+
return x, y
|
59
|
+
else
|
60
|
+
Kernel.raise RuntimeError, "Could not convert position #{pos} to x, y"
|
61
|
+
end
|
62
|
+
end
|
41
63
|
end
|
data/lib/wx/classes/size.rb
CHANGED
@@ -1,8 +1,17 @@
|
|
1
1
|
class Wx::Size
|
2
|
+
# More informative output for inspect etc
|
2
3
|
def to_s
|
3
4
|
"#<Wx::Size: (#{get_width}, #{get_height})>"
|
4
5
|
end
|
5
6
|
|
7
|
+
# Compare with another size
|
8
|
+
def ==(other)
|
9
|
+
unless other.kind_of?(Wx::Size)
|
10
|
+
Kernel.raise TypeError, "Cannot compare Size to #{other}"
|
11
|
+
end
|
12
|
+
get_x == other.get_x and get_y == other.get_y
|
13
|
+
end
|
14
|
+
|
6
15
|
# Return a new Wx::Size with the width and height values both divided
|
7
16
|
# by parameter +div+, which should be a Numeric
|
8
17
|
def /(div)
|
data/lib/wx/classes/sizer.rb
CHANGED
@@ -11,12 +11,27 @@ class Wx::Sizer
|
|
11
11
|
def add_item(item, *mixed_args)
|
12
12
|
args = Wx::args_as_list(ADD_ITEM_PARAMS, *mixed_args)
|
13
13
|
|
14
|
-
|
14
|
+
full_args = []
|
15
|
+
|
16
|
+
# extract the width and the height in the case of a spacer
|
17
|
+
# defined as an array
|
18
|
+
if item.kind_of?(Array)
|
19
|
+
Kernel.raise ArgumentError,
|
20
|
+
"Invalid Sizer specification : [width, height] expected" if item.size != 2
|
21
|
+
full_args << item[0] << item[1]
|
22
|
+
else
|
23
|
+
full_args << item
|
24
|
+
end
|
25
|
+
|
26
|
+
# update the full arguments list with the optional arguments (except index)
|
15
27
|
idx = args.shift
|
28
|
+
full_args.concat(args)
|
29
|
+
|
30
|
+
# Call add to append if default position
|
16
31
|
if idx == -1
|
17
|
-
add(
|
32
|
+
add(*full_args)
|
18
33
|
else
|
19
|
-
insert(idx,
|
34
|
+
insert(idx, *full_args)
|
20
35
|
end
|
21
36
|
end
|
22
37
|
end
|
data/lib/wx/classes/toolbar.rb
CHANGED
@@ -5,21 +5,19 @@ class Wx::ToolBar
|
|
5
5
|
ADD_ITEM_PARAMS = [ Wx::Parameter[ :position, -1 ],
|
6
6
|
Wx::Parameter[ :id, -1 ],
|
7
7
|
Wx::Parameter[ :label, "" ],
|
8
|
-
Wx::Parameter[ :bitmap, Wx::NULL_BITMAP ],
|
9
8
|
Wx::Parameter[ :bitmap2, Wx::NULL_BITMAP ],
|
10
9
|
Wx::Parameter[ :kind, Wx::ITEM_NORMAL ],
|
11
10
|
Wx::Parameter[ :short_help, "" ],
|
12
11
|
Wx::Parameter[ :long_help, "" ],
|
13
12
|
Wx::Parameter[ :client_data, nil ] ]
|
14
13
|
|
15
|
-
def add_item(*mixed_args)
|
14
|
+
def add_item(bitmap, *mixed_args)
|
16
15
|
args = Wx::args_as_list(ADD_ITEM_PARAMS, *mixed_args)
|
17
|
-
if args[3] == Wx::NULL_BITMAP
|
18
|
-
Kernel.raise ArgumentError, "Main button bitmap may not be NULL"
|
19
|
-
end
|
20
16
|
|
21
|
-
# Call add_tool to append if default position
|
22
17
|
pos = args.shift
|
18
|
+
args.insert(2, bitmap)
|
19
|
+
|
20
|
+
# Call add_tool to append if default position
|
23
21
|
if pos == -1
|
24
22
|
add_tool(*args)
|
25
23
|
else
|
data/lib/wx/classes/window.rb
CHANGED
@@ -11,6 +11,13 @@ class Wx::Window
|
|
11
11
|
# In case a more explicit option is preferred.
|
12
12
|
alias :wx_id :get_id
|
13
13
|
|
14
|
+
# The name of Wx::Window#raise conflicts with Ruby's core Kernel#raise
|
15
|
+
# method. This can cause unexpected errors when undecorated #raise is
|
16
|
+
# used inside a Window method. For wxRuby 2.0 it's too late to remove
|
17
|
+
# Window#raise completely, but for now, offer alternatives to
|
18
|
+
# raise/lower that could replace them in future versions.
|
19
|
+
alias :bring_to_front :raise
|
20
|
+
alias :send_to_back :lower
|
14
21
|
|
15
22
|
# Recursively searches all windows below +self+ and returns the first
|
16
23
|
# window which has the id +an_id+. This corresponds to the find_window
|
@@ -34,4 +34,21 @@ class Wx::XmlResource
|
|
34
34
|
end
|
35
35
|
fname
|
36
36
|
end
|
37
|
+
|
38
|
+
# Returns a Wx::Wizard object from the element named +name+ in the
|
39
|
+
# loaded XRC file. The Wizard will have the parent +parent+.
|
40
|
+
#
|
41
|
+
# This method is not available in wxWidgets, but is here for
|
42
|
+
# completeness and also to document how to use load_object (see
|
43
|
+
# below).
|
44
|
+
def load_wizard(parent, name)
|
45
|
+
wiz = Wx::Wizard.new()
|
46
|
+
load_wizard_subclass(wiz, parent, name)
|
47
|
+
wiz
|
48
|
+
end
|
49
|
+
|
50
|
+
# Completes the loading of a incomplete instance of Wx::Wizard.
|
51
|
+
def load_wizard_subclass(wizard, parent, name)
|
52
|
+
load_object(wizard, parent, name, "wxWizard")
|
53
|
+
end
|
37
54
|
end
|
data/lib/wx/helpers.rb
CHANGED
@@ -8,7 +8,6 @@ module Wx
|
|
8
8
|
# structs containing the keyword name and default value for each
|
9
9
|
# possible argument. +mixed_args+ is an array which may optionally end
|
10
10
|
# with a set of named arguments
|
11
|
-
|
12
11
|
def self.args_as_list(param_spec, *mixed_args)
|
13
12
|
# get keyword arguments from mixed args if supplied, else empty
|
14
13
|
kwa = mixed_args.last.kind_of?(Hash) ? mixed_args.pop : {}
|
@@ -27,4 +26,20 @@ module Wx
|
|
27
26
|
Kernel.raise ArgumentError,
|
28
27
|
"Bad arg composition of #{mixed_args.inspect}"
|
29
28
|
end
|
29
|
+
|
30
|
+
# Given an integer constant +int_const+, returns an array Wx constant
|
31
|
+
# names which have this value. If a string +prefix+ is supplied, find
|
32
|
+
# only constants whose names begin with this prefix. For example,
|
33
|
+
# passing "EVT" would return only constants with a name like
|
34
|
+
# Wx::EVT_XXX
|
35
|
+
#
|
36
|
+
# This is primarily useful for debugging, when an unknown constant is
|
37
|
+
# returned, eg as an event type id.
|
38
|
+
def self.find_const(sought, prefix = "")
|
39
|
+
consts = constants.grep(/\A#{prefix}/)
|
40
|
+
consts.find_all do | c |
|
41
|
+
c_val = const_get(c)
|
42
|
+
c_val.instance_of?(Fixnum) and c_val == sought
|
43
|
+
end
|
44
|
+
end
|
30
45
|
end
|
data/lib/wx/keyword_ctors.rb
CHANGED
@@ -122,8 +122,9 @@ module Wx
|
|
122
122
|
# API constructor
|
123
123
|
def wx_ctor_params(*params)
|
124
124
|
self.param_spec += params.map do | param |
|
125
|
-
param.kind_of?(Hash) ?
|
126
|
-
Parameter[param,
|
125
|
+
param.kind_of?(Hash) ?
|
126
|
+
Parameter[ param.keys.first, param.values.first ] :
|
127
|
+
Parameter[ param, STANDARD_DEFAULTS[param] ]
|
127
128
|
end
|
128
129
|
end
|
129
130
|
|
data/lib/wx/keyword_defs.rb
CHANGED
@@ -156,19 +156,29 @@ Wx::define_keyword_ctors('ToolBarTool') do
|
|
156
156
|
wx_ctor_params :long_help => ''
|
157
157
|
end
|
158
158
|
|
159
|
+
# Similar to notebook but using choice control
|
160
|
+
Wx::define_keyword_ctors('Choicebook') do
|
161
|
+
wx_ctor_params :id, :pos, :size, :style, :name => 'choiceBook'
|
162
|
+
end
|
163
|
+
|
159
164
|
# Notebook class
|
160
165
|
Wx::define_keyword_ctors('Notebook') do
|
161
166
|
wx_ctor_params :id, :pos, :size, :style, :name => 'noteBook'
|
162
167
|
end
|
163
168
|
|
164
|
-
# Similar to notebook but using list control
|
169
|
+
# Similar to notebook but using list control
|
165
170
|
Wx::define_keyword_ctors('Listbook') do
|
166
171
|
wx_ctor_params :id, :pos, :size, :style, :name => 'listBook'
|
167
172
|
end
|
168
173
|
|
169
|
-
# Similar to notebook but using
|
170
|
-
Wx::define_keyword_ctors('
|
171
|
-
wx_ctor_params :id, :pos, :size, :style, :name => '
|
174
|
+
# Similar to notebook but using toolbar
|
175
|
+
Wx::define_keyword_ctors('Toolbook') do
|
176
|
+
wx_ctor_params :id, :pos, :size, :style, :name => 'toolBook'
|
177
|
+
end
|
178
|
+
|
179
|
+
# Similar to notebook but using tree control
|
180
|
+
Wx::define_keyword_ctors('Treebook') do
|
181
|
+
wx_ctor_params :id, :pos, :size, :style, :name => 'treeBook'
|
172
182
|
end
|
173
183
|
|
174
184
|
# wxSashWindow: Window with four optional sashes that can be dragged
|
@@ -268,7 +278,6 @@ Wx::define_keyword_ctors('PrintDialog') do
|
|
268
278
|
wx_ctor_params :data
|
269
279
|
end
|
270
280
|
|
271
|
-
|
272
281
|
# Simple message box dialog
|
273
282
|
Wx::define_keyword_ctors('MessageDialog') do
|
274
283
|
wx_ctor_params :message => ''
|
@@ -277,6 +286,13 @@ Wx::define_keyword_ctors('MessageDialog') do
|
|
277
286
|
wx_ctor_params :pos
|
278
287
|
end
|
279
288
|
|
289
|
+
# Property editing dialog
|
290
|
+
Wx::define_keyword_ctors('PropertySheetDialog') do
|
291
|
+
wx_ctor_params :id, :title
|
292
|
+
wx_ctor_params :pos, :size, :style => Wx::DEFAULT_DIALOG_STYLE
|
293
|
+
wx_ctor_params :name => 'propertySheetDialog'
|
294
|
+
end
|
295
|
+
|
280
296
|
### CONTROLS
|
281
297
|
|
282
298
|
# Push button control, displaying text
|
@@ -517,6 +533,11 @@ Wx::define_keyword_ctors('HtmlListBox') do
|
|
517
533
|
wx_ctor_params :id, :pos, :size, :style, :name => 'HtmlListBoxNameStr'
|
518
534
|
end
|
519
535
|
|
536
|
+
Wx::define_keyword_ctors('DatePickerCtrl') do
|
537
|
+
wx_ctor_params :id, :dt => Time.now
|
538
|
+
wx_ctor_params :pos, :size, :style, :validator, :name => 'dateCtrl'
|
539
|
+
end
|
540
|
+
|
520
541
|
Wx::define_keyword_ctors('RichTextCtrl') do
|
521
542
|
wx_ctor_params :id, :value => ''
|
522
543
|
wx_ctor_params :pos, :size, :style => Wx::TE_MULTILINE
|
@@ -531,6 +552,7 @@ Wx::define_keyword_ctors('RichTextStyleListCtrl') do
|
|
531
552
|
wx_ctor_params :id, :pos, :size, :style
|
532
553
|
end
|
533
554
|
|
555
|
+
|
534
556
|
# FIXME - SymbolPickerDialog is hard to because the parent argument is
|
535
557
|
# in a strange place.
|
536
558
|
|
data/lib/wx/version.rb
CHANGED
data/lib/wxruby2.so
CHANGED
Binary file
|
data/samples/SAMPLES-LICENSE.TXT
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
wxRuby2 Sample Code
|
2
|
-
Copyright (c) 2004-2006 Kevin B. Smith
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
a copy of this software, to deal in the Software without restriction,
|
6
|
-
including without limitation the rights to use, copy, modify, merge,
|
7
|
-
publish, distribute, sublicense, and/or sell copies of any portion of
|
8
|
-
this Software, and to permit persons to whom the Software is furnished
|
9
|
-
to do so. This copyright notice need not be retained in any derived
|
10
|
-
work.
|
11
|
-
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
13
|
-
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
15
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
16
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
17
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
1
|
+
wxRuby2 Sample Code
|
2
|
+
Copyright (c) 2004-2006 Kevin B. Smith
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
a copy of this software, to deal in the Software without restriction,
|
6
|
+
including without limitation the rights to use, copy, modify, merge,
|
7
|
+
publish, distribute, sublicense, and/or sell copies of any portion of
|
8
|
+
this Software, and to permit persons to whom the Software is furnished
|
9
|
+
to do so. This copyright notice need not be retained in any derived
|
10
|
+
work.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
13
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
15
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
16
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
17
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
18
18
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/samples/bigdemo/About.rbw
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
module About
|
2
|
-
|
3
|
-
class MyAboutBox < Wx::Dialog
|
4
|
-
def initialize(parent)
|
5
|
-
super(parent, -1, "About the WxRuby Demo.")
|
6
|
-
sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
7
|
-
set_size(Wx::Size.new(510,310))
|
8
|
-
headerFont = Wx::Font.new(36, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
|
9
|
-
bodyFont = Wx::Font.new(12, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
|
10
|
-
title = Wx::StaticText.new(self, -1, "WxRuby Demo!", Wx::Point.new(20, 20))
|
11
|
-
title.set_font(headerFont)
|
12
|
-
|
13
|
-
rVersion = Wx::StaticText.new(self, -1, "Running on Ruby version " +
|
14
|
-
rVersion.set_font(bodyFont)
|
15
|
-
rVersion.set_foreground_colour(Wx::RED)
|
16
|
-
|
17
|
-
wxVersion = Wx::StaticText.new(self, -1, Wx::VERSION_STRING, Wx::Point.new(20,120))
|
18
|
-
wxVersion.set_font(bodyFont)
|
19
|
-
wxVersion.set_foreground_colour(Wx::BLUE)
|
20
|
-
|
21
|
-
str = "Welcome to the WxRuby Demo! This demo has been ported from the \nwxPython demo created by ROBIN DUNN (http://www.wxpython.org).\nGo ahead and click on each demo via the tree or the demo menu.\nLook at the source code - it is an excellent way to learn WxRuby!\n\nPorted by Robert Paul Carlin"
|
22
|
-
body = Wx::StaticText.new(self, -1, str, Wx::Point.new(20, 160))
|
23
|
-
body.set_font(bodyFont)
|
24
|
-
|
25
|
-
self.centre_on_parent(Wx::BOTH)
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
if __FILE__ == $0
|
36
|
-
run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
|
37
|
-
load run_solo_lib
|
38
|
-
run File.basename($0)
|
39
|
-
end
|
1
|
+
module About
|
2
|
+
|
3
|
+
class MyAboutBox < Wx::Dialog
|
4
|
+
def initialize(parent)
|
5
|
+
super(parent, -1, "About the WxRuby Demo.")
|
6
|
+
sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
7
|
+
set_size(Wx::Size.new(510,310))
|
8
|
+
headerFont = Wx::Font.new(36, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
|
9
|
+
bodyFont = Wx::Font.new(12, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
|
10
|
+
title = Wx::StaticText.new(self, -1, "WxRuby Demo!", Wx::Point.new(20, 20))
|
11
|
+
title.set_font(headerFont)
|
12
|
+
|
13
|
+
rVersion = Wx::StaticText.new(self, -1, "Running on Ruby version " + RUBY_VERSION + " on " + RUBY_PLATFORM, Wx::Point.new(20,100))
|
14
|
+
rVersion.set_font(bodyFont)
|
15
|
+
rVersion.set_foreground_colour(Wx::RED)
|
16
|
+
|
17
|
+
wxVersion = Wx::StaticText.new(self, -1, Wx::VERSION_STRING, Wx::Point.new(20,120))
|
18
|
+
wxVersion.set_font(bodyFont)
|
19
|
+
wxVersion.set_foreground_colour(Wx::BLUE)
|
20
|
+
|
21
|
+
str = "Welcome to the WxRuby Demo! This demo has been ported from the \nwxPython demo created by ROBIN DUNN (http://www.wxpython.org).\nGo ahead and click on each demo via the tree or the demo menu.\nLook at the source code - it is an excellent way to learn WxRuby!\n\nPorted by Robert Paul Carlin"
|
22
|
+
body = Wx::StaticText.new(self, -1, str, Wx::Point.new(20, 160))
|
23
|
+
body.set_font(bodyFont)
|
24
|
+
|
25
|
+
self.centre_on_parent(Wx::BOTH)
|
26
|
+
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
if __FILE__ == $0
|
36
|
+
run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
|
37
|
+
load run_solo_lib
|
38
|
+
run File.basename($0)
|
39
|
+
end
|
@@ -1,23 +1,23 @@
|
|
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
|
-
|
11
|
-
|
12
|
-
class ColoredPanel < Wx::Window
|
13
|
-
def initialize(parent, color)
|
14
|
-
super(parent, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::SIMPLE_BORDER)
|
15
|
-
set_background_colour(color)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
if __FILE__ == $0
|
20
|
-
run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
|
21
|
-
load run_solo_lib
|
22
|
-
run File.basename($0)
|
23
|
-
end
|
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
|
+
|
11
|
+
|
12
|
+
class ColoredPanel < Wx::Window
|
13
|
+
def initialize(parent, color)
|
14
|
+
super(parent, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::SIMPLE_BORDER)
|
15
|
+
set_background_colour(color)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
if __FILE__ == $0
|
20
|
+
run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
|
21
|
+
load run_solo_lib
|
22
|
+
run File.basename($0)
|
23
|
+
end
|