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
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
super
|
19
|
-
if Config.instance.
|
19
|
+
if Config.instance.wx_version_check('3.3.0') <= 0
|
20
20
|
# XML docs (< 3.3) incorrectly declare these pure virtual
|
21
21
|
spec.ignore 'wxHyperlinkCtrl::GetVisited', 'wxHyperlinkCtrl::SetVisited', ignore_doc: false
|
22
22
|
# replace by correct declarations
|
@@ -24,6 +24,43 @@ module WXRuby3
|
|
24
24
|
'virtual bool wxHyperlinkCtrl::GetVisited() const',
|
25
25
|
'virtual void wxHyperlinkCtrl::SetVisited(bool visited = true)'
|
26
26
|
end
|
27
|
+
|
28
|
+
def process(gendoc: false)
|
29
|
+
defmod = super
|
30
|
+
# For WXOSX wxGenericHyperlinkCtrl is functionally identical to wxHyperlinkCtrl
|
31
|
+
# so we will declare a constant for that in pure Ruby.
|
32
|
+
# In case we are generating documentation create the class def anyway so we get full docs for MacOS as well.
|
33
|
+
unless Config.instance.features_set?('WXOSX') && !gendoc
|
34
|
+
spec.include 'wx/generic/hyperlink.h'
|
35
|
+
def_hlink = defmod.find_item('wxHyperlinkCtrl')
|
36
|
+
# create a definition for 'wxGenericHyperlinkCtrl' which is not documented
|
37
|
+
def_genhlink = def_hlink.dup
|
38
|
+
def_genhlink.name = 'wxGenericHyperlinkCtrl'
|
39
|
+
def_genhlink.items = def_genhlink.items.collect { |itm| itm.dup }
|
40
|
+
def_genhlink.items.each do |itm|
|
41
|
+
if itm.is_a?(Extractor::MethodDef)
|
42
|
+
itm.overloads = itm.overloads.collect { |ovl| ovl.dup }
|
43
|
+
itm.all.each do |ovl|
|
44
|
+
ovl.name = 'wxGenericHyperlinkCtrl' if ovl.is_ctor
|
45
|
+
ovl.class_name = 'wxGenericHyperlinkCtrl'
|
46
|
+
ovl.update_attributes(klass: def_genhlink)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
defmod.items << def_genhlink
|
51
|
+
if Config.instance.wx_version_check('3.3.0') <= 0
|
52
|
+
# the interface extensions to fix the incorrectly pure virtual declared methods are missing
|
53
|
+
spec.extend_interface 'wxGenericHyperlinkCtrl',
|
54
|
+
'virtual bool wxGenericHyperlinkCtrl::GetVisited() const',
|
55
|
+
'virtual void wxGenericHyperlinkCtrl::SetVisited(bool visited = true)'
|
56
|
+
end
|
57
|
+
# as we already called super before adding wxGenericHyperlinkCtrl the no_proxy settings from the
|
58
|
+
# base Window director are missing; just copy all those set for wxStaticBitmap
|
59
|
+
list = spec.no_proxies.select { |name| name.start_with?('wxHyperlinkCtrl::') }
|
60
|
+
spec.no_proxy(*list.collect { |name| name.sub(/\AwxHyperlinkCtrl::/, 'wxGenericHyperlinkCtrl::')})
|
61
|
+
end
|
62
|
+
defmod
|
63
|
+
end
|
27
64
|
end
|
28
65
|
end # class HyperlinkCtrl
|
29
66
|
|
@@ -24,7 +24,7 @@ module WXRuby3
|
|
24
24
|
spec.ignore_unless('USE_ACCEL', 'wxMenuItem::GetAccel')
|
25
25
|
spec.no_proxy 'wxMenuItem::GetAccel'
|
26
26
|
spec.ignore 'wxMenuItem::GetBitmap(bool)' # not portable
|
27
|
-
if Config.instance.
|
27
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
28
28
|
spec.ignore_unless('WXMSW', 'wxMenuItem::SetBackgroundColour','wxMenuItem::SetFont','wxMenuItem::SetTextColour')
|
29
29
|
end
|
30
30
|
super
|
@@ -14,10 +14,14 @@ module WXRuby3
|
|
14
14
|
|
15
15
|
def setup
|
16
16
|
spec.items << 'wxPersistentTLW' << 'wxPersistentBookCtrl' << 'wxPersistentTreeBookCtrl'
|
17
|
-
if Config.instance.
|
17
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
18
18
|
# only after 3.2.4 properly available
|
19
19
|
spec.items << 'wxPersistentComboBox'
|
20
20
|
end
|
21
|
+
if Config.instance.wx_version_check('3.3.0') > 0
|
22
|
+
# only after 3.3.0 available
|
23
|
+
spec.items << 'wxPersistentCheckBox' << 'wxPersistentRadioButton'
|
24
|
+
end
|
21
25
|
super
|
22
26
|
spec.gc_as_marked
|
23
27
|
spec.use_template_as_class('wxPersistentWindow', 'wxPersistentWindowBase')
|
@@ -57,13 +61,25 @@ module WXRuby3
|
|
57
61
|
spec.extend_interface 'wxPersistentTreeBookCtrl',
|
58
62
|
'virtual wxString GetKind() const override'
|
59
63
|
spec.do_not_generate :functions, :defines, :typedefs, :variables, :enums
|
60
|
-
if Config.instance.
|
64
|
+
if Config.instance.wx_version_check('3.0.0') >= 0
|
61
65
|
# wxPersistentComboBox
|
62
66
|
spec.override_inheritance_chain('wxPersistentComboBox', [{ 'wxPersistentWindowBase' => 'wxPersistentWindow' }, 'wxPersistentObject'])
|
63
67
|
# add method override missing from docs
|
64
68
|
spec.extend_interface 'wxPersistentComboBox',
|
65
69
|
'virtual wxString GetKind() const override'
|
66
70
|
end
|
71
|
+
if Config.instance.wx_version_check('3.3.0') > 0
|
72
|
+
# wxPersistentCheckBox
|
73
|
+
spec.override_inheritance_chain('wxPersistentCheckBox', [{ 'wxPersistentWindowBase' => 'wxPersistentWindow' }, 'wxPersistentObject'])
|
74
|
+
# add method override missing from docs
|
75
|
+
spec.extend_interface 'wxPersistentCheckBox',
|
76
|
+
'virtual wxString GetKind() const override'
|
77
|
+
# wxPersistentRadioButton
|
78
|
+
spec.override_inheritance_chain('wxPersistentRadioButton', [{ 'wxPersistentWindowBase' => 'wxPersistentWindow' }, 'wxPersistentObject'])
|
79
|
+
# add method override missing from docs
|
80
|
+
spec.extend_interface 'wxPersistentRadioButton',
|
81
|
+
'virtual wxString GetKind() const override'
|
82
|
+
end
|
67
83
|
end
|
68
84
|
|
69
85
|
end
|
@@ -17,7 +17,7 @@ module WXRuby3
|
|
17
17
|
spec.items.concat %w[wxPGCheckBoxEditor wxPGChoiceEditor wxPGChoiceAndButtonEditor wxPGComboBoxEditor
|
18
18
|
wxPGTextCtrlEditor wxPGSpinCtrlEditor wxPGTextCtrlAndButtonEditor wxPGEditorDialogAdapter]
|
19
19
|
spec.includes << 'wx/propgrid/propgriddefs.h'
|
20
|
-
if Config.instance.
|
20
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
21
21
|
# make sure SWIG knows this as enum type
|
22
22
|
spec.add_swig_code 'enum wxPGPropertyFlags;'
|
23
23
|
end
|
@@ -65,7 +65,7 @@ module WXRuby3
|
|
65
65
|
'wxUIntProperty::m_prefix',
|
66
66
|
'wxDateProperty::m_format',
|
67
67
|
'wxDateProperty::m_dpStyle'
|
68
|
-
if Config.instance.
|
68
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
69
69
|
# currently missing from interface docs
|
70
70
|
spec.extend_interface 'wxEnumProperty',
|
71
71
|
'bool ValueFromString_(wxVariant& value, int* pIndex, const wxString& text,int argFlags) const',
|
@@ -111,7 +111,7 @@ module WXRuby3
|
|
111
111
|
end
|
112
112
|
# make sure the derived Enum property classes provide the protected accessors too
|
113
113
|
%w[wxCursorProperty wxEditEnumProperty wxSystemColourProperty wxColourProperty].each do |kls|
|
114
|
-
if Config.instance.
|
114
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
115
115
|
# currently missing from interface docs
|
116
116
|
spec.extend_interface kls,
|
117
117
|
'int GetIndex() const',
|
@@ -136,12 +136,12 @@ module WXRuby3
|
|
136
136
|
'wxLongStringProperty::DisplayEditorDialog',
|
137
137
|
'wxMultiChoiceProperty::DisplayEditorDialog',
|
138
138
|
'wxFontProperty::DisplayEditorDialog'
|
139
|
-
if Config.instance.
|
139
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
140
140
|
# for wxEnumProperty and derivatives ValueFromString_/ValueFromInt_
|
141
141
|
spec.map_apply 'int * OUTPUT' => 'int* pIndex'
|
142
142
|
end
|
143
143
|
# for UIntProperty and IntProperty
|
144
|
-
if Config.instance.features_set?('USE_LONGLONG') || Config.instance.
|
144
|
+
if Config.instance.features_set?('USE_LONGLONG') || Config.instance.wx_version_check('3.3.0') >= 0
|
145
145
|
# wxLongLong mapping to be considered before considering 'long' (see typecheck precedence)
|
146
146
|
spec.map 'const wxLongLong&' => 'Integer' do
|
147
147
|
map_in temp: 'wxLongLong tmp', code: <<~__CODE
|
@@ -120,9 +120,10 @@ module WXRuby3
|
|
120
120
|
# do not think this useful for wxRuby (Also; caused GC problems)
|
121
121
|
spec.ignore 'wxPGProperty::GetCellRenderer'
|
122
122
|
# obsolete
|
123
|
-
if Config.instance.
|
124
|
-
spec.ignore
|
125
|
-
|
123
|
+
if Config.instance.wx_version_check('3.3.0') < 0
|
124
|
+
spec.ignore 'wxPGProperty::GetValueString'
|
125
|
+
end
|
126
|
+
if Config.instance.wx_version_check('3.3.0') <= 0
|
126
127
|
spec.ignore 'wxPGProperty::AddChild'
|
127
128
|
end
|
128
129
|
# not of use in Ruby
|
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
super
|
17
17
|
spec.items << 'propgrid/propgrid.h'
|
18
18
|
spec.gc_as_untracked 'wxPGValidationInfo'
|
19
|
-
if Config.instance.
|
19
|
+
if Config.instance.wx_version_check('3.3.0') < 0
|
20
20
|
spec.ignore 'wxPGVFBFlags' # not a constant but a rather a clumsy typedef
|
21
21
|
spec.map 'wxPGVFBFlags' => 'Integer' do
|
22
22
|
map_in code: '$1 = (unsigned char)NUM2UINT($input);'
|
@@ -23,7 +23,7 @@ module WXRuby3
|
|
23
23
|
# only keep the const version
|
24
24
|
spec.ignore 'wxPageSetupDialogData::GetPrintData'
|
25
25
|
spec.regard 'wxPageSetupDialogData::GetPrintData() const'
|
26
|
-
if Config.instance.
|
26
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
27
27
|
# new since 3.3.0
|
28
28
|
spec.items << 'wxPrintPageRange'
|
29
29
|
spec.regard 'wxPrintPageRange::fromPage', 'wxPrintPageRange::toPage' # include public attributes
|
@@ -18,7 +18,7 @@ module WXRuby3
|
|
18
18
|
|
19
19
|
def setup
|
20
20
|
super
|
21
|
-
if Config.instance.
|
21
|
+
if Config.instance.wx_version_check('3.3.0') < 0
|
22
22
|
spec.map 'wxPGVFBFlags' => 'Integer' do
|
23
23
|
map_in code: '$1 = (unsigned char)NUM2UINT($input);'
|
24
24
|
map_out code: '$result = UINT2NUM((unsigned int)$1);'
|
@@ -38,7 +38,7 @@ module WXRuby3
|
|
38
38
|
__HEREDOC
|
39
39
|
spec.use_class_implementation 'wxPropertyGridPage', 'WXRubyPropertyGridPage'
|
40
40
|
spec.ignore 'wxPropertyGridPage::GetStatePtr'
|
41
|
-
if Config.instance.
|
41
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
42
42
|
spec.ignore 'wxPropertyGridPageState::DoSetSplitter'
|
43
43
|
else
|
44
44
|
spec.ignore 'wxPropertyGridPageState::DoSetSplitterPosition'
|
@@ -21,7 +21,7 @@ module WXRuby3
|
|
21
21
|
spec.disable_proxies
|
22
22
|
spec.ignore 'wxPropertyGridPageState::DoDelete',
|
23
23
|
'wxPropertyGridPageState::DoInsert'
|
24
|
-
if Config.instance.
|
24
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
25
25
|
spec.ignore 'wxPropertyGridPageState::DoSetSplitter'
|
26
26
|
else
|
27
27
|
spec.ignore 'wxPropertyGridPageState::DoSetSplitterPosition'
|
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
super
|
19
|
-
if Config.instance.
|
19
|
+
if Config.instance.wx_version_check('3.2.2.1') <= 0
|
20
20
|
# In older versions a bug exists in wxRibbonToolBar::GetToolByPos and wxRibbonToolBar::DeleteToolByPos
|
21
21
|
# so we use a wxRuby custom derived class
|
22
22
|
spec.add_header_code <<~__HEREDOC
|
@@ -20,7 +20,7 @@ module WXRuby3
|
|
20
20
|
super
|
21
21
|
spec.items << 'wxRichTextFontTable' << 'wxRichTextFieldType' << 'wxRichTextFieldTypeStandard' << 'wxRichTextDrawingHandler'
|
22
22
|
spec.make_abstract 'wxRichTextFieldType'
|
23
|
-
if Config.instance.
|
23
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
24
24
|
# make Ruby director and wrappers use custom implementation
|
25
25
|
spec.use_class_implementation('wxRichTextFieldType', 'wxRubyRichTextFieldType')
|
26
26
|
spec.add_header_code <<~__HEREDOC
|
@@ -27,7 +27,7 @@ module WXRuby3
|
|
27
27
|
wxRichTextFormattingDialog::SetStyle
|
28
28
|
wxRichTextFormattingDialog::SetStyleDefinition
|
29
29
|
]
|
30
|
-
if Config.instance.
|
30
|
+
if Config.instance.wx_version_check('3.3.0') < 0
|
31
31
|
# add undocumented methods
|
32
32
|
spec.extend_interface 'wxRichTextFormattingDialog',
|
33
33
|
'wxRichTextObject* GetObject() const',
|
@@ -83,7 +83,7 @@ module WXRuby3
|
|
83
83
|
return rb_rtsd;
|
84
84
|
}
|
85
85
|
__HEREDOC
|
86
|
-
if Config.instance.
|
86
|
+
if Config.instance.wx_version_check('3.3.0') < 0
|
87
87
|
# add undocumented convenience method
|
88
88
|
spec.extend_interface 'wxRichTextListStyleDefinition',
|
89
89
|
'void SetAttributes(int i, int leftIndent, int leftSubIndent, int bulletStyle, const wxString& bulletSymbol = wxEmptyString)'
|
@@ -22,7 +22,11 @@ module WXRuby3
|
|
22
22
|
spec.items << 'wxRichTextStyleListCtrl' << 'wxRichTextStyleComboCtrl'
|
23
23
|
spec.include 'wx/odcombo.h'
|
24
24
|
spec.add_header_code 'extern VALUE wxRuby_RichTextStyleDefinition2Ruby(const wxRichTextStyleDefinition *wx_rtsd, int own);'
|
25
|
-
|
25
|
+
if Config.instance.wx_version_check('3.3.0') > 0
|
26
|
+
spec.override_inheritance_chain('wxRichTextStyleListBox', ['wxHtmlListBox', 'wxVListBox', 'wxVScrolledWindow', 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
|
27
|
+
else
|
28
|
+
spec.override_inheritance_chain('wxRichTextStyleListBox', ['wxHtmlListBox', 'wxVListBox', { 'wxVScrolledWindow' => 'wxHScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
|
29
|
+
end
|
26
30
|
spec.override_inheritance_chain('wxRichTextStyleComboCtrl',
|
27
31
|
%w[wxComboCtrl
|
28
32
|
wxControl
|
@@ -33,6 +37,9 @@ module WXRuby3
|
|
33
37
|
spec.extend_interface 'wxRichTextStyleComboCtrl',
|
34
38
|
'virtual void DoSetPopupControl(wxComboPopup* popup)',
|
35
39
|
visibility: 'protected'
|
40
|
+
# optimize; no need for these virtuals here
|
41
|
+
spec.no_proxy 'wxRichTextStyleListBox::OnGetRowHeight',
|
42
|
+
'wxRichTextStyleListBox::OnGetRowsHeightHint'
|
36
43
|
end
|
37
44
|
|
38
45
|
end
|
@@ -63,8 +63,30 @@ module WXRuby3
|
|
63
63
|
spec.ignore 'wxScrolled::GetViewStart(int *,int *)'
|
64
64
|
spec.map_apply 'int * OUTPUT' => 'int *'
|
65
65
|
end
|
66
|
+
|
67
|
+
def doc_generator
|
68
|
+
ScrolledTDocGenerator.new(self)
|
69
|
+
end
|
70
|
+
|
66
71
|
end # class ScrolledT
|
67
72
|
|
73
|
+
class ScrolledTDocGenerator < DocGenerator
|
74
|
+
|
75
|
+
def get_method_doc(mtd)
|
76
|
+
mtd_doc = super
|
77
|
+
mtd_doc.each_pair do |_name, docs|
|
78
|
+
docs.each do |_ovl, _params, ovl_doc|
|
79
|
+
ovl_doc.each do |line|
|
80
|
+
line.gsub!(/Wx::Scrolled#(\w+)/, "{#{director.spec.module_name.sub(/^wx/, 'Wx::')}#\\1}")
|
81
|
+
line.gsub!(/\{Wx::Scrolled}/, "{#{director.spec.module_name.sub(/^wx/, 'Wx::')}}")
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
mtd_doc
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
68
90
|
end # class Director
|
69
91
|
|
70
92
|
end # module WXRuby3
|
@@ -182,6 +182,27 @@ module WXRuby3
|
|
182
182
|
spec.no_proxy "#{spec.module_name}::AddSpacer"
|
183
183
|
super
|
184
184
|
end
|
185
|
+
|
186
|
+
def process(gendoc: false)
|
187
|
+
defmod = super
|
188
|
+
# for all wxSizer (derived) classes
|
189
|
+
spec.items.each do |citem|
|
190
|
+
def_item = defmod.find_item(citem)
|
191
|
+
if Extractor::ClassDef === def_item && (citem != 'wxSizer' && spec.is_derived_from?(def_item, 'wxSizer'))
|
192
|
+
unless spec.abstract?(def_item.name) || (def_item.abstract && !spec.concrete?(def_item.name))
|
193
|
+
# specify optional block arg acceptance for all constructors of concrete derived Sizer classes
|
194
|
+
ctor_def = def_item.methods.find { |mtd| mtd.is_ctor }
|
195
|
+
if ctor_def
|
196
|
+
ctor_def.accept_block_arg.yield('sizer', "new Sizer instance")
|
197
|
+
else
|
198
|
+
STDERR.puts "INFO: cannot find ctor for #{def_item.name} module #{spec.module_name}"
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
defmod
|
204
|
+
end
|
205
|
+
|
185
206
|
end # class Object
|
186
207
|
|
187
208
|
end # class Director
|
@@ -20,11 +20,11 @@ module WXRuby3
|
|
20
20
|
spec.include_mixin 'wxTextCtrl', { 'Wx::TextEntry' => 'wxTextEntryBase' }
|
21
21
|
spec.override_inheritance_chain('wxTextCtrl', %w[wxControl wxWindow wxEvtHandler wxObject])
|
22
22
|
spec.ignore 'wxTextCtrl::HitTest(const wxPoint &,long *)'
|
23
|
-
if Config.instance.wx_port == :wxgtk && Config.instance.
|
23
|
+
if Config.instance.wx_port == :wxgtk && Config.instance.wx_version_check('3.3.0') >= 0
|
24
24
|
spec.ignore 'wxTextCtrl::GTKGetTextBuffer',
|
25
25
|
'wxTextCtrl::GTKGetEditable'
|
26
26
|
end
|
27
|
-
if Config.instance.
|
27
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
28
28
|
spec.items << 'wxTextSearch' << 'wxTextSearchResult'
|
29
29
|
spec.regard 'wxTextSearch::m_searchValue',
|
30
30
|
'wxTextSearch::m_startingPosition',
|
@@ -78,7 +78,6 @@ module WXRuby3
|
|
78
78
|
"#{spec.class_name(citem)}::Maximize",
|
79
79
|
"#{spec.class_name(citem)}::Navigate",
|
80
80
|
"#{spec.class_name(citem)}::Refresh",
|
81
|
-
"#{spec.class_name(citem)}::Reparent",
|
82
81
|
"#{spec.class_name(citem)}::RequestUserAttention",
|
83
82
|
"#{spec.class_name(citem)}::Restore",
|
84
83
|
"#{spec.class_name(citem)}::SetIcon",
|
@@ -50,7 +50,7 @@ module WXRuby3
|
|
50
50
|
wxTreeCtrl::GetFirstChild
|
51
51
|
wxTreeCtrl::GetNextChild
|
52
52
|
]
|
53
|
-
if Config.instance.
|
53
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
54
54
|
# new method with bitmap bundle vector
|
55
55
|
spec.no_proxy 'wxTreeCtrl::SetStateImages'
|
56
56
|
spec.map 'const wxVector<wxBitmapBundle>& images' => 'Array<Wx::ImageBundle>' do
|
@@ -37,11 +37,13 @@ module WXRuby3
|
|
37
37
|
wxMicroSleep
|
38
38
|
wxMilliSleep
|
39
39
|
wxSleep
|
40
|
-
wxUsleep
|
41
40
|
wxNow
|
42
41
|
wxDecToHex
|
43
42
|
wxHexToDec
|
44
43
|
]
|
44
|
+
if Config.instance.wx_version_check('3.3.0') <= 0
|
45
|
+
spec.ignore 'wxUsleep'
|
46
|
+
end
|
45
47
|
# ignore these enum(erator)s
|
46
48
|
spec.ignore %w[
|
47
49
|
wxSignal
|
@@ -61,7 +63,7 @@ module WXRuby3
|
|
61
63
|
spec.ignore 'wxGetEmailAddress(char *,int)',
|
62
64
|
'wxGetUserId(char *,int)',
|
63
65
|
'wxGetUserName(char *,int)'
|
64
|
-
if Config.instance.
|
66
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
65
67
|
spec.ignore_unless('WXMSW', 'wxMSWIsOnSecureScreen')
|
66
68
|
end
|
67
69
|
spec.map 'wxMemorySize' => 'Integer' do
|
@@ -114,6 +114,16 @@ module WXRuby3
|
|
114
114
|
}
|
115
115
|
return wxVariant(arrs);
|
116
116
|
}
|
117
|
+
if ((RARRAY_LEN(rbval) > 0 && TYPE(rb_ary_entry(rbval, 0)) == T_FIXNUM))
|
118
|
+
{
|
119
|
+
wxArrayInt arri;
|
120
|
+
for (int i = 0; i < RARRAY_LEN(rbval); i++)
|
121
|
+
{
|
122
|
+
VALUE num = rb_ary_entry(rbval, i);
|
123
|
+
arri.Add(NUM2INT(num));
|
124
|
+
}
|
125
|
+
return WXVARIANT(arri);
|
126
|
+
}
|
117
127
|
if (RARRAY_LEN(rbval) == 0 ||
|
118
128
|
rb_obj_is_kind_of(rb_ary_entry(rbval, 0), rb_const_get(mWxCore, var_Variant_id())))
|
119
129
|
{
|
@@ -170,6 +180,12 @@ module WXRuby3
|
|
170
180
|
}
|
171
181
|
__HEREDOC
|
172
182
|
spec.add_extend_code 'wxVariant', <<~__HEREDOC
|
183
|
+
wxVariant(const wxArrayInt& val, const wxString &name=wxEmptyString)
|
184
|
+
{
|
185
|
+
wxVariant var(0L, name);
|
186
|
+
var << val;
|
187
|
+
return new wxVariant(var);
|
188
|
+
}
|
173
189
|
wxVariant(const wxFont& val, const wxString &name=wxEmptyString)
|
174
190
|
{
|
175
191
|
wxVariant var(0L, name);
|
@@ -188,6 +204,10 @@ module WXRuby3
|
|
188
204
|
var << val;
|
189
205
|
return new wxVariant(var);
|
190
206
|
}
|
207
|
+
wxArrayInt GetArrayInt()
|
208
|
+
{
|
209
|
+
wxArrayInt arri; arri << *self; return arri;
|
210
|
+
}
|
191
211
|
wxFont GetFont()
|
192
212
|
{
|
193
213
|
wxFont font; font << *self; return font;
|
@@ -227,7 +247,7 @@ module WXRuby3
|
|
227
247
|
$1 = rb_obj_is_kind_of($input, rb_const_get(mWxPG, var_ColourPropertyValue_id()));
|
228
248
|
__CODE
|
229
249
|
end
|
230
|
-
if Config.instance.features_set?('USE_LONGLONG') || Config.instance.
|
250
|
+
if Config.instance.features_set?('USE_LONGLONG') || Config.instance.wx_version_check('3.3.0') >= 0
|
231
251
|
# wxLongLong mapping to be considered before considering 'long' (see typecheck precedence)
|
232
252
|
spec.map 'wxLongLong' => 'Integer' do
|
233
253
|
map_in code: <<~__CODE
|
@@ -292,6 +312,12 @@ module WXRuby3
|
|
292
312
|
$1 = (TYPE($input) == T_TRUE) || (TYPE($input) == T_FALSE);
|
293
313
|
__CODE
|
294
314
|
end
|
315
|
+
# override typecheck for wxArrayInt as we also have to consider
|
316
|
+
# wxVariantList and wxArrayString
|
317
|
+
spec.map 'const wxArrayInt&' do
|
318
|
+
map_typecheck precedence: 'INT32_ARRAY',
|
319
|
+
code: '$1 = ((TYPE($input) == T_ARRAY) && (RARRAY_LEN($input) > 0) && (TYPE(rb_ary_entry($input, 0)) == T_FIXNUM));'
|
320
|
+
end
|
295
321
|
# override typecheck for wxArrayString as we also have to consider
|
296
322
|
# wxVariantList
|
297
323
|
spec.map 'const wxArrayString&' do
|
@@ -506,6 +532,8 @@ module WXRuby3
|
|
506
532
|
{ (*self) = v; }
|
507
533
|
void assign(const wxArrayString& v)
|
508
534
|
{ (*self) = v; }
|
535
|
+
void assign(const wxArrayInt& v)
|
536
|
+
{ (*self) << v; }
|
509
537
|
|
510
538
|
VALUE to_i()
|
511
539
|
{
|
@@ -16,7 +16,11 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
super
|
19
|
-
|
19
|
+
if Config.instance.wx_version_check('3.3.0') > 0
|
20
|
+
spec.override_inheritance_chain('wxVListBox', [{ 'wxVScrolledWindow' => 'wxVScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
|
21
|
+
else
|
22
|
+
spec.override_inheritance_chain('wxVListBox', [{ 'wxVScrolledWindow' => 'wxHScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
|
23
|
+
end
|
20
24
|
spec.make_abstract 'wxVListBox'
|
21
25
|
# provide base implementations for OnDrawItem and OnMeasureItem
|
22
26
|
spec.add_header_code <<~__HEREDOC
|
@@ -31,11 +35,10 @@ module WXRuby3
|
|
31
35
|
protected:
|
32
36
|
virtual void OnDrawItem(wxDC&, const wxRect&, size_t) const
|
33
37
|
{
|
34
|
-
rb_raise(rb_eNoMethodError, "Not implemented");
|
35
38
|
}
|
36
39
|
virtual wxCoord OnMeasureItem(size_t) const
|
37
40
|
{
|
38
|
-
|
41
|
+
return {};
|
39
42
|
}
|
40
43
|
};
|
41
44
|
__HEREDOC
|
@@ -49,6 +52,9 @@ module WXRuby3
|
|
49
52
|
# ignore these very un-Ruby methods
|
50
53
|
spec.ignore 'wxVListBox::GetFirstSelected',
|
51
54
|
'wxVListBox::GetNextSelected'
|
55
|
+
# optimize; no need for these virtuals here
|
56
|
+
spec.no_proxy 'wxVListBox::OnGetRowHeight',
|
57
|
+
'wxVListBox::OnGetRowsHeightHint'
|
52
58
|
# add rubified API (finish in pure Ruby)
|
53
59
|
spec.add_extend_code 'wxVListBox', <<~__HEREDOC
|
54
60
|
VALUE each_selected()
|
@@ -126,7 +126,7 @@ module WXRuby3
|
|
126
126
|
# protected for wxQT; ignore for now
|
127
127
|
spec.ignore 'wxWindow::EnableTouchEvents'
|
128
128
|
end
|
129
|
-
if Config.instance.
|
129
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
130
130
|
spec.ignore_unless('WXMSW', 'wxWindow::MSWDisableComposited')
|
131
131
|
spec.ignore('wxWindow::GTKGetWin32Handle')
|
132
132
|
end
|
@@ -135,7 +135,7 @@ module WXRuby3
|
|
135
135
|
else
|
136
136
|
spec.ignore('wxWindow::SetAccessible',
|
137
137
|
'wxWindow::GetAccessible')
|
138
|
-
if Config.instance.
|
138
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
139
139
|
spec.ignore('wxWindow::CreateAccessible',
|
140
140
|
'wxWindow::GetOrCreateAccessible')
|
141
141
|
end
|
@@ -262,6 +262,17 @@ module WXRuby3
|
|
262
262
|
spec.items.each do |citem|
|
263
263
|
def_item = defmod.find_item(citem)
|
264
264
|
if Extractor::ClassDef === def_item && (citem == 'wxWindow' || spec.is_derived_from?(def_item, 'wxWindow'))
|
265
|
+
unless %w[wxNonOwnedWindow wxTopLevelWindow].include?(citem) ||
|
266
|
+
spec.abstract?(def_item.name) || (def_item.abstract && !spec.concrete?(def_item.name))
|
267
|
+
# specify optional block arg acceptance for all constructors of concrete (derived) Window classes
|
268
|
+
# EXCEPT the default ctor (only used for XRC and such).
|
269
|
+
ctor_def = def_item.methods.find { |mtd| mtd.is_ctor }
|
270
|
+
if ctor_def
|
271
|
+
ctor_def.accept_block_arg(true).yield('win', "new instance")
|
272
|
+
else
|
273
|
+
STDERR.puts "INFO: cannot find ctor for #{def_item.name} module #{spec.module_name}"
|
274
|
+
end
|
275
|
+
end
|
265
276
|
# Avoid adding unneeded directors
|
266
277
|
spec.no_proxy("#{spec.class_name(citem)}::AddChild",
|
267
278
|
"#{spec.class_name(citem)}::Fit",
|
@@ -323,9 +334,10 @@ module WXRuby3
|
|
323
334
|
"#{spec.class_name(citem)}::EnableTouchEvents",
|
324
335
|
"#{spec.class_name(citem)}::WarpPointer",
|
325
336
|
"#{spec.class_name(citem)}::AdjustForLayoutDirection",
|
326
|
-
"#{spec.class_name(citem)}::IsTransparentBackgroundSupported"
|
337
|
+
"#{spec.class_name(citem)}::IsTransparentBackgroundSupported",
|
338
|
+
"#{spec.class_name(citem)}::Reparent")
|
327
339
|
if Config.instance.features_set?('USE_ACCESSIBILITY')
|
328
|
-
if Config.instance.
|
340
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
329
341
|
spec.no_proxy "#{spec.class_name(citem)}::CreateAccessible"
|
330
342
|
end
|
331
343
|
end
|