wxruby3 1.5.4 → 1.6.1
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.
- checksums.yaml +4 -4
- data/INSTALL.md +2 -2
- data/README.md +3 -3
- data/ext/wxruby3/swig/RubyStockObjects.i +1 -0
- data/ext/wxruby3/swig/mark_free_impl.i +2 -0
- data/lib/wx/aui/auifloatframe.rb +1 -1
- data/lib/wx/aui/auimanager.rb +1 -1
- data/lib/wx/aui/auinotebook.rb +2 -2
- data/lib/wx/core/animation.rb +1 -1
- data/lib/wx/core/cursor.rb +10 -0
- data/lib/wx/core/dataformat.rb +1 -1
- data/lib/wx/core/file_dialog.rb +1 -1
- data/lib/wx/core/geometry.rb +34 -0
- data/lib/wx/core/hboxsizer.rb +22 -0
- data/lib/wx/core/hyperlink_ctrl.rb +18 -0
- data/lib/wx/core/position.rb +58 -0
- data/lib/wx/core/variant.rb +6 -0
- data/lib/wx/core/vboxsizer.rb +22 -0
- data/lib/wx/doc/aui/auimanager.rb +6 -3
- data/lib/wx/doc/aui/auinotebook.rb +6 -3
- data/lib/wx/doc/config.rb +14 -8
- data/lib/wx/doc/controlwithitems.rb +7 -3
- data/lib/wx/doc/core.rb +21 -0
- data/lib/wx/doc/geometry.rb +47 -7
- data/lib/wx/doc/graphics_object.rb +24 -0
- data/lib/wx/doc/grid/grid.rb +18 -9
- data/lib/wx/doc/hboxsizer.rb +41 -5
- data/lib/wx/doc/list_ctrl.rb +12 -6
- data/lib/wx/doc/menu.rb +6 -3
- data/lib/wx/doc/notebook.rb +6 -3
- data/lib/wx/doc/pg/pg_property.rb +23 -9
- data/lib/wx/doc/pg/property_grid_interface.rb +4 -4
- data/lib/wx/doc/region_iterator.rb +1 -1
- data/lib/wx/doc/rtc/rich_text_composite_object.rb +6 -3
- data/lib/wx/doc/rtc/rich_text_ctrl.rb +6 -3
- data/lib/wx/doc/rtc/rich_text_paragraph.rb +6 -3
- data/lib/wx/doc/sizer.rb +6 -3
- data/lib/wx/doc/stc/styled_text_ctrl.rb +6 -3
- data/lib/wx/doc/textctrl.rb +6 -3
- data/lib/wx/doc/tree_ctrl.rb +7 -3
- data/lib/wx/doc/v_list_box.rb +6 -3
- data/lib/wx/doc/variant.rb +31 -1
- data/lib/wx/doc/vboxsizer.rb +41 -5
- data/lib/wx/doc/window.rb +6 -3
- data/lib/wx/helpers.rb +28 -0
- data/lib/wx/keyword_ctors.rb +2 -2
- data/lib/wx/keyword_defs.rb +11 -2
- data/lib/wx/pg/pg_property.rb +60 -53
- data/lib/wx/pg/property_grid_interface.rb +10 -0
- data/lib/wx/version.rb +1 -1
- data/rakelib/gem.rake +83 -66
- data/rakelib/gem.rb +4 -20
- data/rakelib/lib/config/mingw.rb +1 -1
- data/rakelib/lib/config.rb +9 -3
- data/rakelib/lib/core/spec.rb +1 -1
- data/rakelib/lib/director/affine_matrix.rb +33 -0
- data/rakelib/lib/director/animation_ctrl.rb +1 -1
- data/rakelib/lib/director/app.rb +1 -1
- data/rakelib/lib/director/aui_manager.rb +2 -2
- data/rakelib/lib/director/aui_notebook.rb +1 -1
- data/rakelib/lib/director/aui_tab_art.rb +4 -4
- data/rakelib/lib/director/bitmap_combobox.rb +4 -2
- data/rakelib/lib/director/ctrl_with_items.rb +1 -1
- data/rakelib/lib/director/cursor.rb +11 -1
- data/rakelib/lib/director/dc.rb +2 -2
- data/rakelib/lib/director/defs.rb +1 -1
- data/rakelib/lib/director/derived_dc.rb +14 -14
- data/rakelib/lib/director/dialog.rb +3 -3
- data/rakelib/lib/director/gdicommon.rb +2 -2
- data/rakelib/lib/director/geometry.rb +55 -3
- data/rakelib/lib/director/graphics_context.rb +8 -3
- data/rakelib/lib/director/graphics_object.rb +29 -2
- data/rakelib/lib/director/html_listbox.rb +19 -5
- data/rakelib/lib/director/hvscrolled.rb +253 -0
- data/rakelib/lib/director/hyperlink_ctrl.rb +38 -1
- data/rakelib/lib/director/menu_item.rb +1 -1
- data/rakelib/lib/director/persistent_window.rb +18 -2
- data/rakelib/lib/director/pgeditor.rb +1 -1
- data/rakelib/lib/director/pgproperties.rb +4 -4
- data/rakelib/lib/director/pgproperty.rb +4 -3
- data/rakelib/lib/director/pgvalidation_info.rb +1 -1
- data/rakelib/lib/director/print_data.rb +1 -1
- data/rakelib/lib/director/property_grid_event.rb +1 -1
- data/rakelib/lib/director/property_grid_page.rb +1 -1
- data/rakelib/lib/director/property_grid_page_state.rb +1 -1
- data/rakelib/lib/director/ribbon_tool_bar.rb +1 -1
- data/rakelib/lib/director/richtext_buffer.rb +1 -1
- data/rakelib/lib/director/richtext_formatting_dialog.rb +1 -1
- data/rakelib/lib/director/richtext_paragraph_layout_box.rb +1 -1
- data/rakelib/lib/director/richtext_style_listbox.rb +8 -1
- data/rakelib/lib/director/scrolled_t.rb +22 -0
- data/rakelib/lib/director/sizer.rb +21 -0
- data/rakelib/lib/director/styled_text_event.rb +1 -1
- data/rakelib/lib/director/textctrl.rb +2 -2
- data/rakelib/lib/director/top_level_window.rb +0 -1
- data/rakelib/lib/director/tree_ctrl.rb +1 -1
- data/rakelib/lib/director/utils.rb +4 -2
- data/rakelib/lib/director/variant.rb +29 -1
- data/rakelib/lib/director/vlistbox.rb +9 -3
- data/rakelib/lib/director/window.rb +16 -4
- data/rakelib/lib/extractor/function.rb +46 -15
- data/rakelib/lib/generate/doc/hyperlink_ctrl.yaml +22 -0
- data/rakelib/lib/generate/doc/scrolled_canvas.yaml +38 -0
- data/rakelib/lib/generate/doc/scrolled_control.yaml +38 -0
- data/rakelib/lib/generate/doc/scrolled_window.yaml +38 -0
- data/rakelib/lib/specs/interfaces.rb +4 -2
- data/rakelib/lib/swig_runner.rb +2 -2
- data/rakelib/lib/typemap/print_page_range.rb +1 -1
- data/samples/scrolling/tn_varscroll.png +0 -0
- data/samples/scrolling/varscroll.rb +416 -0
- data/samples/widgets/hyperlink.rb +85 -60
- data/tests/test_propgrid.rb +857 -0
- metadata +14 -7
- data/rakelib/lib/director/vscrolled_window.rb +0 -62
- /data/samples/{controls → scrolling}/htlbox.rb +0 -0
- /data/samples/{etc → scrolling}/scrollwin.rb +0 -0
- /data/samples/{controls → scrolling}/tn_htlbox.png +0 -0
- /data/samples/{etc → scrolling}/tn_scrollwin.png +0 -0
data/lib/wx/pg/pg_property.rb
CHANGED
@@ -4,71 +4,78 @@
|
|
4
4
|
|
5
5
|
# Wx::PG::PGProperty
|
6
6
|
|
7
|
-
module Wx
|
8
|
-
|
9
|
-
NullProperty = nil
|
10
|
-
PGChoicesEmptyData = nil
|
11
|
-
|
12
|
-
PG_LABEL_STRING = '@!' unless self.const_defined?(:PG_LABEL_STRING) # disappeared >= wxWidgets 3.3.0
|
13
|
-
PG_LABEL = Wx::PG::PG_LABEL_STRING
|
14
|
-
|
15
|
-
PG_DEFAULT_IMAGE_SIZE = Wx::DEFAULT_SIZE
|
16
|
-
|
17
|
-
if Wx::WXWIDGETS_VERSION >= '3.3.0'
|
18
|
-
# backward compatibility constants
|
19
|
-
PG_FULL_VALUE = PGPropValFormatFlags::FullValue
|
20
|
-
PG_REPORT_ERROR = PGPropValFormatFlags::ReportError
|
21
|
-
PG_PROPERTY_SPECIFIC = PGPropValFormatFlags::PropertySpecific
|
22
|
-
PG_EDITABLE_VALUE = PGPropValFormatFlags::EditableValue
|
23
|
-
PG_COMPOSITE_FRAGMENT = PGPropValFormatFlags::CompositeFragment
|
24
|
-
PG_UNEDITABLE_COMPOSITE_FRAGMENT = PGPropValFormatFlags::UneditableCompositeFragment
|
25
|
-
PG_VALUE_IS_CURRENT = PGPropValFormatFlags::ValueIsCurrent
|
26
|
-
PG_PROGRAMMATIC_VALUE = PGPropValFormatFlags::ProgrammaticValue
|
27
|
-
end
|
7
|
+
module Wx
|
8
|
+
module PG
|
28
9
|
|
29
|
-
|
10
|
+
NullProperty = nil
|
11
|
+
PGChoicesEmptyData = nil
|
30
12
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
else
|
36
|
-
::Enumerator.new { |y| wx_each_attribute.bind(self).call { |variant| y << variant } }
|
37
|
-
end
|
38
|
-
end
|
13
|
+
PG_LABEL_STRING = '@!' unless self.const_defined?(:PG_LABEL_STRING) # disappeared >= wxWidgets 3.3.0
|
14
|
+
PG_LABEL = Wx::PG::PG_LABEL_STRING
|
15
|
+
|
16
|
+
PG_DEFAULT_IMAGE_SIZE = Wx::DEFAULT_SIZE
|
39
17
|
|
40
|
-
|
41
|
-
|
18
|
+
if Wx.at_least_wxwidgets?('3.3.0')
|
19
|
+
# backward compatibility constants
|
20
|
+
PG_FULL_VALUE = PGPropValFormatFlags::FullValue
|
21
|
+
PG_REPORT_ERROR = PGPropValFormatFlags::ReportError
|
22
|
+
PG_PROPERTY_SPECIFIC = PGPropValFormatFlags::PropertySpecific
|
23
|
+
PG_EDITABLE_VALUE = PGPropValFormatFlags::EditableValue
|
24
|
+
PG_COMPOSITE_FRAGMENT = PGPropValFormatFlags::CompositeFragment
|
25
|
+
PG_UNEDITABLE_COMPOSITE_FRAGMENT = PGPropValFormatFlags::UneditableCompositeFragment
|
26
|
+
PG_VALUE_IS_CURRENT = PGPropValFormatFlags::ValueIsCurrent
|
27
|
+
PG_PROGRAMMATIC_VALUE = PGPropValFormatFlags::ProgrammaticValue
|
42
28
|
end
|
43
|
-
alias :attributes :get_attributes
|
44
29
|
|
45
|
-
def
|
46
|
-
|
47
|
-
map.each_pair { |nm, v| set_attribute(nm, v) }
|
30
|
+
def self.PG_IT_CHILDREN(mask)
|
31
|
+
mask << 16
|
48
32
|
end
|
49
|
-
alias :attributes= :set_attributes
|
50
|
-
end
|
51
33
|
|
52
|
-
|
34
|
+
class PGProperty
|
35
|
+
|
36
|
+
wx_each_attribute = instance_method :each_attribute
|
37
|
+
wx_redefine_method :each_attribute do
|
38
|
+
if block_given?
|
39
|
+
wx_each_attribute.bind(self).call
|
40
|
+
else
|
41
|
+
::Enumerator.new { |y| wx_each_attribute.bind(self).call { |variant| y << variant } }
|
42
|
+
end
|
43
|
+
end
|
53
44
|
|
54
|
-
|
55
|
-
|
56
|
-
if block_given?
|
57
|
-
wx_each_label.bind(self).call
|
58
|
-
else
|
59
|
-
::Enumerator.new { |y| wx_each_label.bind(self).call { |lbl| y << lbl } }
|
45
|
+
def get_attributes
|
46
|
+
each_attribute.inject({}) { |map, v| map[v.name] = v; map }
|
60
47
|
end
|
48
|
+
alias :attributes :get_attributes
|
49
|
+
|
50
|
+
def set_attributes(map)
|
51
|
+
raise ArgumentError, 'Expected Hash' unless map.is_a?(::Hash)
|
52
|
+
map.each_pair { |nm, v| set_attribute(nm, v) }
|
53
|
+
end
|
54
|
+
alias :attributes= :set_attributes
|
61
55
|
end
|
62
56
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
57
|
+
class PGChoices
|
58
|
+
|
59
|
+
wx_each_label = instance_method :each_label
|
60
|
+
wx_redefine_method :each_label do
|
61
|
+
if block_given?
|
62
|
+
wx_each_label.bind(self).call
|
63
|
+
else
|
64
|
+
::Enumerator.new { |y| wx_each_label.bind(self).call { |lbl| y << lbl } }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
wx_each_entry = instance_method :each_entry
|
69
|
+
wx_redefine_method :each_entry do
|
70
|
+
if block_given?
|
71
|
+
wx_each_entry.bind(self).call
|
72
|
+
else
|
73
|
+
::Enumerator.new { |y| wx_each_entry.bind(self).call { |entry| y << entry } }
|
74
|
+
end
|
69
75
|
end
|
76
|
+
|
70
77
|
end
|
71
|
-
|
78
|
+
|
72
79
|
end
|
73
|
-
|
80
|
+
|
74
81
|
end
|
@@ -19,6 +19,16 @@ module Wx::PG
|
|
19
19
|
|
20
20
|
module PropertyGridInterface
|
21
21
|
|
22
|
+
wx_set_property_value = instance_method :set_property_value
|
23
|
+
wx_redefine_method :set_property_value do |propid, value|
|
24
|
+
case value
|
25
|
+
when ::String
|
26
|
+
set_property_value_string(propid, value)
|
27
|
+
else
|
28
|
+
wx_set_property_value.bind(self).call(propid, value)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
22
32
|
wx_each_property = instance_method :each_property
|
23
33
|
wx_redefine_method :each_property do |flags = Wx::PG::PG_ITERATE_DEFAULT, start = nil, reverse: false, &block|
|
24
34
|
if block
|
data/lib/wx/version.rb
CHANGED
data/rakelib/gem.rake
CHANGED
@@ -12,6 +12,8 @@ namespace :wxruby do
|
|
12
12
|
|
13
13
|
namespace :gem do
|
14
14
|
|
15
|
+
task :srcgemspec => ['bin:build', WXRuby3::Gem.gemspec_file]
|
16
|
+
|
15
17
|
task :srcgem => ['bin:build', WXRuby3::Gem.gem_file]
|
16
18
|
|
17
19
|
# this task only exists for installed (source) gems (where run tasks have been removed)
|
@@ -60,72 +62,87 @@ namespace :wxruby do
|
|
60
62
|
|
61
63
|
end
|
62
64
|
|
65
|
+
file WXRuby3::Gem.gemspec_file => WXRuby3::Gem.manifest do |t|
|
66
|
+
code = <<~__GEMSPEC
|
67
|
+
Gem::Specification.new('wxruby3', '#{WXRuby3::WXRUBY_VERSION}') do |gem|
|
68
|
+
gem.summary = %Q{wxWidgets extension for Ruby}
|
69
|
+
gem.description = %Q{wxRuby3 is a Ruby library providing an extension for the wxWidgets C++ UI framework}
|
70
|
+
gem.email = 'mcorino@m2c-software.nl'
|
71
|
+
gem.homepage = "https://github.com/mcorino/wxRuby3"
|
72
|
+
gem.authors = ['Martin Corino']
|
73
|
+
gem.extensions = ['ext/mkrf_conf_ext.rb']
|
74
|
+
gem.files = [#{WXRuby3::Gem.manifest.collect {|f| "'#{f}'" }.join(',')}]
|
75
|
+
gem.require_paths = %w{lib}
|
76
|
+
gem.bindir = 'bin'
|
77
|
+
gem.executables = [#{WXRuby3::Bin.binaries.collect { |b| "'#{b}'" }.join(',')}]
|
78
|
+
gem.required_ruby_version = '>= 2.5'
|
79
|
+
gem.licenses = ['MIT']
|
80
|
+
gem.add_dependency 'nokogiri', '~> 1.12'
|
81
|
+
gem.add_dependency 'rake'
|
82
|
+
gem.add_dependency 'minitest', '~> 5.15'
|
83
|
+
gem.add_dependency 'test-unit', '~> 3.5'
|
84
|
+
gem.add_dependency 'plat4m', '~> 1.1'
|
85
|
+
gem.rdoc_options <<
|
86
|
+
'--exclude=\\.dll' <<
|
87
|
+
'--exclude=\\.so' <<
|
88
|
+
'--exclude=lib/wx.rb' <<
|
89
|
+
'--exclude=lib/wx/*.rb' <<
|
90
|
+
"'--exclude=lib/wx/(aui|core|grid|html|pg|prt|rbn|rtc|stc|wxruby)/.*'"
|
91
|
+
gem.metadata = {
|
92
|
+
"bug_tracker_uri" => "https://github.com/mcorino/wxRuby3/issues",
|
93
|
+
"homepage_uri" => "https://github.com/mcorino/wxRuby3/wiki",
|
94
|
+
"source_code_uri" => "https://github.com/mcorino/wxRuby3",
|
95
|
+
"documentation_uri" => "https://mcorino.github.io/wxRuby3",
|
96
|
+
"github_repo" => "https://github.com/mcorino/wxRuby3"
|
97
|
+
}
|
98
|
+
gem.post_install_message = <<~__MSG
|
99
|
+
|
100
|
+
The wxRuby3 Gem has been successfully installed including the 'wxruby' utility.
|
101
|
+
|
102
|
+
In case no suitable binary release package was available for your platform you
|
103
|
+
will need to run the post-install setup process by executing:
|
104
|
+
|
105
|
+
$ wxruby setup
|
106
|
+
|
107
|
+
To check whether wxRuby3 is ready to run or not you can at any time execute the
|
108
|
+
following command:
|
109
|
+
|
110
|
+
$ wxruby check
|
111
|
+
|
112
|
+
Run 'wxruby check -h' for more information.
|
113
|
+
|
114
|
+
When the wxRuby3 setup has been fully completed you can start using wxRuby3.
|
115
|
+
|
116
|
+
You can run the regression tests to verify the installation by executing:
|
117
|
+
|
118
|
+
$ wxruby test
|
119
|
+
|
120
|
+
The wxRuby3 sample explorer can be run by executing:
|
121
|
+
|
122
|
+
$ wxruby sampler
|
123
|
+
|
124
|
+
Have fun using wxRuby3.
|
125
|
+
|
126
|
+
Run 'wxruby -h' to see information on the available commands.
|
127
|
+
|
128
|
+
__MSG
|
129
|
+
gem.required_rubygems_version = '>= 0' if gem.respond_to? :required_rubygems_version=
|
130
|
+
end
|
131
|
+
__GEMSPEC
|
132
|
+
File.open(t.name, 'w') { |f| f.puts code }
|
133
|
+
end
|
134
|
+
|
135
|
+
|
136
|
+
CLOBBER.include WXRuby3::Gem.gemspec_file
|
137
|
+
|
138
|
+
desc 'Build wxRuby 3 gemspec'
|
139
|
+
task :gemspec => 'wxruby:gem:srcgemspec'
|
140
|
+
|
141
|
+
directory 'pkg'
|
142
|
+
|
63
143
|
# source gem file
|
64
|
-
file WXRuby3::Gem.gem_file =>
|
65
|
-
|
66
|
-
gem.summary = %Q{wxWidgets extension for Ruby}
|
67
|
-
gem.description = %Q{wxRuby3 is a Ruby library providing an extension for the wxWidgets C++ UI framework}
|
68
|
-
gem.email = 'mcorino@m2c-software.nl'
|
69
|
-
gem.homepage = "https://github.com/mcorino/wxRuby3"
|
70
|
-
gem.authors = ['Martin Corino']
|
71
|
-
gem.extensions = ['ext/mkrf_conf_ext.rb']
|
72
|
-
gem.files = WXRuby3::Gem.manifest
|
73
|
-
gem.require_paths = %w{lib}
|
74
|
-
gem.bindir = 'bin'
|
75
|
-
gem.executables = WXRuby3::Bin.binaries
|
76
|
-
gem.required_ruby_version = '>= 2.5'
|
77
|
-
gem.licenses = ['MIT']
|
78
|
-
gem.add_dependency 'nokogiri', '~> 1.12'
|
79
|
-
gem.add_dependency 'rake'
|
80
|
-
gem.add_dependency 'minitest', '~> 5.15'
|
81
|
-
gem.add_dependency 'test-unit', '~> 3.5'
|
82
|
-
gem.add_dependency 'plat4m', '~> 1.1'
|
83
|
-
gem.rdoc_options <<
|
84
|
-
'--exclude=\\.dll' <<
|
85
|
-
'--exclude=\\.so' <<
|
86
|
-
'--exclude=lib/wx.rb' <<
|
87
|
-
'--exclude=lib/wx/*.rb' <<
|
88
|
-
"'--exclude=lib/wx/(aui|core|grid|html|pg|prt|rbn|rtc|stc|wxruby)/.*'"
|
89
|
-
gem.metadata = {
|
90
|
-
"bug_tracker_uri" => "https://github.com/mcorino/wxRuby3/issues",
|
91
|
-
"homepage_uri" => "https://github.com/mcorino/wxRuby3/wiki",
|
92
|
-
"source_code_uri" => "https://github.com/mcorino/wxRuby3",
|
93
|
-
"documentation_uri" => "https://mcorino.github.io/wxRuby3",
|
94
|
-
"github_repo" => "https://github.com/mcorino/wxRuby3"
|
95
|
-
}
|
96
|
-
gem.post_install_message = <<~__MSG
|
97
|
-
|
98
|
-
The wxRuby3 Gem has been successfully installed including the 'wxruby' utility.
|
99
|
-
|
100
|
-
In case no suitable binary release package was available for your platform you
|
101
|
-
will need to run the post-install setup process by executing:
|
102
|
-
|
103
|
-
$ wxruby setup
|
104
|
-
|
105
|
-
To check whether wxRuby3 is ready to run or not you can at any time execute the
|
106
|
-
following command:
|
107
|
-
|
108
|
-
$ wxruby check
|
109
|
-
|
110
|
-
Run 'wxruby check -h' for more information.
|
111
|
-
|
112
|
-
When the wxRuby3 setup has been fully completed you can start using wxRuby3.
|
113
|
-
|
114
|
-
You can run the regression tests to verify the installation by executing:
|
115
|
-
|
116
|
-
$ wxruby test
|
117
|
-
|
118
|
-
The wxRuby3 sample explorer can be run by executing:
|
119
|
-
|
120
|
-
$ wxruby sampler
|
121
|
-
|
122
|
-
Have fun using wxRuby3.
|
123
|
-
|
124
|
-
Run 'wxruby -h' to see information on the available commands.
|
125
|
-
|
126
|
-
__MSG
|
127
|
-
end
|
128
|
-
WXRuby3::Gem.build_gem(gemspec)
|
144
|
+
file WXRuby3::Gem.gem_file => ['wxruby:gem:srcgemspec', 'pkg'] do
|
145
|
+
WXRuby3.config.sh "gem build #{WXRuby3::Gem.gemspec_file} -o #{WXRuby3::Gem.gem_file}"
|
129
146
|
end
|
130
147
|
|
131
148
|
desc 'Build wxRuby 3 gem'
|
@@ -145,7 +162,7 @@ if File.file?(File.join(__dir__, 'run.rake'))
|
|
145
162
|
end
|
146
163
|
|
147
164
|
# binary package file
|
148
|
-
file WXRuby3::Gem.bin_pkg_file => WXRuby3::Gem.bin_pkg_manifest do |t|
|
165
|
+
file WXRuby3::Gem.bin_pkg_file => [*WXRuby3::Gem.bin_pkg_manifest, 'pkg'] do |t|
|
149
166
|
WXRuby3::Install.install_wxwin_shlibs
|
150
167
|
begin
|
151
168
|
# create bin package
|
data/rakelib/gem.rb
CHANGED
@@ -8,11 +8,6 @@
|
|
8
8
|
|
9
9
|
require 'set'
|
10
10
|
require 'rubygems'
|
11
|
-
require 'rubygems/package'
|
12
|
-
begin
|
13
|
-
require 'rubygems/builder'
|
14
|
-
rescue LoadError
|
15
|
-
end
|
16
11
|
require 'zlib'
|
17
12
|
require 'tempfile'
|
18
13
|
require 'json'
|
@@ -62,20 +57,12 @@ module WXRuby3
|
|
62
57
|
end
|
63
58
|
private :gem_name
|
64
59
|
|
65
|
-
def
|
66
|
-
|
60
|
+
def gemspec_file
|
61
|
+
"#{gem_name}.gemspec"
|
67
62
|
end
|
68
63
|
|
69
|
-
def
|
70
|
-
|
71
|
-
gem_file_name = ::Gem::Package.build(gemspec)
|
72
|
-
else
|
73
|
-
gem_file_name = ::Gem::Builder.new(gemspec).build
|
74
|
-
end
|
75
|
-
|
76
|
-
FileUtils.mkdir_p('pkg')
|
77
|
-
|
78
|
-
FileUtils.mv(gem_file_name, 'pkg')
|
64
|
+
def gem_file
|
65
|
+
File.join('pkg', "#{gem_name}.gem")
|
79
66
|
end
|
80
67
|
|
81
68
|
# Binary package helpers
|
@@ -122,9 +109,6 @@ module WXRuby3
|
|
122
109
|
end
|
123
110
|
|
124
111
|
def build_bin_pkg
|
125
|
-
# make sure pkg directory exists
|
126
|
-
FileUtils.mkdir_p('pkg')
|
127
|
-
|
128
112
|
fname = bin_pkg_file
|
129
113
|
|
130
114
|
# package registry and essential config
|
data/rakelib/lib/config/mingw.rb
CHANGED
@@ -177,7 +177,7 @@ module WXRuby3
|
|
177
177
|
@rescomp << ' --define __WXMSW__ --define wxUSE_DPI_AWARE_MANIFEST=2 --define wxUSE_RC_MANIFEST=1 --define ISOLATION_AWARE_ENABLED'
|
178
178
|
@rescomp << ' --define WXUSINGDLL'
|
179
179
|
@extra_cflags << '-DISOLATION_AWARE_ENABLED'
|
180
|
-
if
|
180
|
+
if wx_version_check('3.3.0') >= 0
|
181
181
|
@extra_cflags << '-D_UNICODE' << '-DUNICODE'
|
182
182
|
end
|
183
183
|
end
|
data/rakelib/lib/config.rb
CHANGED
@@ -83,10 +83,10 @@ module WXRuby3
|
|
83
83
|
CONFIG['autoinstall'] = (ENV['WXRUBY_AUTOINSTALL'] != '0') if ENV['WXRUBY_AUTOINSTALL']
|
84
84
|
BUILD_CFG = '.wxconfig'
|
85
85
|
|
86
|
-
# Ruby 2.
|
86
|
+
# Ruby 2.7 is the minimum version for wxRuby3
|
87
87
|
__rb_ver = RUBY_VERSION.split('.').collect {|v| v.to_i}
|
88
|
-
if (__rb_major = __rb_ver.shift) < 2 || (__rb_major == 2 && __rb_ver.shift <
|
89
|
-
$stderr.puts 'ERROR: wxRuby3 requires Ruby >= 2.
|
88
|
+
if (__rb_major = __rb_ver.shift) < 2 || (__rb_major == 2 && __rb_ver.shift < 7)
|
89
|
+
$stderr.puts 'ERROR: wxRuby3 requires Ruby >= 2.7.0!'
|
90
90
|
exit(1)
|
91
91
|
end
|
92
92
|
|
@@ -728,6 +728,12 @@ module WXRuby3
|
|
728
728
|
@wx_version || ''
|
729
729
|
end
|
730
730
|
|
731
|
+
def wx_version_check(ver)
|
732
|
+
@wx_version_list ||= (@wx_version || '0.0.0').split('.').collect {|s| s.to_i }
|
733
|
+
ver = ver.split('.').collect {|s| s.to_i } unless ::Array === ver
|
734
|
+
@wx_version_list <=> ver
|
735
|
+
end
|
736
|
+
|
731
737
|
def mingw?
|
732
738
|
@platform == :mingw
|
733
739
|
end
|
data/rakelib/lib/core/spec.rb
CHANGED
@@ -19,6 +19,39 @@ module WXRuby3
|
|
19
19
|
spec.disable_proxies
|
20
20
|
|
21
21
|
spec.map_apply 'int * OUTPUT' => ['wxDouble *']
|
22
|
+
spec.ignore 'wxAffineMatrix2DBase::TransformPoint(wxDouble*, wxDouble*)',
|
23
|
+
'wxAffineMatrix2DBase::TransformDistance(wxDouble*, wxDouble*)'
|
24
|
+
|
25
|
+
spec.map 'wxPoint2DDouble&' => 'Array(Float, Float), Wx::Point2DDouble' do
|
26
|
+
add_header_code '#include <memory>'
|
27
|
+
map_in temp: 'std::unique_ptr<$1_basetype> tmp', code: <<~__CODE
|
28
|
+
if ( TYPE($input) == T_DATA )
|
29
|
+
{
|
30
|
+
void* argp$argnum;
|
31
|
+
SWIG_ConvertPtr($input, &argp$argnum, $1_descriptor, 0);
|
32
|
+
$1 = reinterpret_cast< $1_basetype * >(argp$argnum);
|
33
|
+
}
|
34
|
+
else if ( TYPE($input) == T_ARRAY )
|
35
|
+
{
|
36
|
+
$1 = new $1_basetype( NUM2DBL( rb_ary_entry($input, 0) ),
|
37
|
+
NUM2DBL( rb_ary_entry($input, 1) ) );
|
38
|
+
tmp.reset($1); // auto destruct when method scope ends
|
39
|
+
}
|
40
|
+
else
|
41
|
+
{
|
42
|
+
rb_raise(rb_eTypeError, "Wrong type for $1_basetype parameter");
|
43
|
+
}
|
44
|
+
__CODE
|
45
|
+
map_typecheck precedence: 'POINTER', code: <<~__CODE
|
46
|
+
void *vptr = 0;
|
47
|
+
$1 = 0;
|
48
|
+
if (TYPE($input) == T_ARRAY && RARRAY_LEN($input) == 2)
|
49
|
+
$1 = 1;
|
50
|
+
else if (TYPE($input) == T_DATA && SWIG_CheckState (SWIG_ConvertPtr ($input, &vptr, $1_descriptor, 0)))
|
51
|
+
$1 = 1;
|
52
|
+
__CODE
|
53
|
+
end
|
54
|
+
|
22
55
|
spec.map 'wxPoint2DDouble *' => 'Wx::Point2DDouble' do
|
23
56
|
map_in ignore: true, temp: 'wxPoint2DDouble tmp', code: '$1 = &tmp;'
|
24
57
|
|
@@ -21,7 +21,7 @@ module WXRuby3
|
|
21
21
|
spec.items << 'wxGenericAnimationCtrl'
|
22
22
|
spec.include 'wx/animate.h'
|
23
23
|
spec.include 'wx/generic/animate.h'
|
24
|
-
if Config.instance.
|
24
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
25
25
|
spec.items << 'wxAnimationBundle'
|
26
26
|
spec.ignore 'wxAnimationBundle::GetAll', ignore_doc: false
|
27
27
|
spec.add_extend_code 'wxAnimationBundle', <<~__HEREDOC
|
data/rakelib/lib/director/app.rb
CHANGED
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
spec.items << 'wxAppConsole' << 'wxEventFilter'
|
19
|
-
if Config.instance.
|
19
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
20
20
|
spec.items << 'wxDarkModeSettings'
|
21
21
|
spec.ignore_unless('WXMSW', 'wxDarkModeSettings', 'wxMenuColour')
|
22
22
|
if Config.instance.features_set?('WXMSW')
|
@@ -17,7 +17,7 @@ module WXRuby3
|
|
17
17
|
def setup
|
18
18
|
super
|
19
19
|
spec.gc_as_object 'wxAuiManager'
|
20
|
-
if Config.instance.
|
20
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
21
21
|
spec.items << 'wxAuiBookSerializer' << 'wxAuiSerializer' <<
|
22
22
|
'wxAuiDockLayoutInfo' << 'wxAuiPaneLayoutInfo' << 'wxAuiTabLayoutInfo' <<
|
23
23
|
'wxAuiBookDeserializer' << 'wxAuiDeserializer'
|
@@ -303,7 +303,7 @@ module WXRuby3
|
|
303
303
|
|
304
304
|
def gen_class_doc_members(fdoc, clsdef, cls_members, alias_methods)
|
305
305
|
super
|
306
|
-
if Config.instance.
|
306
|
+
if Config.instance.wx_version_check('3.3.0') >= 0 && clsdef.name == 'wxAuiTabLayoutInfo'
|
307
307
|
fdoc.doc.puts 'Returns the indices of the pages in this tab control in their order on screen.'
|
308
308
|
fdoc.doc.puts 'If this array is empty, it means that the tab control contains all notebook pages in natural order.'
|
309
309
|
fdoc.doc.puts '@return [::Array<Integer>] indices of the pages in this tab control'
|
@@ -24,7 +24,7 @@ module WXRuby3
|
|
24
24
|
wxAuiNotebookPage::tooltip
|
25
25
|
wxAuiNotebookPage::bitmap
|
26
26
|
wxAuiNotebookPage::active]
|
27
|
-
if Config.instance.
|
27
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
28
28
|
spec.items << 'wxAuiNotebookPosition'
|
29
29
|
spec.regard 'wxAuiNotebookPosition::tabCtrl',
|
30
30
|
'wxAuiNotebookPosition::tabIdx'
|
@@ -14,7 +14,7 @@ module WXRuby3
|
|
14
14
|
|
15
15
|
def setup
|
16
16
|
super
|
17
|
-
if Config.instance.
|
17
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
18
18
|
spec.items << 'wxAuiFlatTabArt' << 'wxAuiSimpleTabArt'
|
19
19
|
spec.ignore 'wxAuiDefaultTabArt', 'wxAuiNativeTabArt'
|
20
20
|
else
|
@@ -117,7 +117,7 @@ module WXRuby3
|
|
117
117
|
|
118
118
|
def gen_interface_classes(fout)
|
119
119
|
super
|
120
|
-
if Config.instance.
|
120
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
121
121
|
fout.puts
|
122
122
|
fout.puts 'class wxAuiNativeTabArt : public wxAuiTabArt'
|
123
123
|
fout.puts '{'
|
@@ -130,7 +130,7 @@ module WXRuby3
|
|
130
130
|
class AuiTabArtDocGenerator < DocGenerator
|
131
131
|
def gen_class_doc(fdoc)
|
132
132
|
super
|
133
|
-
if Config.instance.
|
133
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
134
134
|
fdoc.doc.puts 'Wx::AUI::AuiNativeTabArt is either an art provider providing native-like appearance (WXMSW and WXGTK) or a generic Tab Art provider if not available.'
|
135
135
|
fdoc.puts 'class AuiNativeTabArt < AuiTabArt; end'
|
136
136
|
fdoc.puts
|
@@ -138,7 +138,7 @@ module WXRuby3
|
|
138
138
|
end
|
139
139
|
def gen_constants_doc(fdoc)
|
140
140
|
super
|
141
|
-
if Config.instance.
|
141
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
142
142
|
fdoc.doc.puts 'Wx::AUI::AuiDefaultTabArt is an alias for the tab art provider used by {Wx::AUI::AuiNotebook} by default.'
|
143
143
|
fdoc.doc.puts 'Since wxWidgets 3.3.0, this is {Wx::AUI::AuiFlatTabArt} under all platforms. In the previous versions, this was wxAuiNativeTabArt.'
|
144
144
|
fdoc.puts 'AuiDefaultTabArt = Wx::AUI::AuiFlatTabArt'
|
@@ -24,8 +24,10 @@ module WXRuby3
|
|
24
24
|
wxWindow
|
25
25
|
wxEvtHandler
|
26
26
|
wxObject])
|
27
|
-
|
28
|
-
|
27
|
+
if Config.instance.wx_version_check('3.3.0') <= 0
|
28
|
+
spec.ignore 'wxBitmapComboBox::Insert(const wxString &, const wxBitmap &, unsigned int, void *)',
|
29
|
+
'wxBitmapComboBox::Append(const wxString &, const wxBitmap &, void *)'
|
30
|
+
end
|
29
31
|
spec.map_apply 'long * OUTPUT' => [ 'long *from', 'long *to' ]
|
30
32
|
end
|
31
33
|
|
@@ -54,7 +54,7 @@ module WXRuby3
|
|
54
54
|
'wxItemContainer::Append(const wxArrayString &, wxClientData **)',
|
55
55
|
'wxItemContainer::Insert(const wxArrayString &, unsigned int, wxClientData **)',
|
56
56
|
'wxItemContainer::Set(const wxArrayString &, wxClientData **)'], ignore_doc: false)
|
57
|
-
if Config.instance.
|
57
|
+
if Config.instance.wx_version_check('3.3.0') < 0
|
58
58
|
# add undocumented method
|
59
59
|
spec.extend_interface 'wxControlWithItems',
|
60
60
|
'bool IsSorted() const'
|
@@ -21,8 +21,18 @@ module WXRuby3
|
|
21
21
|
'wxCursor::wxCursor(const char *const *)',
|
22
22
|
'wxCursor::wxCursor(const wxCursor &)'
|
23
23
|
spec.ignore 'wxCursor::wxCursor(const char *const *)'
|
24
|
-
if Config.instance.
|
24
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
25
25
|
spec.ignore 'wxCursor::wxCursor(const char[],int,int,int,int,const char[], const wxColour*, const wxColour*)'
|
26
|
+
|
27
|
+
spec.items << 'wxCursorBundle'
|
28
|
+
spec.gc_as_untracked 'wxCursorBundle'
|
29
|
+
# all but the default ctor require a running App
|
30
|
+
spec.require_app 'wxCursorBundle::wxCursorBundle(const wxBitmapBundle &, const wxPoint &)',
|
31
|
+
'wxCursorBundle::wxCursorBundle(const wxBitmapBundle &, int, int)',
|
32
|
+
'wxCursorBundle::wxCursorBundle(const wxCursorBundle &)'
|
33
|
+
# add undocumented but useful ctor
|
34
|
+
spec.extend_interface 'wxCursorBundle',
|
35
|
+
'wxCursorBundle(const wxCursor& cursor)'
|
26
36
|
else
|
27
37
|
spec.ignore 'wxCursor::wxCursor(const char[],int,int,int,int,const char[])'
|
28
38
|
end
|
data/rakelib/lib/director/dc.rb
CHANGED
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
super
|
19
|
-
_readDC = if Config.instance.
|
19
|
+
_readDC = if Config.instance.wx_version_check('3.3.0') >= 0
|
20
20
|
spec.items.unshift 'wxReadOnlyDC' # prepend before wxDC
|
21
21
|
spec.items << 'wxInfoDC'
|
22
22
|
'wxReadOnlyDC'
|
@@ -70,7 +70,7 @@ module WXRuby3
|
|
70
70
|
# for GetUserScale and GetLogicalScale
|
71
71
|
spec.map_apply 'double * OUTPUT' => 'double *'
|
72
72
|
spec.swig_import 'swig/classes/include/wxGDICommon.h'
|
73
|
-
if Config.instance.
|
73
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
74
74
|
# add similar block-style creator as #draw_on methods
|
75
75
|
spec.add_extend_code 'wxInfoDC', <<~__HEREDOC
|
76
76
|
static VALUE inform_on(wxWindow* win)
|