wxruby3 1.5.3 → 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.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/ext/wxruby3/swig/RubyStockObjects.i +1 -0
  3. data/lib/wx/aui/auifloatframe.rb +1 -1
  4. data/lib/wx/aui/auimanager.rb +1 -1
  5. data/lib/wx/aui/auinotebook.rb +2 -2
  6. data/lib/wx/core/animation.rb +1 -1
  7. data/lib/wx/core/cursor.rb +10 -0
  8. data/lib/wx/core/dataformat.rb +1 -1
  9. data/lib/wx/core/dialog.rb +1 -1
  10. data/lib/wx/core/file_dialog.rb +1 -1
  11. data/lib/wx/core/geometry.rb +34 -0
  12. data/lib/wx/core/hboxsizer.rb +22 -0
  13. data/lib/wx/core/hyperlink_ctrl.rb +18 -0
  14. data/lib/wx/core/point.rb +12 -3
  15. data/lib/wx/core/position.rb +58 -0
  16. data/lib/wx/core/sizer.rb +163 -28
  17. data/lib/wx/core/splash_screen.rb +3 -3
  18. data/lib/wx/core/toolbar.rb +2 -2
  19. data/lib/wx/core/vboxsizer.rb +22 -0
  20. data/lib/wx/doc/aui/auimanager.rb +6 -3
  21. data/lib/wx/doc/aui/auinotebook.rb +6 -3
  22. data/lib/wx/doc/config.rb +14 -8
  23. data/lib/wx/doc/controlwithitems.rb +7 -3
  24. data/lib/wx/doc/core.rb +21 -0
  25. data/lib/wx/doc/geometry.rb +47 -7
  26. data/lib/wx/doc/graphics_object.rb +24 -0
  27. data/lib/wx/doc/grid/grid.rb +18 -9
  28. data/lib/wx/doc/hboxsizer.rb +41 -5
  29. data/lib/wx/doc/list_ctrl.rb +12 -6
  30. data/lib/wx/doc/menu.rb +6 -3
  31. data/lib/wx/doc/notebook.rb +6 -3
  32. data/lib/wx/doc/pg/pg_property.rb +18 -9
  33. data/lib/wx/doc/pg/property_grid_interface.rb +4 -4
  34. data/lib/wx/doc/region_iterator.rb +1 -1
  35. data/lib/wx/doc/rtc/rich_text_composite_object.rb +6 -3
  36. data/lib/wx/doc/rtc/rich_text_ctrl.rb +6 -3
  37. data/lib/wx/doc/rtc/rich_text_paragraph.rb +6 -3
  38. data/lib/wx/doc/sizer.rb +6 -3
  39. data/lib/wx/doc/stc/styled_text_ctrl.rb +6 -3
  40. data/lib/wx/doc/textctrl.rb +6 -3
  41. data/lib/wx/doc/tree_ctrl.rb +7 -3
  42. data/lib/wx/doc/v_list_box.rb +6 -3
  43. data/lib/wx/doc/variant.rb +1 -1
  44. data/lib/wx/doc/vboxsizer.rb +41 -5
  45. data/lib/wx/doc/window.rb +6 -3
  46. data/lib/wx/helpers.rb +36 -10
  47. data/lib/wx/keyword_ctors.rb +12 -14
  48. data/lib/wx/keyword_defs.rb +11 -2
  49. data/lib/wx/pg/pg_property.rb +1 -1
  50. data/lib/wx/rtc/richtext_formatting_dialog.rb +3 -3
  51. data/lib/wx/rtc/richtext_style_organiser_dialog.rb +3 -3
  52. data/lib/wx/rtc/symbol_picker_dialog.rb +3 -3
  53. data/lib/wx/version.rb +1 -1
  54. data/rakelib/lib/config/mingw.rb +1 -1
  55. data/rakelib/lib/config.rb +6 -0
  56. data/rakelib/lib/director/affine_matrix.rb +33 -0
  57. data/rakelib/lib/director/animation_ctrl.rb +1 -1
  58. data/rakelib/lib/director/app.rb +1 -1
  59. data/rakelib/lib/director/aui_manager.rb +2 -2
  60. data/rakelib/lib/director/aui_notebook.rb +1 -1
  61. data/rakelib/lib/director/aui_tab_art.rb +4 -4
  62. data/rakelib/lib/director/ctrl_with_items.rb +1 -1
  63. data/rakelib/lib/director/cursor.rb +11 -1
  64. data/rakelib/lib/director/dc.rb +2 -2
  65. data/rakelib/lib/director/defs.rb +1 -1
  66. data/rakelib/lib/director/derived_dc.rb +14 -14
  67. data/rakelib/lib/director/dialog.rb +3 -3
  68. data/rakelib/lib/director/gdicommon.rb +2 -2
  69. data/rakelib/lib/director/geometry.rb +55 -3
  70. data/rakelib/lib/director/graphics_context.rb +8 -3
  71. data/rakelib/lib/director/graphics_object.rb +29 -2
  72. data/rakelib/lib/director/html_listbox.rb +6 -5
  73. data/rakelib/lib/director/hvscrolled_window.rb +140 -0
  74. data/rakelib/lib/director/hyperlink_ctrl.rb +38 -1
  75. data/rakelib/lib/director/menu_item.rb +1 -1
  76. data/rakelib/lib/director/persistent_window.rb +2 -2
  77. data/rakelib/lib/director/pgeditor.rb +1 -1
  78. data/rakelib/lib/director/pgproperties.rb +4 -4
  79. data/rakelib/lib/director/pgproperty.rb +1 -1
  80. data/rakelib/lib/director/pgvalidation_info.rb +1 -1
  81. data/rakelib/lib/director/print_data.rb +1 -1
  82. data/rakelib/lib/director/property_grid_event.rb +1 -1
  83. data/rakelib/lib/director/property_grid_page.rb +1 -1
  84. data/rakelib/lib/director/property_grid_page_state.rb +1 -1
  85. data/rakelib/lib/director/ribbon_tool_bar.rb +1 -1
  86. data/rakelib/lib/director/richtext_buffer.rb +1 -1
  87. data/rakelib/lib/director/richtext_formatting_dialog.rb +1 -1
  88. data/rakelib/lib/director/richtext_paragraph_layout_box.rb +1 -1
  89. data/rakelib/lib/director/richtext_style_listbox.rb +2 -1
  90. data/rakelib/lib/director/scrolled_t.rb +22 -0
  91. data/rakelib/lib/director/sizer.rb +51 -0
  92. data/rakelib/lib/director/styled_text_event.rb +1 -1
  93. data/rakelib/lib/director/textctrl.rb +2 -2
  94. data/rakelib/lib/director/tree_ctrl.rb +1 -1
  95. data/rakelib/lib/director/utils.rb +1 -1
  96. data/rakelib/lib/director/variant.rb +1 -1
  97. data/rakelib/lib/director/vlistbox.rb +5 -3
  98. data/rakelib/lib/director/window.rb +14 -3
  99. data/rakelib/lib/extractor/function.rb +46 -15
  100. data/rakelib/lib/generate/doc/hyperlink_ctrl.yaml +22 -0
  101. data/rakelib/lib/generate/doc/scrolled_canvas.yaml +38 -0
  102. data/rakelib/lib/generate/doc/scrolled_control.yaml +38 -0
  103. data/rakelib/lib/generate/doc/scrolled_window.yaml +38 -0
  104. data/rakelib/lib/specs/interfaces.rb +2 -2
  105. data/rakelib/lib/typemap/print_page_range.rb +1 -1
  106. data/samples/scrolling/tn_varscroll.png +0 -0
  107. data/samples/scrolling/varscroll.rb +416 -0
  108. data/samples/widgets/hyperlink.rb +85 -60
  109. metadata +12 -6
  110. data/rakelib/lib/director/vscrolled_window.rb +0 -62
  111. /data/samples/{controls → scrolling}/htlbox.rb +0 -0
  112. /data/samples/{etc → scrolling}/scrollwin.rb +0 -0
  113. /data/samples/{controls → scrolling}/tn_htlbox.png +0 -0
  114. /data/samples/{etc → scrolling}/tn_scrollwin.png +0 -0
@@ -13,11 +13,15 @@ module WXRuby3
13
13
  class Geometry < Director
14
14
 
15
15
  def setup
16
- spec.items.replace %w{wxPoint2DInt wxPoint2DDouble}
16
+ spec.items.replace %w{wxPoint2DInt wxPoint2DDouble wxRect2DDouble}
17
17
 
18
18
  spec.ignore 'wxPoint2DInt::m_x', 'wxPoint2DInt::m_y',
19
- 'wxPoint2DDouble::m_x', 'wxPoint2DDouble::m_y'
19
+ 'wxPoint2DDouble::m_x', 'wxPoint2DDouble::m_y',
20
+ 'wxRect2DDouble::m_x', 'wxRect2DDouble::m_y',
21
+ 'wxRect2DDouble::m_width', 'wxRect2DDouble::m_height'
20
22
 
23
+ spec.ignore 'wxPoint2DInt::GetFloor(wxInt32 *, wxInt32 *)',
24
+ 'wxPoint2DInt::GetRounded(wxInt32 *, wxInt32 *)'
21
25
  spec.add_extend_code 'wxPoint2DInt', <<~__HEREDOC
22
26
  wxInt32 get_x()
23
27
  {
@@ -73,6 +77,8 @@ module WXRuby3
73
77
  }
74
78
  __HEREDOC
75
79
 
80
+ spec.ignore 'wxPoint2DDouble::GetFloor(wxInt32 *, wxInt32 *)',
81
+ 'wxPoint2DDouble::GetRounded(wxInt32 *, wxInt32 *)'
76
82
  spec.add_extend_code 'wxPoint2DDouble', <<~__HEREDOC
77
83
  wxDouble get_x()
78
84
  {
@@ -128,7 +134,53 @@ module WXRuby3
128
134
  }
129
135
  __HEREDOC
130
136
 
131
- spec.map_apply 'int * OUTPUT' => 'wxInt32 *'
137
+
138
+ spec.add_extend_code 'wxRect2DDouble', <<~__HEREDOC
139
+ wxDouble get_x()
140
+ {
141
+ return $self->m_x;
142
+ }
143
+ wxDouble set_x(wxDouble v)
144
+ {
145
+ return ($self->m_x = v);
146
+ }
147
+ wxDouble get_y()
148
+ {
149
+ return $self->m_y;
150
+ }
151
+ wxDouble set_y(wxDouble v)
152
+ {
153
+ return ($self->m_y = v);
154
+ }
155
+ wxDouble get_width()
156
+ {
157
+ return $self->m_width;
158
+ }
159
+ wxDouble set_width(wxDouble v)
160
+ {
161
+ return ($self->m_width = v);
162
+ }
163
+ wxDouble get_height()
164
+ {
165
+ return $self->m_height;
166
+ }
167
+ wxDouble set_height(wxDouble v)
168
+ {
169
+ return ($self->m_height = v);
170
+ }
171
+ void assign(const wxRect2DDouble& rect)
172
+ {
173
+ (*$self) = rect;
174
+ }
175
+ __HEREDOC
176
+ # implement in pure Ruby
177
+ spec.ignore 'wxRect2DDouble::Intersect(const wxRect2DDouble &, const wxRect2DDouble &, wxRect2DDouble *)',
178
+ 'wxRect2DDouble::Union(const wxRect2DDouble &, const wxRect2DDouble &, wxRect2DDouble *)',
179
+ ignore_doc: false
180
+ spec.map 'wxRect2DDouble *dest' => 'Wx::Rect2DDouble', swig: false do
181
+ map_in ignore: true, code: ''
182
+ map_argout code: ''
183
+ end
132
184
 
133
185
  # ignore all friend operators
134
186
  spec.do_not_generate :functions
@@ -98,12 +98,17 @@ module WXRuby3
98
98
  delete old_dashes;
99
99
  }
100
100
  __HEREDOC
101
+ if Config.instance.wx_version_check('3.3.0') >= 0
102
+ spec.ignore 'wxGraphicsContext::GetClipBox(wxDouble *, wxDouble *, wxDouble *, wxDouble *)'
103
+ else
104
+ # Typemap to fix GraphicsContext#get_clip_box
105
+ spec.map_apply 'double *OUTPUT' => ['wxDouble *x', 'wxDouble *y', 'wxDouble *w', 'wxDouble *h']
106
+ end
101
107
  # type mappings
102
- # Typemap to fix GraphicsContext#get_text_extent and get_dpi and get_clip_box
108
+ # Typemap to fix GraphicsContext#get_text_extent and get_dpi
103
109
  spec.map_apply 'double *OUTPUT' => [ 'wxDouble* width', 'wxDouble* height',
104
110
  'wxDouble* descent', 'wxDouble* externalLeading',
105
- 'wxDouble *dpiX', 'wxDouble *dpiY',
106
- 'wxDouble *x', 'wxDouble *y', 'wxDouble *w', 'wxDouble *h']
111
+ 'wxDouble *dpiX', 'wxDouble *dpiY']
107
112
  spec.map 'wxDouble* width, wxDouble* height, wxDouble* descent, wxDouble* externalLeading' do
108
113
  map_directorargout code: <<~__CODE
109
114
  if ( (TYPE(result) == T_ARRAY) && (RARRAY_LEN(result) >= 2) )
@@ -39,9 +39,36 @@ module WXRuby3
39
39
  spec.map_apply 'double *OUTPUT' => [ 'wxDouble *a', 'wxDouble *b',
40
40
  'wxDouble *c', 'wxDouble *d',
41
41
  'wxDouble *tx' , 'wxDouble *ty' ]
42
- spec.ignore 'wxGraphicsPath::GetBox() const',
42
+ # Deal with GraphicsMatrix#transform_point and #transform_distance methods
43
+ spec.ignore 'wxGraphicsMatrix::TransformPoint', 'wxGraphicsMatrix::TransformDistance'
44
+ spec.map_apply 'double *INOUT' => [ 'wxDouble *x' , 'wxDouble *y',
45
+ 'wxDouble *dx', 'wxDouble *dy']
46
+ spec.add_extend_code 'wxGraphicsMatrix', <<~__CODE
47
+ wxPoint2DDouble transform_point(wxDouble x, wxDouble y)
48
+ {
49
+ $self->TransformPoint(&x, &y);
50
+ return wxPoint2DDouble(x, y);
51
+ }
52
+ wxPoint2DDouble transform_point(const wxPoint2DDouble& pt)
53
+ {
54
+ wxDouble x = pt.m_x, y = pt.m_y;
55
+ $self->TransformPoint(&x, &y);
56
+ return wxPoint2DDouble(x, y);
57
+ }
58
+ wxPoint2DDouble transform_distance(wxDouble dx, wxDouble dy)
59
+ {
60
+ $self->TransformDistance(&dx, &dy);
61
+ return wxPoint2DDouble(dx, dy);
62
+ }
63
+ wxPoint2DDouble transform_distance(const wxPoint2DDouble& p)
64
+ {
65
+ wxDouble dx = p.m_x, dy = p.m_y;
66
+ $self->TransformDistance(&dx, &dy);
67
+ return wxPoint2DDouble(dx, dy);
68
+ }
69
+ __CODE
70
+ spec.ignore 'wxGraphicsPath::GetBox(wxDouble *, wxDouble *, wxDouble *, wxDouble *) const',
43
71
  'wxGraphicsPath::GetCurrentPoint(wxDouble*,wxDouble*) const'
44
- spec.map_apply 'double * OUTPUT' => 'wxDouble *'
45
72
  # wxGraphicsRenderer::GetVersion
46
73
  spec.map_apply 'int * OUTPUT' => ['int *major', 'int *minor', 'int *micro']
47
74
  if Config.platform == :mingw
@@ -19,7 +19,7 @@ module WXRuby3
19
19
  def setup
20
20
  spec.items << 'wxSimpleHtmlListBox' << 'wxItemContainer'
21
21
  super
22
- spec.override_inheritance_chain('wxHtmlListBox', %w[wxVListBox wxVScrolledWindow wxPanel wxWindow wxEvtHandler wxObject])
22
+ spec.override_inheritance_chain('wxHtmlListBox', ['wxVListBox', { 'wxVScrolledWindow' => 'wxHVScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
23
23
  spec.make_abstract 'wxHtmlListBox'
24
24
  # provide base implementation for OnGetItem
25
25
  spec.add_header_code <<~__HEREDOC
@@ -34,7 +34,7 @@ module WXRuby3
34
34
  protected:
35
35
  virtual wxString OnGetItem (size_t n) const
36
36
  {
37
- rb_raise(rb_eNoMethodError, "Not implemented");
37
+ return {};
38
38
  }
39
39
  };
40
40
  __HEREDOC
@@ -48,7 +48,7 @@ module WXRuby3
48
48
  {
49
49
  $self->GetFileSystem().ChangePathTo(location, is_dir);
50
50
  }
51
- __HEREDOC
51
+ __HEREDOC
52
52
  # make sure protected methods are included
53
53
  spec.regard 'wxHtmlListBox::OnGetItem',
54
54
  'wxHtmlListBox::OnGetItemMarkup',
@@ -62,9 +62,10 @@ module WXRuby3
62
62
  'virtual void OnDrawBackground(wxDC &dc, const wxRect &rect, size_t n) const',
63
63
  'virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const',
64
64
  visibility: 'protected'
65
+ spec.no_proxy 'wxVListBox::OnGetRowHeight'
65
66
 
66
67
  # override inheritance chain
67
- spec.override_inheritance_chain('wxSimpleHtmlListBox', %w[wxHtmlListBox wxVListBox wxVScrolledWindow wxPanel wxWindow wxEvtHandler wxObject])
68
+ spec.override_inheritance_chain('wxSimpleHtmlListBox', ['wxHtmlListBox', 'wxVListBox', { 'wxVScrolledWindow' => 'wxHVScrolledWindow' }, 'wxPanel', 'wxWindow', 'wxEvtHandler', 'wxObject'])
68
69
  spec.fold_bases('wxSimpleHtmlListBox' => %w[wxItemContainer])
69
70
  # override SWIG's confusion
70
71
  spec.make_concrete 'wxSimpleHtmlListBox'
@@ -187,7 +188,7 @@ module WXRuby3
187
188
  }
188
189
  return rc;
189
190
  }
190
- __HEREDOC
191
+ __HEREDOC
191
192
  end
192
193
  end # class HtmlListBox
193
194
 
@@ -0,0 +1,140 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ ###
6
+ # wxRuby3 wxWidgets interface director
7
+ ###
8
+
9
+ require_relative './window'
10
+
11
+ module WXRuby3
12
+
13
+ class Director
14
+
15
+ class HVScrolledWindow < Window
16
+
17
+ def setup
18
+ super
19
+ spec.items << 'wxVarScrollHelperBase' << 'wxVarHVScrollHelper' <<
20
+ 'wxVarVScrollHelper' << 'wxVScrolledWindow' <<
21
+ 'wxVarHScrollHelper' << 'wxHScrolledWindow' <<
22
+ 'wxPosition'
23
+ spec.override_inheritance_chain('wxVScrolledWindow', %w[wxPanel wxWindow wxEvtHandler wxObject])
24
+ spec.fold_bases('wxVScrolledWindow' => %w[wxVarVScrollHelper wxVarScrollHelperBase])
25
+ spec.make_abstract 'wxVScrolledWindow'
26
+ spec.force_proxy 'wxVScrolledWindow'
27
+ spec.override_inheritance_chain('wxHScrolledWindow', %w[wxPanel wxWindow wxEvtHandler wxObject])
28
+ spec.fold_bases('wxHScrolledWindow' => %w[wxVarHScrollHelper wxVarScrollHelperBase])
29
+ spec.make_abstract 'wxHScrolledWindow'
30
+ spec.force_proxy 'wxHScrolledWindow'
31
+ spec.override_inheritance_chain('wxHVScrolledWindow', %w[wxPanel wxWindow wxEvtHandler wxObject])
32
+ spec.fold_bases('wxHVScrolledWindow' => %w[wxVarHVScrollHelper wxVarHScrollHelper wxVarVScrollHelper wxVarScrollHelperBase])
33
+ spec.make_abstract 'wxHVScrolledWindow'
34
+ spec.force_proxy 'wxHVScrolledWindow'
35
+ # provide base implementations for pure virtuals
36
+ spec.add_header_code <<~__HEREDOC
37
+ // Custom subclass implementation.
38
+ class wxRubyVScrolledWindow : public wxVScrolledWindow
39
+ {
40
+ public:
41
+ wxRubyVScrolledWindow()
42
+ : wxVScrolledWindow () {}
43
+ wxRubyVScrolledWindow(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
44
+ : wxVScrolledWindow(parent, id, pos, size, style, name) {}
45
+ protected:
46
+ virtual wxCoord OnGetRowHeight(size_t) const
47
+ {
48
+ return {};
49
+ }
50
+ };
51
+
52
+ // Custom subclass implementation.
53
+ class wxRubyHScrolledWindow : public wxHScrolledWindow
54
+ {
55
+ public:
56
+ wxRubyHScrolledWindow()
57
+ : wxHScrolledWindow () {}
58
+ wxRubyHScrolledWindow(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
59
+ : wxHScrolledWindow(parent, id, pos, size, style, name) {}
60
+ protected:
61
+ virtual wxCoord OnGetColumnWidth(size_t) const
62
+ {
63
+ return {};
64
+ }
65
+ };
66
+
67
+ // Custom subclass implementation.
68
+ class wxRubyHVScrolledWindow : public wxHVScrolledWindow
69
+ {
70
+ public:
71
+ wxRubyHVScrolledWindow()
72
+ : wxHVScrolledWindow () {}
73
+ wxRubyHVScrolledWindow(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
74
+ : wxHVScrolledWindow(parent, id, pos, size, style, name) {}
75
+ protected:
76
+ virtual wxCoord OnGetRowHeight(size_t) const
77
+ {
78
+ return {};
79
+ }
80
+ virtual wxCoord OnGetColumnWidth(size_t) const
81
+ {
82
+ return {};
83
+ }
84
+ };
85
+ __HEREDOC
86
+ # make Ruby director and wrappers use custom implementation
87
+ spec.use_class_implementation('wxVScrolledWindow', 'wxRubyVScrolledWindow')
88
+ spec.use_class_implementation('wxHScrolledWindow', 'wxRubyHScrolledWindow')
89
+ spec.use_class_implementation('wxHVScrolledWindow', 'wxRubyHVScrolledWindow')
90
+ # regard protected methods
91
+ spec.regard 'wxVarVScrollHelper::OnGetRowHeight',
92
+ 'wxVarVScrollHelper::OnGetRowsHeightHint'
93
+ spec.regard 'wxVarHScrollHelper::OnGetColumnWidth',
94
+ 'wxVarHScrollHelper::OnGetColumnsWidthHint'
95
+ # ignore internal implementation methods
96
+ spec.ignore 'wxVarScrollHelperBase::GetNonOrientationTargetSize',
97
+ 'wxVarScrollHelperBase::GetOrientation',
98
+ 'wxVarScrollHelperBase::GetOrientationTargetSize',
99
+ 'wxVarScrollHelperBase::OnGetUnitSize',
100
+ 'wxVarScrollHelperBase::CalcScrolledPosition',
101
+ 'wxVarScrollHelperBase::CalcUnscrolledPosition',
102
+ 'wxVarScrollHelperBase::GetTargetWindow',
103
+ 'wxVarScrollHelperBase::SetTargetWindow',
104
+ 'wxVarScrollHelperBase::UpdateScrollbar',
105
+ 'wxVarScrollHelperBase::RefreshAll'
106
+ spec.map 'const wxPosition&' => 'Array(Integer, Integer), Wx::Position' do
107
+ add_header_code '#include <memory>'
108
+ map_in temp: 'std::unique_ptr<$1_basetype> tmp', code: <<~__CODE
109
+ if ( TYPE($input) == T_DATA )
110
+ {
111
+ void* argp$argnum;
112
+ SWIG_ConvertPtr($input, &argp$argnum, $1_descriptor, 0);
113
+ $1 = reinterpret_cast< $1_basetype * >(argp$argnum);
114
+ }
115
+ else if ( TYPE($input) == T_ARRAY )
116
+ {
117
+ $1 = new $1_basetype( NUM2INT( rb_ary_entry($input, 0) ),
118
+ NUM2INT( rb_ary_entry($input, 1) ) );
119
+ tmp.reset($1); // auto destruct when method scope ends
120
+ }
121
+ else
122
+ {
123
+ rb_raise(rb_eTypeError, "Wrong type for $1_basetype parameter");
124
+ }
125
+ __CODE
126
+ map_typecheck precedence: 'POINTER', code: <<~__CODE
127
+ void *vptr = 0;
128
+ $1 = 0;
129
+ if (TYPE($input) == T_ARRAY && RARRAY_LEN($input) == 2)
130
+ $1 = 1;
131
+ else if (TYPE($input) == T_DATA && SWIG_CheckState (SWIG_ConvertPtr ($input, &vptr, $1_descriptor, 0)))
132
+ $1 = 1;
133
+ __CODE
134
+ end
135
+ end
136
+ end # class HVScrolledWindow
137
+
138
+ end # class Director
139
+
140
+ end # module WXRuby3
@@ -16,7 +16,7 @@ module WXRuby3
16
16
 
17
17
  def setup
18
18
  super
19
- if Config.instance.wx_version <= '3.3.0'
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.wx_version > '3.2.4'
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,7 +14,7 @@ module WXRuby3
14
14
 
15
15
  def setup
16
16
  spec.items << 'wxPersistentTLW' << 'wxPersistentBookCtrl' << 'wxPersistentTreeBookCtrl'
17
- if Config.instance.wx_version > '3.2.4'
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
@@ -57,7 +57,7 @@ module WXRuby3
57
57
  spec.extend_interface 'wxPersistentTreeBookCtrl',
58
58
  'virtual wxString GetKind() const override'
59
59
  spec.do_not_generate :functions, :defines, :typedefs, :variables, :enums
60
- if Config.instance.wx_version >= '3.0.0'
60
+ if Config.instance.wx_version_check('3.0.0') >= 0
61
61
  # wxPersistentComboBox
62
62
  spec.override_inheritance_chain('wxPersistentComboBox', [{ 'wxPersistentWindowBase' => 'wxPersistentWindow' }, 'wxPersistentObject'])
63
63
  # add method override missing from docs
@@ -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.wx_version > '3.2.4'
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.wx_version > '3.2.4'
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.wx_version > '3.2.4'
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.wx_version > '3.2.4'
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.wx_version >= '3.3.0'
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,7 +120,7 @@ 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.wx_version < '3.3.0'
123
+ if Config.instance.wx_version_check('3.3.0') < 0
124
124
  spec.ignore %w[wxPGProperty::AddChild wxPGProperty::GetValueString]
125
125
  else
126
126
  spec.ignore 'wxPGProperty::AddChild'
@@ -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.wx_version < '3.3.0'
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.wx_version >= '3.3.0'
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.wx_version < '3.3.0'
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.wx_version >= '3.3.0'
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.wx_version >= '3.3.0'
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.wx_version <= '3.2.2.1'
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.wx_version >= '3.3.0'
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.wx_version < '3.3.0'
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.wx_version < '3.3.0'
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', %w[wxHtmlListBox wxVListBox wxVScrolledWindow wxPanel wxWindow wxEvtHandler wxObject])
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