wxruby3 1.3.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +16 -12
- data/README.md +4 -3
- data/ext/wxruby3/include/wxRubyApp.h +9 -9
- data/ext/wxruby3/swig/custom/director.swg +11 -3
- data/ext/wxruby3/swig/custom/rubyapi.swg +15 -1
- data/ext/wxruby3/swig/mark_free_impl.i +47 -11
- data/ext/wxruby3/swig/wx.i +30 -12
- data/lib/wx/aui/auifloatframe.rb +1 -1
- data/lib/wx/aui/auimanager.rb +50 -14
- data/lib/wx/aui/auinotebook.rb +1 -1
- data/lib/wx/aui/require.rb +0 -2
- data/lib/wx/core/acceleratortable.rb +1 -1
- data/lib/wx/core/animation.rb +2 -2
- data/lib/wx/core/app.rb +1 -1
- data/lib/wx/core/array_ext.rb +1 -0
- data/lib/wx/core/artprovider.rb +4 -4
- data/lib/wx/core/bitmap.rb +1 -1
- data/lib/wx/core/bitmap_combobox.rb +2 -2
- data/lib/wx/core/brush.rb +8 -0
- data/lib/wx/core/clientdc.rb +1 -1
- data/lib/wx/core/clipboard.rb +4 -4
- data/lib/wx/core/colour.rb +1 -1
- data/lib/wx/core/combobox.rb +1 -1
- data/lib/wx/core/config.rb +7 -7
- data/lib/wx/core/controlwithitems.rb +3 -3
- data/lib/wx/core/data_object.rb +4 -4
- data/lib/wx/core/dataformat.rb +9 -3
- data/lib/wx/core/defs.rb +49 -0
- data/lib/wx/core/dialog.rb +3 -2
- data/lib/wx/core/enum.rb +16 -3
- data/lib/wx/core/event.rb +3 -3
- data/lib/wx/core/evthandler.rb +317 -289
- data/lib/wx/core/file_dialog.rb +1 -1
- data/lib/wx/core/find_replace_dialog.rb +2 -2
- data/lib/wx/core/font.rb +14 -0
- data/lib/wx/core/functions.rb +1 -1
- data/lib/wx/core/genericdirctrl.rb +1 -1
- data/lib/wx/core/geometry.rb +2 -2
- data/lib/wx/core/graphics_pen_info.rb +1 -1
- data/lib/wx/core/hboxsizer.rb +24 -4
- data/lib/wx/core/helpprovider.rb +1 -1
- data/lib/wx/core/icon.rb +1 -1
- data/lib/wx/core/image.rb +2 -2
- data/lib/wx/core/imagelist.rb +1 -1
- data/lib/wx/core/locale.rb +5 -5
- data/lib/wx/core/log.rb +8 -8
- data/lib/wx/core/menu.rb +3 -3
- data/lib/wx/core/module_ext.rb +16 -0
- data/lib/wx/core/owner_drawn_combobox.rb +3 -3
- data/lib/wx/core/pen.rb +20 -0
- data/lib/wx/core/pen_info.rb +1 -1
- data/lib/wx/core/persistence_manager.rb +2 -2
- data/lib/wx/core/real_point.rb +1 -0
- data/lib/wx/core/rect.rb +1 -1
- data/lib/wx/core/secret_store.rb +1 -1
- data/lib/wx/core/simplehelpprovider.rb +1 -1
- data/lib/wx/core/sizer.rb +166 -39
- data/lib/wx/core/splash_screen.rb +1 -1
- data/lib/wx/core/standard_paths.rb +1 -1
- data/lib/wx/core/task_bar_button.rb +1 -1
- data/lib/wx/core/text_entry.rb +1 -1
- data/lib/wx/core/textctrl.rb +2 -2
- data/lib/wx/core/timer.rb +2 -2
- data/lib/wx/core/tree_ctrl.rb +1 -1
- data/lib/wx/core/v_list_box.rb +1 -1
- data/lib/wx/core/validator.rb +2 -2
- data/lib/wx/core/variant.rb +2 -2
- data/lib/wx/core/vboxsizer.rb +24 -4
- data/lib/wx/core/window.rb +48 -2
- data/lib/wx/core/xmlresource.rb +4 -4
- data/lib/wx/core.rb +2 -0
- data/lib/wx/doc/array_ext.rb +1 -0
- data/lib/wx/doc/aui/auimanager.rb +2 -0
- data/lib/wx/doc/enum.rb +26 -0
- data/lib/wx/doc/evthandler.rb +1 -0
- data/lib/wx/doc/gdi_common.rb +1 -0
- data/lib/wx/doc/tip_window.rb +22 -0
- data/lib/wx/grid/grid.rb +3 -3
- data/lib/wx/grid/require.rb +0 -2
- data/lib/wx/html/htmlhelpcontroller.rb +1 -1
- data/lib/wx/html/htmlwindow.rb +1 -1
- data/lib/wx/html/require.rb +0 -2
- data/lib/wx/html/simple_html_listbox.rb +3 -3
- data/lib/wx/keyword_ctors.rb +14 -7
- data/lib/wx/keyword_defs.rb +7 -7
- data/lib/wx/pg/pg_properties.rb +1 -1
- data/lib/wx/pg/pg_property.rb +3 -3
- data/lib/wx/pg/property_grid.rb +2 -2
- data/lib/wx/pg/property_grid_interface.rb +2 -2
- data/lib/wx/pg/require.rb +0 -2
- data/lib/wx/prt/previewframe.rb +1 -1
- data/lib/wx/prt/require.rb +0 -2
- data/lib/wx/rbn/ribbon_control.rb +1 -1
- data/lib/wx/rbn/ribbon_page.rb +1 -1
- data/lib/wx/rbn/ribbon_panel.rb +1 -1
- data/lib/wx/rtc/require.rb +0 -2
- data/lib/wx/rtc/rich_text_composite_object.rb +1 -1
- data/lib/wx/rtc/rich_text_ctrl.rb +1 -1
- data/lib/wx/rtc/rich_text_paragraph.rb +1 -1
- data/lib/wx/rtc/richtext_buffer.rb +3 -3
- data/lib/wx/rtc/richtext_formatting_dialog.rb +2 -2
- data/lib/wx/rtc/richtext_style_organiser_dialog.rb +1 -1
- data/lib/wx/rtc/symbol_picker_dialog.rb +1 -1
- data/lib/wx/stc/require.rb +0 -2
- data/lib/wx/stc/styled_text_ctrl.rb +1 -1
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/base.rb +8 -2
- data/lib/wx/wxruby/cmd/setup.rb +61 -37
- data/rakelib/gem.rb +8 -4
- data/rakelib/lib/config/mingw.rb +1 -1
- data/rakelib/lib/core/include/swigrubyrun.inc +2 -2
- data/rakelib/lib/director/about_dialog_info.rb +1 -0
- data/rakelib/lib/director/aui_manager.rb +124 -3
- data/rakelib/lib/director/aui_notebook.rb +7 -0
- data/rakelib/lib/director/colour.rb +1 -1
- data/rakelib/lib/director/data_format.rb +1 -1
- data/rakelib/lib/director/dialog.rb +4 -2
- data/rakelib/lib/director/event.rb +1 -0
- data/rakelib/lib/director/event_handler.rb +82 -46
- data/rakelib/lib/director/functions.rb +0 -3
- data/rakelib/lib/director/list_ctrl.rb +14 -10
- data/rakelib/lib/director/locale.rb +2 -0
- data/rakelib/lib/director/num_validator.rb +7 -0
- data/rakelib/lib/director/pgproperties.rb +2 -2
- data/rakelib/lib/director/property_grid_interface.rb +4 -3
- data/rakelib/lib/director/textctrl.rb +7 -0
- data/rakelib/lib/director/tip_window.rb +34 -0
- data/rakelib/lib/director/variant.rb +2 -2
- data/rakelib/lib/director/window.rb +9 -1
- data/rakelib/lib/director.rb +0 -1
- data/rakelib/lib/extractor/function.rb +5 -0
- data/rakelib/lib/generate/doc/evt_handler.yaml +31 -12
- data/rakelib/lib/specs/interfaces.rb +1 -0
- data/rakelib/lib/typemap/common.rb +2 -2
- data/samples/dialogs/dialogs.rb +1 -1
- data/tests/test_combo_ctrl.rb +1 -0
- data/tests/test_event_handling.rb +158 -31
- metadata +7 -5
@@ -6,7 +6,7 @@ class Wx::RBN::RibbonControl
|
|
6
6
|
|
7
7
|
# manage RibbonArtProvider for GC
|
8
8
|
wx_set_art_provider = instance_method :set_art_provider
|
9
|
-
|
9
|
+
wx_redefine_method :set_art_provider do |prov|
|
10
10
|
@art_provider = nil # clear any previously set
|
11
11
|
wx_set_art_provider.bind(self).call(prov)
|
12
12
|
if prov != get_ancestor_ribbon_bar.get_art_provider
|
data/lib/wx/rbn/ribbon_page.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RBN::RibbonPage
|
|
6
6
|
|
7
7
|
# manage RibbonArtProvider for GC
|
8
8
|
wx_set_art_provider = instance_method :set_art_provider
|
9
|
-
|
9
|
+
wx_redefine_method :set_art_provider do |prov|
|
10
10
|
@art_provider = nil # clear any previously set
|
11
11
|
wx_set_art_provider.bind(self).call(prov)
|
12
12
|
if prov != get_ancestor_ribbon_bar.get_art_provider
|
data/lib/wx/rbn/ribbon_panel.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RBN::RibbonPanel
|
|
6
6
|
|
7
7
|
# manage RibbonArtProvider for GC
|
8
8
|
wx_set_art_provider = instance_method :set_art_provider
|
9
|
-
|
9
|
+
wx_redefine_method :set_art_provider do |prov|
|
10
10
|
@art_provider = nil # clear any previously set
|
11
11
|
wx_set_art_provider.bind(self).call(prov)
|
12
12
|
if prov != get_ancestor_ribbon_bar.get_art_provider
|
data/lib/wx/rtc/require.rb
CHANGED
@@ -6,7 +6,7 @@ class Wx::RTC::RichTextBuffer
|
|
6
6
|
|
7
7
|
class << self
|
8
8
|
wx_each_handler = instance_method :each_handler
|
9
|
-
|
9
|
+
wx_redefine_method :each_handler do |&block|
|
10
10
|
if block_given?
|
11
11
|
wx_each_handler.bind(self).call(&block)
|
12
12
|
else
|
@@ -15,7 +15,7 @@ class Wx::RTC::RichTextBuffer
|
|
15
15
|
end
|
16
16
|
|
17
17
|
wx_each_field_type = instance_method :each_field_type
|
18
|
-
|
18
|
+
wx_redefine_method :each_field_type do |&block|
|
19
19
|
if block_given?
|
20
20
|
wx_each_field_type.bind(self).call(&block)
|
21
21
|
else
|
@@ -24,7 +24,7 @@ class Wx::RTC::RichTextBuffer
|
|
24
24
|
end
|
25
25
|
|
26
26
|
wx_each_drawing_handler = instance_method :each_drawing_handler
|
27
|
-
|
27
|
+
wx_redefine_method :each_drawing_handler do |&block|
|
28
28
|
if block_given?
|
29
29
|
wx_each_drawing_handler.bind(self).call(&block)
|
30
30
|
else
|
@@ -8,7 +8,7 @@ module Wx::RTC
|
|
8
8
|
class << self
|
9
9
|
|
10
10
|
wx_set_formatting_dialog_factory = instance_method :set_formatting_dialog_factory
|
11
|
-
|
11
|
+
wx_redefine_method :set_formatting_dialog_factory do |factory|
|
12
12
|
wx_set_formatting_dialog_factory.bind(self).call(factory)
|
13
13
|
@factory = factory # cache here to prevent GC collection
|
14
14
|
end
|
@@ -23,7 +23,7 @@ module Wx::RTC
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# now redefine the overridden ctor to account for deviating arglist
|
26
|
-
|
26
|
+
wx_redefine_method :initialize do |flags = nil, parent = nil, *mixed_args, &block|
|
27
27
|
# allow zero-args ctor for use with XRC
|
28
28
|
if flags.nil?
|
29
29
|
pre_wx_kwctor_init
|
@@ -12,7 +12,7 @@ class Wx::RTC::RichTextStyleOrganiserDialog
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# now redefine the overridden ctor to account for deviating arglist
|
15
|
-
|
15
|
+
wx_redefine_method :initialize do |flags, sheet, ctrl, parent = nil, *mixed_args, &block|
|
16
16
|
real_args = begin
|
17
17
|
[ flags, sheet, ctrl, parent ] + self.class.args_as_list(*mixed_args)
|
18
18
|
rescue => err
|
@@ -13,7 +13,7 @@ class Wx::RTC::SymbolPickerDialog
|
|
13
13
|
end
|
14
14
|
|
15
15
|
# now redefine the overridden ctor to account for deviating arglist
|
16
|
-
|
16
|
+
wx_redefine_method :initialize do |symbol, initialFont, normalTextFont, parent = nil, *mixed_args, &block|
|
17
17
|
real_args = begin
|
18
18
|
[ symbol, initialFont, normalTextFont, parent ] + self.class.args_as_list(*mixed_args)
|
19
19
|
rescue => err
|
data/lib/wx/stc/require.rb
CHANGED
data/lib/wx/version.rb
CHANGED
data/lib/wx/wxruby/base.rb
CHANGED
@@ -55,6 +55,10 @@ module WxRuby
|
|
55
55
|
puts
|
56
56
|
end
|
57
57
|
|
58
|
+
def show_version
|
59
|
+
system(%Q[#{RUBY} -r wx -e 'puts "wxRuby3 v\#{Wx::WXRUBY_VERSION} (wxWidgets v\#{Wx::WXWIDGETS_VERSION})"' 2> /dev/null])
|
60
|
+
end
|
61
|
+
|
58
62
|
def run(cmdid, args)
|
59
63
|
commands[cmdid.to_s].call(args)
|
60
64
|
end
|
@@ -65,9 +69,11 @@ module WxRuby
|
|
65
69
|
" COMMAND\t\t\t\tSpecifies wxruby command to execute."
|
66
70
|
opts.separator ''
|
67
71
|
opts.on('-v', '--verbose',
|
68
|
-
'Show verbose output') { |
|
72
|
+
'Show verbose output') { |_| ::WxRuby::Commands.options[:verbose] = true }
|
73
|
+
opts.on('-V', '--version',
|
74
|
+
'Show versions.') { |_| show_version } if setup_done?
|
69
75
|
opts.on('-h', '--help',
|
70
|
-
'Show this message.') do |
|
76
|
+
'Show this message.') do |_|
|
71
77
|
puts opts
|
72
78
|
puts
|
73
79
|
describe_all
|
data/lib/wx/wxruby/cmd/setup.rb
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
#--------------------------------------------------------------------
|
7
7
|
|
8
8
|
require 'fileutils'
|
9
|
+
require 'json'
|
9
10
|
|
10
11
|
module WxRuby
|
11
12
|
module Commands
|
@@ -55,6 +56,16 @@ module WxRuby
|
|
55
56
|
opts.parse!(args) rescue ($stderr.puts $!.message; exit(127))
|
56
57
|
end
|
57
58
|
|
59
|
+
class << self
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def check_wx_config
|
64
|
+
!(`which #{@wx_config} 2>/dev/null`).chomp.empty?
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
58
69
|
def self.run(argv)
|
59
70
|
return description if argv == :describe
|
60
71
|
|
@@ -74,48 +85,61 @@ module WxRuby
|
|
74
85
|
cfg_cmd = 'rake configure'
|
75
86
|
cfg_cmd << "[#{cfg_args.join(',')}]" unless cfg_args.empty?
|
76
87
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
steps = 1
|
82
|
-
'(possibly) install required software'
|
83
|
-
else
|
84
|
-
''
|
85
|
-
end
|
86
|
-
if Setup.options['with-wxwin'] || Setup.options['wxwin'].nil?
|
87
|
-
actions_txt << ', ' if steps>0
|
88
|
-
actions_txt << 'build the wxWidgets libraries (if needed), '
|
89
|
-
actions_txt << "\n" if steps>0
|
90
|
-
steps += 1
|
88
|
+
log_file = File.join(WxRuby::ROOT, 'setup.log')
|
89
|
+
if Setup.options['log']
|
90
|
+
if File.directory?(Setup.options['log']) && File.writable?(Setup.options['log'])
|
91
|
+
log_file = File.join(Setup.options['log'], 'setup.log')
|
91
92
|
else
|
92
|
-
|
93
|
+
$stderr.puts "ERROR: cannot write log to #{Setup.options['log']}. Log path must exist and be writable."
|
94
|
+
exit(1)
|
93
95
|
end
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
96
|
+
end
|
97
|
+
run_env = {'WXRUBY_RUN_SILENT' => "#{log_file}"}
|
98
|
+
run_env['WXRUBY_VERBOSE'] = '1' if Setup.options[:verbose]
|
99
|
+
|
100
|
+
result = false
|
101
|
+
|
102
|
+
FileUtils.chdir(WxRuby::ROOT) do
|
103
|
+
# first run the configure command
|
104
|
+
result = system(run_env, "#{cfg_cmd}")
|
105
|
+
|
106
|
+
# if succeeded
|
107
|
+
if result
|
108
|
+
# load the wxRuby3 build config
|
109
|
+
build_cfg = ::JSON.load(File.read('.wxconfig'))
|
110
|
+
|
111
|
+
# now determine the steps to execute
|
112
|
+
steps = 0
|
113
|
+
actions_txt = if Setup.options['autoinstall'] != false
|
114
|
+
steps = 1
|
115
|
+
'(possibly) install required software'
|
116
|
+
else
|
117
|
+
''
|
118
|
+
end
|
119
|
+
if build_cfg['with-wxwin'] || (!build_cfg['wxwin'].to_s.empty? && build_cfg['wxwin'].to_s != '@system')
|
120
|
+
actions_txt << ', ' if steps>0
|
121
|
+
actions_txt << 'build the wxWidgets libraries, '
|
122
|
+
actions_txt << "\n" if steps>0
|
123
|
+
steps += 1
|
110
124
|
else
|
111
|
-
|
112
|
-
exit(1)
|
125
|
+
actions_txt << ',' if steps>0
|
113
126
|
end
|
127
|
+
actions_txt << 'build the native wxRuby3 extensions '
|
128
|
+
actions_txt << "\n" if steps==1
|
129
|
+
actions_txt << 'and generate the wxRuby3 reference documentation.'
|
130
|
+
$stdout.puts <<~__INFO_TXT
|
131
|
+
|
132
|
+
---
|
133
|
+
Now running wxRuby3 post-install setup.
|
134
|
+
This will #{actions_txt}
|
135
|
+
Please be patient as this may take quite a while depending on your system.
|
136
|
+
(#{steps >= 2 ? '10-15' : '5-10'} min on a modern PC with multicore CPU but longer with older/slower CPUs)
|
137
|
+
---
|
138
|
+
|
139
|
+
__INFO_TXT
|
140
|
+
# can't rely on FileUtils#chdir returning the block result (bug in older Rubies) so assign result here
|
141
|
+
result = system(run_env, "rake -m wxruby:gem:setup#{Setup.options['log'] ? '[:keep_log]' : ''} && gem rdoc wxruby3 --overwrite")
|
114
142
|
end
|
115
|
-
run_env = {'WXRUBY_RUN_SILENT' => "#{log_file}"}
|
116
|
-
run_env['WXRUBY_VERBOSE'] = '1' if Setup.options[:verbose]
|
117
|
-
# can't rely on FileUtils#chdir returning the block result (bug in older Rubies) so assign result here
|
118
|
-
result = system(run_env, "#{cfg_cmd} && rake -m wxruby:gem:setup#{Setup.options['log'] ? '[:keep_log]' : ''} && gem rdoc wxruby3 --overwrite")
|
119
143
|
end
|
120
144
|
exit(result ? 0 : 1)
|
121
145
|
end
|
data/rakelib/gem.rb
CHANGED
@@ -214,16 +214,18 @@ module WXRuby3
|
|
214
214
|
end
|
215
215
|
elsif uri.scheme == 'http' || uri.scheme == 'https'
|
216
216
|
# download the binary release package
|
217
|
-
$stdout.puts "Downloading #{uri
|
217
|
+
$stdout.puts "Downloading #{uri}..."
|
218
218
|
filename = File.basename(uri.path)
|
219
|
-
if WXRuby3.config.download_file(uri.
|
219
|
+
if WXRuby3.config.download_file(uri.to_s, filename)
|
220
220
|
sha_file = File.basename(filename, '.*')+DIGEST_EXT
|
221
|
-
|
222
|
-
unless WXRuby3.config.download_file(
|
221
|
+
sha_uri = File.join(File.dirname(uri.to_s), sha_file)
|
222
|
+
unless WXRuby3.config.download_file(sha_uri, sha_file)
|
223
223
|
$stderr.puts "ERROR: Unable to download digest signature for binary release package : #{package}"
|
224
224
|
exit(1)
|
225
225
|
end
|
226
226
|
exit(1) unless install_bin_pkg(filename)
|
227
|
+
# cleanup, remove downloaded files
|
228
|
+
FileUtils.rm_f([filename, sha_file])
|
227
229
|
true
|
228
230
|
else
|
229
231
|
$stderr.puts "ERROR: Unable to download binary release package (#{package})!"
|
@@ -241,6 +243,8 @@ module WXRuby3
|
|
241
243
|
exit(1)
|
242
244
|
end
|
243
245
|
exit(1) unless install_bin_pkg(bin_pkg_name+BINPKG_EXT)
|
246
|
+
# cleanup, remove downloaded files
|
247
|
+
FileUtils.rm_f([bin_pkg_name+BINPKG_EXT, bin_pkg_name+DIGEST_EXT])
|
244
248
|
true
|
245
249
|
else
|
246
250
|
if prebuilt_only
|
data/rakelib/lib/config/mingw.rb
CHANGED
@@ -98,7 +98,7 @@ module WXRuby3
|
|
98
98
|
private
|
99
99
|
|
100
100
|
def wx_configure
|
101
|
-
bash('./configure --prefix=`pwd`/install --disable-tests --without-subdirs --without-regex --with-expat=builtin --with-zlib=builtin --disable-debug_info')
|
101
|
+
bash('./configure --prefix=`pwd`/install --disable-tests --without-subdirs --without-regex --without-libcurl --with-expat=builtin --with-zlib=builtin --disable-debug_info')
|
102
102
|
end
|
103
103
|
|
104
104
|
def wx_make
|
@@ -59,9 +59,9 @@ extern "C" {
|
|
59
59
|
#endif
|
60
60
|
|
61
61
|
WXRB_EXPORT_FLAG VALUE
|
62
|
-
|
62
|
+
SWIG_wxRuby_AppendOutput(VALUE target, VALUE o, int is_void)
|
63
63
|
{
|
64
|
-
if (NIL_P(target))
|
64
|
+
if (NIL_P(target) && is_void != 0)
|
65
65
|
{
|
66
66
|
target = o;
|
67
67
|
}
|
@@ -16,7 +16,103 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
super
|
19
|
-
spec.gc_as_object
|
19
|
+
spec.gc_as_object 'wxAuiManager'
|
20
|
+
if Config.instance.wx_version >= '3.3.0'
|
21
|
+
spec.items << 'wxAuiSerializer' << 'wxAuiDockLayoutInfo' << 'wxAuiPaneLayoutInfo' << 'wxAuiTabLayoutInfo' << 'wxAuiDeserializer'
|
22
|
+
spec.gc_as_untracked 'wxAuiSerializer', 'wxAuiDeserializer', 'wxAuiDockLayoutInfo', 'wxAuiPaneLayoutInfo', 'wxAuiTabLayoutInfo'
|
23
|
+
spec.regard 'wxAuiDockLayoutInfo::dock_direction',
|
24
|
+
'wxAuiDockLayoutInfo::dock_layer',
|
25
|
+
'wxAuiDockLayoutInfo::dock_row',
|
26
|
+
'wxAuiDockLayoutInfo::dock_pos',
|
27
|
+
'wxAuiDockLayoutInfo::dock_proportion',
|
28
|
+
'wxAuiDockLayoutInfo::dock_size',
|
29
|
+
'wxAuiPaneLayoutInfo::name',
|
30
|
+
'wxAuiPaneLayoutInfo::floating_pos',
|
31
|
+
'wxAuiPaneLayoutInfo::floating_size',
|
32
|
+
'wxAuiPaneLayoutInfo::is_maximized'
|
33
|
+
spec.add_extend_code 'wxAuiTabLayoutInfo', <<~__HEREDOC
|
34
|
+
VALUE get_pages()
|
35
|
+
{
|
36
|
+
VALUE rc = rb_ary_new();
|
37
|
+
for (int page : self->pages)
|
38
|
+
{
|
39
|
+
rb_ary_push(rc, INT2NUM(page));
|
40
|
+
}
|
41
|
+
return rc;
|
42
|
+
}
|
43
|
+
|
44
|
+
void set_pages(VALUE rb_pages)
|
45
|
+
{
|
46
|
+
if (TYPE(rb_pages) == T_ARRAY)
|
47
|
+
{
|
48
|
+
std::vector<int> pgs;
|
49
|
+
for (int i = 0; i < RARRAY_LEN(rb_pages); i++)
|
50
|
+
{
|
51
|
+
pgs.push_back(NUM2INT(rb_ary_entry(rb_pages, i)));
|
52
|
+
}
|
53
|
+
self->pages = pgs;
|
54
|
+
}
|
55
|
+
else
|
56
|
+
{
|
57
|
+
rb_raise(rb_eTypeError, "Expected Array of Integer for 1");
|
58
|
+
}
|
59
|
+
}
|
60
|
+
__HEREDOC
|
61
|
+
spec.map 'std::vector<wxAuiPaneLayoutInfo>' => 'Array<Wx::AuiPaneLayoutInfo>' do
|
62
|
+
map_out code: <<~__CODE
|
63
|
+
$result = rb_ary_new();
|
64
|
+
std::vector<wxAuiPaneLayoutInfo>& panes = (std::vector<wxAuiPaneLayoutInfo>&)$1;
|
65
|
+
for (const wxAuiPaneLayoutInfo& pane : panes)
|
66
|
+
{
|
67
|
+
VALUE r_pane = SWIG_NewPointerObj(new wxAuiPaneLayoutInfo(pane), SWIGTYPE_p_wxAuiPaneLayoutInfo, SWIG_POINTER_OWN);
|
68
|
+
rb_ary_push($result, r_pane);
|
69
|
+
}
|
70
|
+
__CODE
|
71
|
+
map_directorout code: <<~__CODE
|
72
|
+
if (TYPE($input) == T_ARRAY)
|
73
|
+
{
|
74
|
+
for (int i = 0; i < RARRAY_LEN($input); i++)
|
75
|
+
{
|
76
|
+
void *ptr;
|
77
|
+
VALUE r_pane = rb_ary_entry($input, i);
|
78
|
+
int res = SWIG_ConvertPtr(r_pane, &ptr, SWIGTYPE_p_wxAuiPaneLayoutInfo, 0);
|
79
|
+
if (!SWIG_IsOK(res) || !ptr) {
|
80
|
+
Swig::DirectorTypeMismatchException::raise(swig_get_self(), "load_panes", rb_eTypeError, "in return value. Expected Array of Wx::AuiPaneLayoutInfo");
|
81
|
+
}
|
82
|
+
wxAuiPaneLayoutInfo *pane = reinterpret_cast< wxAuiPaneLayoutInfo * >(ptr);
|
83
|
+
$result.push_back(*pane);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
__CODE
|
87
|
+
end
|
88
|
+
spec.map 'std::vector<wxAuiTabLayoutInfo>' => 'Array<Wx::AuiTabLayoutInfo>' do
|
89
|
+
map_out code: <<~__CODE
|
90
|
+
$result = rb_ary_new();
|
91
|
+
std::vector<wxAuiTabLayoutInfo>& tabs = (std::vector<wxAuiTabLayoutInfo>&)$1;
|
92
|
+
for (const wxAuiTabLayoutInfo& tab : tabs)
|
93
|
+
{
|
94
|
+
VALUE r_tab = SWIG_NewPointerObj(new wxAuiTabLayoutInfo(tab), SWIGTYPE_p_wxAuiTabLayoutInfo, SWIG_POINTER_OWN);
|
95
|
+
rb_ary_push($result, r_tab);
|
96
|
+
}
|
97
|
+
__CODE
|
98
|
+
map_directorout code: <<~__CODE
|
99
|
+
if (TYPE($input) == T_ARRAY)
|
100
|
+
{
|
101
|
+
for (int i = 0; i < RARRAY_LEN($input); i++)
|
102
|
+
{
|
103
|
+
void *ptr;
|
104
|
+
VALUE r_tab = rb_ary_entry($input, i);
|
105
|
+
int res = SWIG_ConvertPtr(r_tab, &ptr, SWIGTYPE_p_wxAuiTabLayoutInfo, 0);
|
106
|
+
if (!SWIG_IsOK(res) || !ptr) {
|
107
|
+
Swig::DirectorTypeMismatchException::raise(swig_get_self(), "load_docks", rb_eTypeError, "in return value. Expected Array of Wx::AuiTabLayoutInfo");
|
108
|
+
}
|
109
|
+
wxAuiTabLayoutInfo *tab = reinterpret_cast< wxAuiTabLayoutInfo * >(ptr);
|
110
|
+
$result.push_back(*tab);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
__CODE
|
114
|
+
end
|
115
|
+
end
|
20
116
|
# need a custom implementation to handle (event handler proc) cleanup
|
21
117
|
spec.add_header_code <<~__HEREDOC
|
22
118
|
#include "wx/aui/aui.h"
|
@@ -80,7 +176,7 @@ module WXRuby3
|
|
80
176
|
rb_gc_mark( rb_art_prov );
|
81
177
|
}
|
82
178
|
}
|
83
|
-
|
179
|
+
__HEREDOC
|
84
180
|
spec.add_swig_code '%markfunc wxAuiManager "GC_mark_wxAuiManager";'
|
85
181
|
# provide pure Ruby implementation based on use custom alternative provided below
|
86
182
|
spec.ignore('wxAuiManager::GetAllPanes')
|
@@ -110,12 +206,37 @@ module WXRuby3
|
|
110
206
|
WXRubyAuiManager* aui_mng = dynamic_cast<WXRubyAuiManager*> (self);
|
111
207
|
managedWnd->Bind(wxEVT_CLOSE_WINDOW, &WXRubyAuiManager::OnManagedWindowClose, aui_mng);
|
112
208
|
}
|
113
|
-
|
209
|
+
__HEREDOC
|
114
210
|
spec.suppress_warning(473, 'wxAuiManager::CreateFloatingFrame')
|
115
211
|
spec.do_not_generate(:variables, :defines, :enums, :functions) # with AuiPaneInfo
|
116
212
|
end
|
213
|
+
|
214
|
+
def doc_generator
|
215
|
+
AuiManagerDocGenerator.new(self)
|
216
|
+
end
|
117
217
|
end # class AuiManager
|
118
218
|
|
219
|
+
class AuiManagerDocGenerator < DocGenerator
|
220
|
+
|
221
|
+
def gen_class_doc_members(fdoc, clsdef, cls_members, alias_methods)
|
222
|
+
super
|
223
|
+
if Config.instance.wx_version >= '3.3.0' && clsdef.name == 'wxAuiTabLayoutInfo'
|
224
|
+
fdoc.doc.puts 'Returns the indices of the pages in this tab control in their order on screen.'
|
225
|
+
fdoc.doc.puts 'If this array is empty, it means that the tab control contains all notebook pages in natural order.'
|
226
|
+
fdoc.doc.puts '@return [::Array<Integer>] indices of the pages in this tab control'
|
227
|
+
fdoc.puts 'def get_pages; end'
|
228
|
+
fdoc.puts 'alias :pages :get_pages'
|
229
|
+
fdoc.puts
|
230
|
+
fdoc.doc.puts 'Set the indices of the pages in this tab control in their order on screen.'
|
231
|
+
fdoc.doc.puts 'If this array is empty, it means that the tab control contains all notebook pages in natural order.'
|
232
|
+
fdoc.doc.puts '@param [::Array<Integer>] pages indices of the pages in this tab control'
|
233
|
+
fdoc.puts 'def set_pages(pages) end'
|
234
|
+
fdoc.puts 'alias :pages= :set_pages'
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
119
240
|
end # class Director
|
120
241
|
|
121
242
|
end # module WXRuby3
|
@@ -25,6 +25,13 @@ module WXRuby3
|
|
25
25
|
wxAuiNotebookPage::bitmap
|
26
26
|
wxAuiNotebookPage::rect
|
27
27
|
wxAuiNotebookPage::active]
|
28
|
+
if Config.instance.wx_version >= '3.3.0'
|
29
|
+
spec.items << 'wxAuiNotebookPosition'
|
30
|
+
spec.regard 'wxAuiNotebookPosition::tabctrl',
|
31
|
+
'wxAuiNotebookPosition::page'
|
32
|
+
spec.make_readonly 'wxAuiNotebookPosition::tabctrl',
|
33
|
+
'wxAuiNotebookPosition::page'
|
34
|
+
end
|
28
35
|
# reset type mapping done in BookCtrls as the non-const arg is used for query-ing here (FindTab)
|
29
36
|
# (wxWidgets should have made this a const arg)
|
30
37
|
spec.map_apply 'SWIGTYPE *' => 'wxWindow* page'
|
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
spec.gc_as_untracked('wxColour')
|
17
17
|
spec.require_app 'wxColour::wxColour(const wxColour&)'
|
18
18
|
spec.ignore(%w[
|
19
|
-
wxColour::GetPixel wxTransparentColour wxColour::operator!=
|
19
|
+
wxColour::GetPixel wxTransparentColour wxColour::operator!= wxColour::operator==
|
20
20
|
wxBLACK wxBLUE wxCYAN wxGREEN wxYELLOW wxLIGHT_GREY wxRED wxWHITE
|
21
21
|
])
|
22
22
|
spec.map 'unsigned char *' => 'Integer' do
|
@@ -15,7 +15,7 @@ module WXRuby3
|
|
15
15
|
def setup
|
16
16
|
super
|
17
17
|
spec.gc_as_object
|
18
|
-
spec.ignore 'wxDataFormat::operator
|
18
|
+
spec.ignore 'wxDataFormat::operator=='
|
19
19
|
if Config.platform == :mingw
|
20
20
|
# The formal signature for these is NativeFormat; this is required on
|
21
21
|
# MSVC as otherwise an impermissible implicit cast is tried, and so
|
@@ -230,8 +230,10 @@ module WXRuby3
|
|
230
230
|
# regard protected methods
|
231
231
|
spec.regard 'wxGenericAboutDialog::DoAddCustomControls',
|
232
232
|
'wxGenericAboutDialog::AddControl',
|
233
|
-
'wxGenericAboutDialog::AddText'
|
234
|
-
|
233
|
+
'wxGenericAboutDialog::AddText'
|
234
|
+
if Config.instance.wx_version >= '3.3.0'
|
235
|
+
spec.regard 'wxGenericAboutDialog::GetCustomControlParent'
|
236
|
+
end
|
235
237
|
if Config.instance.features_set?('USE_COLLPANE')
|
236
238
|
spec.regard 'wxGenericAboutDialog::AddCollapsiblePane'
|
237
239
|
end
|
@@ -47,6 +47,7 @@ module WXRuby3
|
|
47
47
|
if (class_name == "wxEvent" || class_name == "wxCommandEvent")
|
48
48
|
{
|
49
49
|
// special clones for Ruby derived events are already managed and tracked
|
50
|
+
// (this also covers Wx::AsyncProcCallEvent)
|
50
51
|
return SWIG_RubyInstanceFor((void *)wx_evt);
|
51
52
|
}
|
52
53
|
|