wxruby 1.9.5-universal-darwin-9 → 1.9.6-universal-darwin-9
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.bundle +0 -0
- data/samples/aui/aui.rb +6 -10
- data/samples/bigdemo/About.rbw +0 -0
- 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/utils.rb +0 -0
- 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/controls/get_item_sample.rb +0 -0
- data/samples/dialogs/dialogs.rb +10 -11
- data/samples/drawing/graphics_drawing.rb +6 -7
- data/samples/drawing/images.rb +5 -10
- data/samples/drawing/paperclip.png +0 -0
- 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/mondrian.ico +0 -0
- data/samples/printing/mondrian.xpm +0 -0
- data/samples/printing/printing.rb +5 -179
- data/samples/text/mondrian.ico +0 -0
- data/samples/text/mondrian.xpm +0 -0
- 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 +11 -3
@@ -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
|
File without changes
|
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
|
|
@@ -0,0 +1,134 @@
|
|
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
|
+
# GridTableBase is an alternative way to provide data to a Wx::Grid. A
|
11
|
+
# subclass of Wx::GridTableBase is created which is reqiured to provide
|
12
|
+
# methods to report the total size of the Grid in rows and columns, and
|
13
|
+
# the contents and style of individual cells.
|
14
|
+
#
|
15
|
+
# Then, when creating the Grid, instead of calling create_grid and
|
16
|
+
# set_value to populate it, the GridTableBase-derived class is
|
17
|
+
# associated with the Grid, and provides these functions (see below)
|
18
|
+
#
|
19
|
+
# This approach is typically useful for dealing with very large sets of
|
20
|
+
# data, as each cell's value is only requested as it becomes visible.v
|
21
|
+
class MyGridTable < Wx::GridTableBase
|
22
|
+
attr_reader :cols, :rows
|
23
|
+
def initialize(rows, cols)
|
24
|
+
super()
|
25
|
+
@rows = rows
|
26
|
+
@cols = cols
|
27
|
+
@val = 'a'
|
28
|
+
end
|
29
|
+
|
30
|
+
# Firstly, a GridTableBase must indicate the size of the grid in
|
31
|
+
# terms of rows ...
|
32
|
+
def get_number_rows
|
33
|
+
@rows
|
34
|
+
end
|
35
|
+
|
36
|
+
# ... and columns
|
37
|
+
def get_number_cols
|
38
|
+
@cols
|
39
|
+
end
|
40
|
+
|
41
|
+
# Most importantly, it should be able to return any given cell's
|
42
|
+
# contents, given its row and column reference
|
43
|
+
def get_value(row, col)
|
44
|
+
"#{@val} - #{row}"
|
45
|
+
end
|
46
|
+
|
47
|
+
# It should also return the attributes that should apply to any given
|
48
|
+
# cell; this example give alternate rows red text letters
|
49
|
+
def get_attr(row, col, attr_kind)
|
50
|
+
attr = Wx::GridCellAttr.new
|
51
|
+
if (row % 2).zero?
|
52
|
+
attr.text_colour = Wx::RED
|
53
|
+
end
|
54
|
+
attr
|
55
|
+
end
|
56
|
+
|
57
|
+
# It should indicate whether any given cell is empty
|
58
|
+
def is_empty_cell(row, col)
|
59
|
+
false
|
60
|
+
end
|
61
|
+
|
62
|
+
# It may also provide labels for the columns and rows
|
63
|
+
def get_col_label_value(col)
|
64
|
+
"Col: #{col}"
|
65
|
+
end
|
66
|
+
|
67
|
+
# If the Grid is to support write as well as read operations,
|
68
|
+
# set_value should also be implemented. In this case, the change is
|
69
|
+
# merely echoed back and doesn't alter the underlying value; a real
|
70
|
+
# implementation could, for example, write back to a database
|
71
|
+
def set_value(x, y, val)
|
72
|
+
puts "Changing the value of cell (#{x}, #{y}) to '#{val}'"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# A derivative class illustrating that it is possible to change
|
77
|
+
# parameters of the GridTable and have the main control update.
|
78
|
+
class MyMutableGridTable < MyGridTable
|
79
|
+
def increment_value
|
80
|
+
@val = @val.succ
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
class GridFrame < Wx::Frame
|
86
|
+
def initialize()
|
87
|
+
super(nil, :title => 'GridTableBase demo')
|
88
|
+
main_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
89
|
+
# Create a grid and associate an instance of the GridTable as the
|
90
|
+
# data provider for the grid
|
91
|
+
@grid = Wx::Grid.new(self)
|
92
|
+
@grid.table = MyMutableGridTable.new(10, 10)
|
93
|
+
|
94
|
+
main_sizer.add(@grid, 1, Wx::EXPAND|Wx::ALL, 5)
|
95
|
+
|
96
|
+
# Add some buttons that can change the contents
|
97
|
+
butt_sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
98
|
+
|
99
|
+
butt_1 = Wx::Button.new(self, :label => "Add row")
|
100
|
+
# When resizing the grid to have a new number of rows or columns,
|
101
|
+
# need to allocate a new grid table source
|
102
|
+
evt_button(butt_1) do
|
103
|
+
@grid.table = MyMutableGridTable.new( @grid.table.rows + 1,
|
104
|
+
@grid.table.cols)
|
105
|
+
@grid.refresh
|
106
|
+
end
|
107
|
+
butt_sizer.add(butt_1)
|
108
|
+
|
109
|
+
butt_2 = Wx::Button.new(self, :label => "Add column")
|
110
|
+
evt_button(butt_2) do
|
111
|
+
@grid.table = MyMutableGridTable.new( @grid.table.rows,
|
112
|
+
@grid.table.cols + 1)
|
113
|
+
@grid.refresh
|
114
|
+
end
|
115
|
+
butt_sizer.add(butt_2)
|
116
|
+
|
117
|
+
# For other changes, can just change a value in the existing
|
118
|
+
# GridTable
|
119
|
+
butt_3 = Wx::Button.new(self, :label => "Increment letter")
|
120
|
+
evt_button(butt_3) do
|
121
|
+
@grid.table.increment_value
|
122
|
+
@grid.refresh
|
123
|
+
end
|
124
|
+
butt_sizer.add(butt_3)
|
125
|
+
|
126
|
+
main_sizer.add(butt_sizer, 0, Wx::EXPAND|Wx::ALL, 5)
|
127
|
+
self.sizer = main_sizer
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
Wx::App.run do
|
132
|
+
GridFrame.new.show
|
133
|
+
end
|
134
|
+
|
data/samples/html/html.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
|
require 'net/http'
|
17
11
|
require 'uri'
|
@@ -1,19 +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'
|
15
9
|
|
16
|
-
#
|
17
10
|
# Basic Frame Class. This creates the dialog window
|
18
11
|
#
|
19
12
|
class SimpleFrame < Wx::Frame
|