wxruby3 1.5.4 → 1.6.0
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/ext/wxruby3/swig/RubyStockObjects.i +1 -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/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 +18 -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 +1 -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 +1 -1
- data/lib/wx/version.rb +1 -1
- data/rakelib/lib/config/mingw.rb +1 -1
- data/rakelib/lib/config.rb +6 -0
- 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/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 +6 -5
- data/rakelib/lib/director/hvscrolled_window.rb +140 -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 +2 -2
- data/rakelib/lib/director/pgeditor.rb +1 -1
- data/rakelib/lib/director/pgproperties.rb +4 -4
- data/rakelib/lib/director/pgproperty.rb +1 -1
- 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 +2 -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/tree_ctrl.rb +1 -1
- data/rakelib/lib/director/utils.rb +1 -1
- data/rakelib/lib/director/variant.rb +1 -1
- data/rakelib/lib/director/vlistbox.rb +5 -3
- data/rakelib/lib/director/window.rb +14 -3
- 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 +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
- metadata +12 -6
- 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
@@ -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,7 @@ 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
|
-
spec.override_inheritance_chain('wxRichTextStyleListBox',
|
25
|
+
spec.override_inheritance_chain('wxRichTextStyleListBox', ['wxHtmlListBox', 'wxVListBox', { 'wxVScrolledWindow' => 'wxHVScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
|
26
26
|
spec.override_inheritance_chain('wxRichTextStyleComboCtrl',
|
27
27
|
%w[wxComboCtrl
|
28
28
|
wxControl
|
@@ -33,6 +33,7 @@ module WXRuby3
|
|
33
33
|
spec.extend_interface 'wxRichTextStyleComboCtrl',
|
34
34
|
'virtual void DoSetPopupControl(wxComboPopup* popup)',
|
35
35
|
visibility: 'protected'
|
36
|
+
spec.no_proxy 'wxVListBox::OnGetRowHeight'
|
36
37
|
end
|
37
38
|
|
38
39
|
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',
|
@@ -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
|
@@ -61,7 +61,7 @@ module WXRuby3
|
|
61
61
|
spec.ignore 'wxGetEmailAddress(char *,int)',
|
62
62
|
'wxGetUserId(char *,int)',
|
63
63
|
'wxGetUserName(char *,int)'
|
64
|
-
if Config.instance.
|
64
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
65
65
|
spec.ignore_unless('WXMSW', 'wxMSWIsOnSecureScreen')
|
66
66
|
end
|
67
67
|
spec.map 'wxMemorySize' => 'Integer' do
|
@@ -227,7 +227,7 @@ module WXRuby3
|
|
227
227
|
$1 = rb_obj_is_kind_of($input, rb_const_get(mWxPG, var_ColourPropertyValue_id()));
|
228
228
|
__CODE
|
229
229
|
end
|
230
|
-
if Config.instance.features_set?('USE_LONGLONG') || Config.instance.
|
230
|
+
if Config.instance.features_set?('USE_LONGLONG') || Config.instance.wx_version_check('3.3.0') >= 0
|
231
231
|
# wxLongLong mapping to be considered before considering 'long' (see typecheck precedence)
|
232
232
|
spec.map 'wxLongLong' => 'Integer' do
|
233
233
|
map_in code: <<~__CODE
|
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
super
|
19
|
-
spec.override_inheritance_chain('wxVListBox',
|
19
|
+
spec.override_inheritance_chain('wxVListBox', [{ 'wxVScrolledWindow' => 'wxHVScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
|
20
20
|
spec.make_abstract 'wxVListBox'
|
21
21
|
# provide base implementations for OnDrawItem and OnMeasureItem
|
22
22
|
spec.add_header_code <<~__HEREDOC
|
@@ -31,11 +31,10 @@ module WXRuby3
|
|
31
31
|
protected:
|
32
32
|
virtual void OnDrawItem(wxDC&, const wxRect&, size_t) const
|
33
33
|
{
|
34
|
-
rb_raise(rb_eNoMethodError, "Not implemented");
|
35
34
|
}
|
36
35
|
virtual wxCoord OnMeasureItem(size_t) const
|
37
36
|
{
|
38
|
-
|
37
|
+
return {};
|
39
38
|
}
|
40
39
|
};
|
41
40
|
__HEREDOC
|
@@ -49,6 +48,9 @@ module WXRuby3
|
|
49
48
|
# ignore these very un-Ruby methods
|
50
49
|
spec.ignore 'wxVListBox::GetFirstSelected',
|
51
50
|
'wxVListBox::GetNextSelected'
|
51
|
+
# optimize; no need for these virtuals here
|
52
|
+
spec.no_proxy 'wxVListBox::OnGetRowHeight',
|
53
|
+
'wxVListBox::OnGetRowsHeightHint'
|
52
54
|
# add rubified API (finish in pure Ruby)
|
53
55
|
spec.add_extend_code 'wxVListBox', <<~__HEREDOC
|
54
56
|
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",
|
@@ -325,7 +336,7 @@ module WXRuby3
|
|
325
336
|
"#{spec.class_name(citem)}::AdjustForLayoutDirection",
|
326
337
|
"#{spec.class_name(citem)}::IsTransparentBackgroundSupported")
|
327
338
|
if Config.instance.features_set?('USE_ACCESSIBILITY')
|
328
|
-
if Config.instance.
|
339
|
+
if Config.instance.wx_version_check('3.2.4') > 0
|
329
340
|
spec.no_proxy "#{spec.class_name(citem)}::CreateAccessible"
|
330
341
|
end
|
331
342
|
end
|
@@ -15,6 +15,20 @@ module WXRuby3
|
|
15
15
|
|
16
16
|
include Util::StringUtil
|
17
17
|
|
18
|
+
class Block
|
19
|
+
def initialize(exclude_default=false)
|
20
|
+
@yield_param = []
|
21
|
+
@exclude_default = exclude_default
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_reader :yield_param, :exclude_default
|
25
|
+
|
26
|
+
def yield(name, desc, type: nil)
|
27
|
+
@yield_param << {name: name, desc: desc, type: type}
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
18
32
|
def initialize(element = nil, **kwargs)
|
19
33
|
super()
|
20
34
|
@type = nil
|
@@ -23,12 +37,13 @@ module WXRuby3
|
|
23
37
|
@args_string = ''
|
24
38
|
@is_overloaded = false
|
25
39
|
@overloads = []
|
40
|
+
@block_arg = nil
|
26
41
|
|
27
42
|
update_attributes(**kwargs)
|
28
43
|
extract(element) if element
|
29
44
|
end
|
30
45
|
|
31
|
-
attr_accessor :type, :definition, :template_params, :args_string, :is_overloaded, :overloads
|
46
|
+
attr_accessor :type, :definition, :template_params, :args_string, :is_overloaded, :overloads, :block_arg
|
32
47
|
|
33
48
|
def is_template?
|
34
49
|
!template_params.empty?
|
@@ -74,6 +89,10 @@ module WXRuby3
|
|
74
89
|
items.inject(0) { |c, i| c += 1 if ParamDef === i && !i.default; c }
|
75
90
|
end
|
76
91
|
|
92
|
+
def accept_block_arg(exclude_default=false)
|
93
|
+
@block_arg = Block.new(exclude_default)
|
94
|
+
end
|
95
|
+
|
77
96
|
def rb_decl_name
|
78
97
|
"self.#{rb_method_name(rb_name || name)}"
|
79
98
|
end
|
@@ -81,11 +100,23 @@ module WXRuby3
|
|
81
100
|
def rb_doc(xml_trans, type_maps, fulldocs=false)
|
82
101
|
ovls = all.select {|m| !m.docs_ignored(fulldocs) && !m.deprecated }
|
83
102
|
ovl_docs = ovls.collect { |mo| [mo]+mo.rb_doc_decl(xml_trans, type_maps) }
|
84
|
-
ovl_docs.inject({}) do |docs, (movl, name, params, doc)|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
103
|
+
ovl_docs.inject({}) do |docs, (movl, name, params, doc, retdoc)|
|
104
|
+
docs[name] = [] unless docs.has_key?(name)
|
105
|
+
# add regular method signature doc
|
106
|
+
docs[name] << [movl, params, doc+[retdoc]]
|
107
|
+
# is an optional block arg allowed for ALL methods or just this overload?
|
108
|
+
if @block_arg || movl.block_arg
|
109
|
+
# add an overload method signature doc with block arg and yield param
|
110
|
+
blk_arg = @block_arg || movl.block_arg
|
111
|
+
# skip in case default ctor/method (no args) is excluded from block args
|
112
|
+
unless params.empty? && blk_arg.exclude_default
|
113
|
+
type = is_ctor ? rb_return_type(type_maps, xml_trans) : nil
|
114
|
+
blk_arg.yield_param.each { |yp| doc << "@yieldparam [#{yp[:type] || type}] #{yp[:name]} #{yp[:desc].split("\n").join("\n ")}" }
|
115
|
+
doc << retdoc
|
116
|
+
blkarg = params.empty? ? '' : ', '
|
117
|
+
blkarg << '&block'
|
118
|
+
docs[name] << [movl, params+blkarg, doc]
|
119
|
+
end
|
89
120
|
end
|
90
121
|
docs
|
91
122
|
end
|
@@ -157,15 +188,15 @@ module WXRuby3
|
|
157
188
|
end
|
158
189
|
result.concat(mapped_ret_args.collect { |mra| mra.type }) if mapped_ret_args
|
159
190
|
result.compact! # remove nil values (possible ignored output)
|
160
|
-
case result.size
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
[rb_decl_name, paramlist, doclns]
|
191
|
+
retdoc = case result.size
|
192
|
+
when 0
|
193
|
+
"@return [void]"
|
194
|
+
when 1
|
195
|
+
"@return [#{result.first}]"
|
196
|
+
else
|
197
|
+
"@return [Array(#{result.join(',')})]"
|
198
|
+
end
|
199
|
+
[rb_decl_name, paramlist, doclns, retdoc]
|
169
200
|
end
|
170
201
|
|
171
202
|
def rb_return_type(type_maps, xml_trans)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
:wxGenericHyperlinkCtrl:
|
3
|
+
:brief:
|
4
|
+
:pre:
|
5
|
+
:briefdescription:
|
6
|
+
- :pattern: !ruby/regexp /.*/
|
7
|
+
:replace: |
|
8
|
+
This is the generic implementation of a class that shows a static text element which links to a URL.
|
9
|
+
For WXOSX this class is identical to wxHyperlinkCtrl.
|
10
|
+
|
11
|
+
:detail:
|
12
|
+
:pre:
|
13
|
+
:para:
|
14
|
+
- :pattern: !ruby/regexp /Currently\s+this\s+class\s+is\s+implemented.*other\s+ports./
|
15
|
+
:replace: ''
|
16
|
+
:wxGenericHyperlinkCtrl.wxGenericHyperlinkCtrl:
|
17
|
+
:detail:
|
18
|
+
:pre:
|
19
|
+
:detaileddescription:
|
20
|
+
- :pattern: !ruby/regexp /See.*for\s+more\s+info\./
|
21
|
+
:replace: |
|
22
|
+
See {Wx::GenericHyperlinkCtrl#create} for more info.
|
@@ -1,4 +1,42 @@
|
|
1
1
|
---
|
2
|
+
:wxScrolled:
|
3
|
+
:brief:
|
4
|
+
:pre:
|
5
|
+
:briefdescription:
|
6
|
+
- :pattern: !ruby/regexp /.*/
|
7
|
+
:replace: |
|
8
|
+
The Wx::ScrolledXXX classes manage scrolling for their client areas, transforming the coordinates according
|
9
|
+
to the scrollbar positions, and setting the scroll positions, thumb sizes and ranges according to the area in view.
|
10
|
+
:detail:
|
11
|
+
:pre:
|
12
|
+
:simplesect:
|
13
|
+
- :pattern: !ruby/regexp /if you want to use.*wxScrolled.*with a custom class/
|
14
|
+
:replace: ''
|
15
|
+
:post:
|
16
|
+
- :pattern: !ruby/regexp /commonly used \(but not the only possible!\) /
|
17
|
+
:subst: 'commonly used '
|
18
|
+
- :pattern: !ruby/regexp /, aka \{Wx::Scrolled<wxPanel>}, is equivalent to \{Wx::ScrolledWindow} from earlier versions. Derived/
|
19
|
+
:subst: ' derives'
|
20
|
+
- :pattern: !ruby/regexp /, aka \{Wx::Scrolled<wxWindow>},/
|
21
|
+
:subst: ''
|
22
|
+
- :pattern: !ruby/regexp /\{Wx::Scrolled<wxControl>}/
|
23
|
+
:subst: 'Wx::ScrolledControl'
|
24
|
+
- :pattern: !ruby/regexp / \(also note the absence of a \{Wx::ScrolledControl} typedef\)/
|
25
|
+
:subst: ''
|
26
|
+
- :pattern: !ruby/regexp /Starting from version 2.4 of wxWidgets, there are several ways to use a \{Wx::ScrolledWindow} \(and now \{Wx::Scrolled}\). In particular, there /
|
27
|
+
:subst: 'There '
|
28
|
+
- :pattern: !ruby/regexp /Wx::Scrolled#(\w+)/
|
29
|
+
:subst: '{Wx::ScrolledCanvas#\1}'
|
30
|
+
:global: true
|
31
|
+
- :pattern: !ruby/regexp /\{Wx::Scrolled}/
|
32
|
+
:subst: '{Wx::ScrolledCanvas}'
|
33
|
+
:global: true
|
34
|
+
:wxScrolled.Create:
|
35
|
+
:detail:
|
36
|
+
:pre:
|
37
|
+
:detaileddescription:
|
38
|
+
- :pattern: !ruby/regexp /.*/
|
39
|
+
:replace: ''
|
2
40
|
:wxScrolled.DoPrepareDC:
|
3
41
|
:detail:
|
4
42
|
:pre:
|
@@ -1,4 +1,42 @@
|
|
1
1
|
---
|
2
|
+
:wxScrolled:
|
3
|
+
:brief:
|
4
|
+
:pre:
|
5
|
+
:briefdescription:
|
6
|
+
- :pattern: !ruby/regexp /.*/
|
7
|
+
:replace: |
|
8
|
+
The Wx::ScrolledXXX classes manage scrolling for their client areas, transforming the coordinates according
|
9
|
+
to the scrollbar positions, and setting the scroll positions, thumb sizes and ranges according to the area in view.
|
10
|
+
:detail:
|
11
|
+
:pre:
|
12
|
+
:simplesect:
|
13
|
+
- :pattern: !ruby/regexp /if you want to use.*wxScrolled.*with a custom class/
|
14
|
+
:replace: ''
|
15
|
+
:post:
|
16
|
+
- :pattern: !ruby/regexp /commonly used \(but not the only possible!\) /
|
17
|
+
:subst: 'commonly used '
|
18
|
+
- :pattern: !ruby/regexp /, aka \{Wx::Scrolled<wxPanel>}, is equivalent to \{Wx::ScrolledWindow} from earlier versions. Derived/
|
19
|
+
:subst: ' derives'
|
20
|
+
- :pattern: !ruby/regexp /, aka \{Wx::Scrolled<wxWindow>},/
|
21
|
+
:subst: ''
|
22
|
+
- :pattern: !ruby/regexp /\{Wx::Scrolled<wxControl>}/
|
23
|
+
:subst: 'Wx::ScrolledControl'
|
24
|
+
- :pattern: !ruby/regexp / \(also note the absence of a \{Wx::ScrolledControl} typedef\)/
|
25
|
+
:subst: ''
|
26
|
+
- :pattern: !ruby/regexp /Starting from version 2.4 of wxWidgets, there are several ways to use a \{Wx::ScrolledWindow} \(and now \{Wx::Scrolled}\). In particular, there /
|
27
|
+
:subst: 'There '
|
28
|
+
- :pattern: !ruby/regexp /Wx::Scrolled#(\w+)/
|
29
|
+
:subst: '{Wx::ScrolledControl#\1}'
|
30
|
+
:global: true
|
31
|
+
- :pattern: !ruby/regexp /\{Wx::Scrolled}/
|
32
|
+
:subst: '{Wx::ScrolledControl}'
|
33
|
+
:global: true
|
34
|
+
:wxScrolled.Create:
|
35
|
+
:detail:
|
36
|
+
:pre:
|
37
|
+
:detaileddescription:
|
38
|
+
- :pattern: !ruby/regexp /.*/
|
39
|
+
:replace: ''
|
2
40
|
:wxScrolled.DoPrepareDC:
|
3
41
|
:detail:
|
4
42
|
:pre:
|
@@ -1,4 +1,42 @@
|
|
1
1
|
---
|
2
|
+
:wxScrolled:
|
3
|
+
:brief:
|
4
|
+
:pre:
|
5
|
+
:briefdescription:
|
6
|
+
- :pattern: !ruby/regexp /.*/
|
7
|
+
:replace: |
|
8
|
+
The Wx::ScrolledXXX classes manage scrolling for their client areas, transforming the coordinates according
|
9
|
+
to the scrollbar positions, and setting the scroll positions, thumb sizes and ranges according to the area in view.
|
10
|
+
:detail:
|
11
|
+
:pre:
|
12
|
+
:simplesect:
|
13
|
+
- :pattern: !ruby/regexp /if you want to use.*wxScrolled.*with a custom class/
|
14
|
+
:replace: ''
|
15
|
+
:post:
|
16
|
+
- :pattern: !ruby/regexp /commonly used \(but not the only possible!\) /
|
17
|
+
:subst: 'commonly used '
|
18
|
+
- :pattern: !ruby/regexp /, aka \{Wx::Scrolled<wxPanel>}, is equivalent to \{Wx::ScrolledWindow} from earlier versions. Derived/
|
19
|
+
:subst: ' derives'
|
20
|
+
- :pattern: !ruby/regexp /, aka \{Wx::Scrolled<wxWindow>},/
|
21
|
+
:subst: ''
|
22
|
+
- :pattern: !ruby/regexp /\{Wx::Scrolled<wxControl>}/
|
23
|
+
:subst: 'Wx::ScrolledControl'
|
24
|
+
- :pattern: !ruby/regexp / \(also note the absence of a \{Wx::ScrolledControl} typedef\)/
|
25
|
+
:subst: ''
|
26
|
+
- :pattern: !ruby/regexp /Starting from version 2.4 of wxWidgets, there are several ways to use a \{Wx::ScrolledWindow} \(and now \{Wx::Scrolled}\). In particular, there /
|
27
|
+
:subst: 'There '
|
28
|
+
- :pattern: !ruby/regexp /Wx::Scrolled#(\w+)/
|
29
|
+
:subst: '{Wx::ScrolledWindow#\1}'
|
30
|
+
:global: true
|
31
|
+
- :pattern: !ruby/regexp /\{Wx::Scrolled}/
|
32
|
+
:subst: '{Wx::ScrolledWindow}'
|
33
|
+
:global: true
|
34
|
+
:wxScrolled.Create:
|
35
|
+
:detail:
|
36
|
+
:pre:
|
37
|
+
:detaileddescription:
|
38
|
+
- :pattern: !ruby/regexp /.*/
|
39
|
+
:replace: ''
|
2
40
|
:wxScrolled.DoPrepareDC:
|
3
41
|
:detail:
|
4
42
|
:pre:
|
@@ -139,7 +139,7 @@ module WXRuby3
|
|
139
139
|
Director.Spec(pkg, 'wxScrolledWindow', director: Director::ScrolledT)
|
140
140
|
Director.Spec(pkg, 'wxScrolledCanvas', director: Director::ScrolledT)
|
141
141
|
Director.Spec(pkg, 'wxScrolledControl', director: Director::ScrolledT)
|
142
|
-
Director.Spec(pkg, '
|
142
|
+
Director.Spec(pkg, 'wxHVScrolledWindow')
|
143
143
|
Director.Spec(pkg, 'wxVListBox')
|
144
144
|
Director.Spec(pkg, 'wxFindReplaceData', requirements: %w[USE_FINDREPLDLG])
|
145
145
|
Director.Spec(pkg, 'wxFindReplaceDialog', director: Director::Dialog, requirements: %w[USE_FINDREPLDLG])
|
@@ -272,7 +272,7 @@ module WXRuby3
|
|
272
272
|
Director.Spec(pkg, 'wxHtmlEasyPrinting', requirements: %w[USE_PRINTING_ARCHITECTURE])
|
273
273
|
Director.Spec(pkg, 'wxHtmlPrintout', requirements: %w[USE_PRINTING_ARCHITECTURE])
|
274
274
|
Director.Spec(pkg, 'wxHtmlListBox')
|
275
|
-
Director.Spec(pkg, 'wxHTMLDataObject') if Config.instance.
|
275
|
+
Director.Spec(pkg, 'wxHTMLDataObject') if Config.instance.wx_version_check('3.3') >= 0
|
276
276
|
}
|
277
277
|
|
278
278
|
Director.Package('Wx::RTC', 'USE_RICHTEXT', depends_on: ['Wx::HTML']) { |pkg|
|
@@ -20,7 +20,7 @@ module WXRuby3
|
|
20
20
|
|
21
21
|
define do
|
22
22
|
|
23
|
-
if Config.instance.
|
23
|
+
if Config.instance.wx_version_check('3.3.0') >= 0
|
24
24
|
map 'const std::vector<wxPrintPageRange> &' => 'Array<Wx::PRT::PrintPageRange>' do
|
25
25
|
map_out code: <<~__CODE
|
26
26
|
$result = rb_ary_new();
|
Binary file
|