wxruby 1.9.1-i386-mswin32 → 1.9.2-i386-mswin32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +53 -0
- data/README +299 -0
- data/lib/wx/classes/app.rb +15 -1
- data/lib/wx/classes/bitmap.rb +2 -2
- data/lib/wx/classes/checklistbox.rb +30 -0
- data/lib/wx/classes/clientdc.rb +1 -1
- data/lib/wx/classes/commandevent.rb +7 -0
- data/lib/wx/classes/controlwithitems.rb +10 -0
- data/lib/wx/classes/evthandler.rb +63 -7
- data/lib/wx/classes/listctrl.rb +9 -0
- data/lib/wx/classes/menu.rb +62 -0
- data/lib/wx/classes/menuitem.rb +7 -0
- data/lib/wx/classes/paintdc.rb +1 -1
- data/lib/wx/classes/timer.rb +2 -2
- data/lib/wx/classes/treectrl.rb +18 -0
- data/lib/wx/classes/window.rb +11 -4
- data/lib/wx/keyword_ctors.rb +1 -15
- data/lib/wx/keyword_defs.rb +68 -58
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby2.so +0 -0
- data/samples/bigdemo/wxScrolledWindow.rbw +8 -3
- data/samples/calendar/calendar.rb +1 -1
- data/samples/caret/caret.rb +29 -39
- data/samples/etc/threaded.rb +81 -0
- data/samples/etc/wizard.rb +22 -24
- data/samples/html/html.rb +25 -12
- data/samples/listbook/listbook.rb +65 -67
- data/samples/minimal/minimal.rb +38 -36
- data/samples/minimal/mondrian.ico +0 -0
- data/samples/minimal/nothing.rb +5 -30
- data/samples/treectrl/treectrl.rb +197 -226
- metadata +16 -7
- data/lib/wxruby2.exp +0 -0
- data/lib/wxruby2.lib +0 -0
- data/samples/minimal/text.rb +0 -35
data/samples/minimal/minimal.rb
CHANGED
@@ -13,35 +13,45 @@ rescue LoadError => no_wx_err
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
#
|
16
|
+
# This sample shows a fairly minimal Wx::App using a Frame, with a
|
17
|
+
# MenuBar and StatusBar but no controls. For the absolute minimum app,
|
18
|
+
# see nothing.rb
|
19
|
+
|
20
|
+
# A Wx::Frame is a self-contained, top-level Window that can contain
|
21
|
+
# controls, menubars, and statusbars
|
17
22
|
class MinimalFrame < Wx::Frame
|
18
23
|
def initialize(title)
|
19
|
-
|
20
|
-
# A main application frame has no parent (nil)
|
24
|
+
# The main application frame has no parent (nil)
|
21
25
|
super(nil, :title => title, :size => [ 400, 300 ])
|
22
26
|
|
23
|
-
|
24
|
-
|
25
|
-
|
27
|
+
icon_file = File.join( File.dirname(__FILE__), "mondrian.png")
|
28
|
+
# PNG can be used on all platforms, but icon type must be specified
|
29
|
+
# to work on Windows; OS X doesn't have "Frame" icons.
|
30
|
+
self.icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_PNG)
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
# in the correct platform-specific place
|
31
|
-
menu_help.append(Wx::ID_ABOUT, "&About...\tF1", "Show about dialog")
|
32
|
+
menu_bar = Wx::MenuBar.new
|
33
|
+
# The "file" menu
|
34
|
+
menu_file = Wx::Menu.new
|
32
35
|
menu_file.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit this program")
|
33
|
-
menu_bar = Wx::MenuBar.new()
|
34
36
|
menu_bar.append(menu_file, "&File")
|
37
|
+
|
38
|
+
# The "help" menu
|
39
|
+
menu_help = Wx::Menu.new
|
40
|
+
# Using Wx::ID_ABOUT default id means the menu item will be placed
|
41
|
+
# in the correct platform-specific place - eg on OS X
|
42
|
+
menu_help.append(Wx::ID_ABOUT, "&About...\tF1", "Show about dialog")
|
35
43
|
menu_bar.append(menu_help, "&Help")
|
36
|
-
# Assign the menus to this frame
|
37
|
-
set_menu_bar(menu_bar)
|
38
44
|
|
45
|
+
# Assign the menubar to this frame
|
46
|
+
self.menu_bar = menu_bar
|
47
|
+
|
48
|
+
# Create a status bar
|
39
49
|
create_status_bar(2)
|
40
|
-
|
50
|
+
self.status_text = "Welcome to wxRuby!"
|
41
51
|
|
42
|
-
# handle menu events
|
43
|
-
evt_menu
|
44
|
-
evt_menu
|
52
|
+
# Set it up to handle menu events using the relevant methods
|
53
|
+
evt_menu Wx::ID_EXIT, :on_quit
|
54
|
+
evt_menu Wx::ID_ABOUT, :on_about
|
45
55
|
end
|
46
56
|
|
47
57
|
# End the application; it should finish automatically when the last
|
@@ -58,26 +68,18 @@ class MinimalFrame < Wx::Frame
|
|
58
68
|
# create a simple message dialog with OK button
|
59
69
|
about_dlg = Wx::MessageDialog.new( self, msg, 'About Minimal',
|
60
70
|
Wx::OK|Wx::ICON_INFORMATION )
|
71
|
+
# Display the dialog on top of and blocking other windows, until
|
72
|
+
# dismissed by clicking the 'OK' button
|
61
73
|
about_dlg.show_modal
|
62
74
|
end
|
63
75
|
end
|
64
76
|
|
65
|
-
# Wx::App is the container class for any wxruby app
|
66
|
-
#
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
# This is required,
|
74
|
-
frame.show
|
75
|
-
# on_init must return a true value else the app will not start
|
76
|
-
true
|
77
|
-
end
|
77
|
+
# Wx::App is the container class for any wxruby app. To start an
|
78
|
+
# application, either define a subclass of Wx::App, create an instance,
|
79
|
+
# and call its main_loop method, OR, simply call the Wx::App.run class
|
80
|
+
# method, as shown here.
|
81
|
+
Wx::App.run do
|
82
|
+
self.app_name = 'Minimal'
|
83
|
+
frame = MinimalFrame.new("Minimal wxRuby App")
|
84
|
+
frame.show
|
78
85
|
end
|
79
|
-
|
80
|
-
# Create an instance ...
|
81
|
-
app = MinimalApp.new
|
82
|
-
# ... and run the application
|
83
|
-
app.main_loop()
|
Binary file
|
data/samples/minimal/nothing.rb
CHANGED
@@ -13,34 +13,9 @@ rescue LoadError => no_wx_err
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
# This is the minimum code to start a WxRuby app - create a Frame, and
|
17
|
+
# show it.
|
18
|
+
Wx::App.run do
|
19
|
+
frame = Wx::Frame.new(nil, :title => "Minimal wxRuby App")
|
20
|
+
frame.show
|
20
21
|
end
|
21
|
-
|
22
|
-
class NothingApp < Wx::App
|
23
|
-
def on_init
|
24
|
-
puts("in on_init")
|
25
|
-
$frame = MyFrame.new("Minimal wxRuby App")
|
26
|
-
puts("about to call show")
|
27
|
-
$frame.show
|
28
|
-
puts("returning from on_init")
|
29
|
-
return true
|
30
|
-
end
|
31
|
-
|
32
|
-
def on_fatal_exception
|
33
|
-
puts("on_fatal_exception")
|
34
|
-
end
|
35
|
-
|
36
|
-
def on_exit
|
37
|
-
puts("on_exit")
|
38
|
-
return super
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
a = NothingApp.new
|
43
|
-
a.main_loop()
|
44
|
-
puts("back from main_loop...")
|
45
|
-
GC.start
|
46
|
-
puts("survived gc")
|