wxruby 1.9.9-x86-mswin32-60 → 1.9.10-x86-mswin32-60
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/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.exp +0 -0
- data/lib/wxruby2.lib +0 -0
- data/lib/wxruby2.so +0 -0
- data/samples/bigdemo/About.rbw +1 -1
- data/samples/bigdemo/wxCheckListBox.rbw +40 -50
- data/samples/bigdemo/wxListCtrl_virtual.rbw +8 -3
- data/samples/bigdemo/wxSashWindow.rbw +2 -2
- data/samples/bigdemo/wxTreeCtrl.rbw +4 -3
- data/samples/calendar/calendar.rb +143 -158
- data/samples/dialogs/dialogs.rb +74 -0
- data/samples/etc/toolbar_sizer_additem.rb +55 -0
- data/samples/event/update_ui_event.rb +70 -0
- data/samples/grid/gridtablebase.rb +43 -29
- data/samples/mdi/mdi.rb +22 -14
- data/samples/minimal/minimal.rb +3 -3
- 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 +0 -2
- data/samples/treectrl/treectrl.rb +10 -18
- data/samples/xrc/xrc_sample.rb +48 -68
- metadata +14 -2
data/samples/text/textctrl.rb
CHANGED
@@ -679,6 +679,7 @@ end
|
|
679
679
|
class MyFrame < Wx::Frame
|
680
680
|
def initialize(title, x, y, w, h)
|
681
681
|
super( nil, :title => title, :pos => [ x, y ], :size => [ w, h ] )
|
682
|
+
@splitter = nil
|
682
683
|
@treectrl = nil
|
683
684
|
@textctrl = nil
|
684
685
|
@s_num = 0
|
@@ -772,9 +773,11 @@ class MyFrame < Wx::Frame
|
|
772
773
|
menu_bar.append(item_menu, "&Item")
|
773
774
|
self.menu_bar = menu_bar
|
774
775
|
|
776
|
+
@splitter = Wx::SplitterWindow.new(self, :style => Wx::SP_BORDER)
|
777
|
+
@splitter.minimum_pane_size = 100
|
775
778
|
|
776
779
|
# create the controls
|
777
|
-
@textctrl = Wx::TextCtrl.new(
|
780
|
+
@textctrl = Wx::TextCtrl.new( @splitter,
|
778
781
|
:text => '',
|
779
782
|
:style => Wx::TE_MULTILINE|Wx::SUNKEN_BORDER)
|
780
783
|
|
@@ -789,8 +792,9 @@ class MyFrame < Wx::Frame
|
|
789
792
|
# set our text control as the log target
|
790
793
|
logWindow = Wx::LogTextCtrl.new(@textctrl)
|
791
794
|
Wx::Log::active_target = logWindow
|
795
|
+
|
796
|
+
@splitter.split_horizontally(@treectrl, @textctrl, 500)
|
792
797
|
|
793
|
-
evt_size :on_size
|
794
798
|
evt_close :on_close
|
795
799
|
|
796
800
|
evt_menu Wx::ID_EXIT, :on_quit
|
@@ -859,18 +863,18 @@ class MyFrame < Wx::Frame
|
|
859
863
|
end
|
860
864
|
|
861
865
|
def create_tree(style)
|
862
|
-
@treectrl = MyTreeCtrl.new(
|
863
|
-
resize
|
866
|
+
@treectrl = MyTreeCtrl.new(@splitter, :style => style)
|
864
867
|
end
|
865
868
|
|
866
869
|
def tog_style(id,flag)
|
867
|
-
|
868
870
|
style = @treectrl.window_style_flag ^ flag
|
869
871
|
|
870
872
|
# most treectrl styles can't be changed on the fly using the native
|
871
873
|
# control and the tree must be recreated
|
872
|
-
@treectrl
|
874
|
+
old_tree = @treectrl
|
873
875
|
create_tree(style)
|
876
|
+
@splitter.replace_window old_tree, @treectrl
|
877
|
+
old_tree.destroy
|
874
878
|
menu_bar.check(id, (style & flag) != 0)
|
875
879
|
end
|
876
880
|
|
@@ -926,18 +930,6 @@ class MyFrame < Wx::Frame
|
|
926
930
|
do_sort(true)
|
927
931
|
end
|
928
932
|
|
929
|
-
def on_size(event)
|
930
|
-
if @treectrl && @textctrl
|
931
|
-
resize
|
932
|
-
end
|
933
|
-
event.skip
|
934
|
-
end
|
935
|
-
|
936
|
-
def resize
|
937
|
-
my_size = self.client_size
|
938
|
-
@treectrl.size = [ my_size.x, 2 * my_size.y / 3 ]
|
939
|
-
end
|
940
|
-
|
941
933
|
def on_close(event)
|
942
934
|
Wx::Log::active_target = nil
|
943
935
|
destroy
|
data/samples/xrc/xrc_sample.rb
CHANGED
@@ -9,88 +9,68 @@ require 'wx'
|
|
9
9
|
|
10
10
|
# Basic Frame Class. This creates the dialog window
|
11
11
|
class SimpleFrame < Wx::Frame
|
12
|
+
def initialize()
|
13
|
+
super nil, :title => "Sample", :position => [50, 50], :size => [300, 300]
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
def initialize()
|
16
|
-
super(nil,-1,"Sample",Wx::Point.new(50,50),Wx::Size.new(300,300))
|
17
|
-
txt = "Choose 'Open Dialog' from the menu to see a dialog made with XRC"
|
18
|
-
Wx::StaticText.new( self, -1, txt, Wx::Point.new(10, 10) )
|
15
|
+
txt = "Choose 'Open Dialog' from the menu to see a dialog made with XRC"
|
16
|
+
Wx::StaticText.new self, :label => txt, :position => [20, 20]
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
#
|
32
|
-
evt_menu(FILE_DIALOG) do
|
33
|
-
SimpleDialog.new(self).show_modal()
|
34
|
-
end
|
35
|
-
|
36
|
-
evt_menu(Wx::ID_EXIT) do
|
37
|
-
puts Wx::get_app.get_app_name
|
38
|
-
Wx::get_app.exit_main_loop()
|
39
|
-
end
|
40
|
-
|
41
|
-
evt_close() do
|
42
|
-
Wx::get_app.exit_main_loop()
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
18
|
+
# Create a new menu
|
19
|
+
self.menu_bar = Wx::MenuBar.new
|
20
|
+
menu = Wx::Menu.new
|
21
|
+
menu.append Wx::ID_OPEN, "Open Dialog"
|
22
|
+
menu.append Wx::ID_EXIT, "Quit"
|
23
|
+
menu_bar.append(menu,"File")
|
24
|
+
|
25
|
+
# Assign the menu events
|
26
|
+
evt_menu(Wx::ID_OPEN) { SimpleDialog.new(self).show_modal }
|
27
|
+
evt_menu(Wx::ID_EXIT) { close }
|
28
|
+
end
|
46
29
|
end
|
47
30
|
|
48
31
|
# Dialog subclass. The components within the dialog are loaded from XRC.
|
49
32
|
class SimpleDialog < Wx::Dialog
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
33
|
+
def initialize(parent)
|
34
|
+
# To load a layout defined in XRC into a Ruby subclass of Dialog,
|
35
|
+
# first call the empty constructor. All the details of size,
|
36
|
+
# title, position and so on are loaded from the XRC by the call to
|
37
|
+
# load_frame_subclass. Using a non-empty constructor will cause
|
38
|
+
# errors on GTK.
|
39
|
+
super()
|
40
|
+
|
41
|
+
# Load the dialog from XRC. We define $xml in on_init.
|
42
|
+
# We could use XmlResource.get() over and over again, but
|
43
|
+
# honestly, thats just too much work.
|
44
|
+
$xml.load_dialog_subclass(self,parent,'SAMPLE_DIALOG')
|
62
45
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
46
|
+
# Get the buttons. The xrcid method turns a string identifier
|
47
|
+
# used in an xml file into a numeric identifier as used in
|
48
|
+
# wxruby.
|
49
|
+
@ok = find_window_by_id( Wx::xrcid('wxID_OK') )
|
50
|
+
@cancel = find_window_by_id( Wx::xrcid('wxID_CANCEL') )
|
51
|
+
@message = find_window_by_id( Wx::xrcid('SAMPLE_MESSAGE') )
|
69
52
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
53
|
+
# Bind the buttons to event handlers
|
54
|
+
evt_button(@ok) { end_modal(Wx::ID_OK) }
|
55
|
+
evt_button(@cancel) { end_modal(Wx::ID_CANCEL) }
|
56
|
+
evt_button(@message) do
|
57
|
+
Wx::message_box("And now a message from our sponsors.")
|
58
|
+
end
|
59
|
+
end
|
77
60
|
end
|
78
61
|
|
79
|
-
#
|
80
62
|
# Application class.
|
81
|
-
#
|
82
63
|
class XrcApp < Wx::App
|
83
64
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
# Show the main frame.
|
90
|
-
main = SimpleFrame.new()
|
91
|
-
main.show(true)
|
92
|
-
end
|
65
|
+
def on_init
|
66
|
+
# Get a new resources object
|
67
|
+
xrc_file = File.join( File.dirname(__FILE__), 'samples.xrc' )
|
68
|
+
$xml = Wx::XmlResource.new(xrc_file)
|
93
69
|
|
70
|
+
# Show the main frame.
|
71
|
+
main = SimpleFrame.new()
|
72
|
+
main.show(true)
|
73
|
+
end
|
94
74
|
end
|
95
75
|
|
96
76
|
XrcApp.new.main_loop()
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wxruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.10
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- wxRuby development team
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-04 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -40,13 +40,18 @@ files:
|
|
40
40
|
- lib/wx/classes/combobox.rb
|
41
41
|
- lib/wx/classes/commandevent.rb
|
42
42
|
- lib/wx/classes/controlwithitems.rb
|
43
|
+
- lib/wx/classes/dataformat.rb
|
44
|
+
- lib/wx/classes/data_object.rb
|
45
|
+
- lib/wx/classes/data_object_simple.rb
|
43
46
|
- lib/wx/classes/dc.rb
|
44
47
|
- lib/wx/classes/event.rb
|
45
48
|
- lib/wx/classes/evthandler.rb
|
46
49
|
- lib/wx/classes/font.rb
|
47
50
|
- lib/wx/classes/functions.rb
|
48
51
|
- lib/wx/classes/gauge.rb
|
52
|
+
- lib/wx/classes/genericdirctrl.rb
|
49
53
|
- lib/wx/classes/grid.rb
|
54
|
+
- lib/wx/classes/hboxsizer.rb
|
50
55
|
- lib/wx/classes/helpcontroller.rb
|
51
56
|
- lib/wx/classes/helpcontrollerhelpprovider.rb
|
52
57
|
- lib/wx/classes/helpprovider.rb
|
@@ -81,6 +86,7 @@ files:
|
|
81
86
|
- lib/wx/classes/toolbar.rb
|
82
87
|
- lib/wx/classes/toolbartool.rb
|
83
88
|
- lib/wx/classes/treectrl.rb
|
89
|
+
- lib/wx/classes/vboxsizer.rb
|
84
90
|
- lib/wx/classes/window.rb
|
85
91
|
- lib/wx/classes/xmlresource.rb
|
86
92
|
- lib/wx/helpers.rb
|
@@ -243,9 +249,11 @@ files:
|
|
243
249
|
- samples/etc/scrollwin.rb
|
244
250
|
- samples/etc/system_settings.rb
|
245
251
|
- samples/etc/threaded.rb
|
252
|
+
- samples/etc/toolbar_sizer_additem.rb
|
246
253
|
- samples/etc/wizard.rb
|
247
254
|
- samples/event
|
248
255
|
- samples/event/event.rb
|
256
|
+
- samples/event/update_ui_event.rb
|
249
257
|
- samples/grid
|
250
258
|
- samples/grid/grid.rb
|
251
259
|
- samples/grid/gridtablebase.rb
|
@@ -279,8 +287,12 @@ files:
|
|
279
287
|
- samples/sockets/wxServer.rb
|
280
288
|
- samples/sockets/wxSocketGUI.rb
|
281
289
|
- samples/text
|
290
|
+
- samples/text/format-text-bold.png
|
291
|
+
- samples/text/format-text-italic.png
|
292
|
+
- samples/text/format-text-underline.png
|
282
293
|
- samples/text/mondrian.ico
|
283
294
|
- samples/text/mondrian.xpm
|
295
|
+
- samples/text/rich_textctrl.rb
|
284
296
|
- samples/text/scintilla.rb
|
285
297
|
- samples/text/textctrl.rb
|
286
298
|
- samples/text/unicode.rb
|