wxruby3 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +1 -1
- data/README.md +2 -2
- data/ext/wxruby3/include/wxruby-ComboPopup.h +777 -0
- data/lib/wx/core/combo_ctrl.rb +171 -0
- data/lib/wx/doc/comboctrl.rb +128 -3
- data/lib/wx/doc/owner_drawn_combobox.rb +5 -1
- data/lib/wx/version.rb +1 -1
- data/rakelib/lib/core/include/funcall.inc +2 -1
- data/rakelib/lib/director/comboctrl.rb +104 -3
- data/rakelib/lib/director/defs.rb +1 -3
- data/rakelib/lib/director/gdicommon.rb +6 -0
- data/rakelib/lib/director/menu_item.rb +1 -1
- data/rakelib/lib/director/num_validator.rb +5 -7
- data/rakelib/lib/director/owner_drawn_combobox.rb +1 -0
- data/rakelib/lib/director/persistent_window.rb +2 -2
- data/rakelib/lib/director/pgeditor.rb +1 -1
- data/rakelib/lib/director/pgproperties.rb +3 -3
- data/rakelib/lib/director/pgproperty.rb +5 -1
- data/rakelib/lib/director/richtext_style_listbox.rb +5 -0
- data/rakelib/lib/director/sizer.rb +1 -1
- data/rakelib/lib/director/window.rb +4 -0
- data/rakelib/lib/extractor/module.rb +15 -0
- data/rakelib/lib/generate/doc/combo_ctrl.yaml +135 -0
- data/rakelib/lib/generate/doc/file_dialog_customize_hook.yaml +62 -0
- data/rakelib/lib/generate/doc/file_system.yaml +28 -0
- data/rakelib/lib/generate/interface.rb +12 -4
- data/rakelib/lib/swig_runner.rb +7 -4
- data/rakelib/lib/typemap/combo_popup.rb +42 -0
- data/tests/test_combo_ctrl.rb +196 -0
- metadata +9 -2
@@ -0,0 +1,171 @@
|
|
1
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
2
|
+
#
|
3
|
+
# This software is released under the MIT license.
|
4
|
+
|
5
|
+
|
6
|
+
module Wx
|
7
|
+
|
8
|
+
module ComboPopup
|
9
|
+
|
10
|
+
def self.included(mod)
|
11
|
+
unless mod == Wx::ComboPopupWx
|
12
|
+
mod.class_eval { include Wx::ComboPopup::Methods }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
module Methods
|
17
|
+
# Returns pointer to the associated parent {Wx::ComboCtrl}.
|
18
|
+
# @return [Wx::ComboCtrl]
|
19
|
+
# def get_combo_ctrl; end
|
20
|
+
|
21
|
+
# The including class must implement this to initialize its internal variables.
|
22
|
+
#
|
23
|
+
# This method is called immediately after construction finishes. m_combo member variable has been initialized before the call.
|
24
|
+
# @return [void]
|
25
|
+
def init
|
26
|
+
end
|
27
|
+
|
28
|
+
# The including class may implement this to return true if it wants to delay call to {Wx::ComboPopup#create} until the popup is shown for the first time.
|
29
|
+
#
|
30
|
+
# It is more efficient, but on the other hand it is often more convenient to have the control created immediately.
|
31
|
+
#
|
32
|
+
# <div class="wxrb-remark">
|
33
|
+
# <b>Remark:</b>
|
34
|
+
# <p>Base implementation returns false.
|
35
|
+
# </p>
|
36
|
+
# </div>
|
37
|
+
# @return [Boolean]
|
38
|
+
def lazy_create
|
39
|
+
false
|
40
|
+
end
|
41
|
+
|
42
|
+
# The including class must implement this to create the popup control.
|
43
|
+
#
|
44
|
+
# true if the call succeeded, false otherwise.
|
45
|
+
# @param parent [Wx::Window]
|
46
|
+
# @return [Boolean]
|
47
|
+
def create(parent)
|
48
|
+
false
|
49
|
+
end
|
50
|
+
|
51
|
+
# You only need to implement this member function if you create your popup class in non-standard way.
|
52
|
+
#
|
53
|
+
# The default implementation can handle both multiple-inherited popup control (as seen in {Wx::ComboCtrl} samples) and one allocated separately in heap.
|
54
|
+
# If you do completely re-implement this function, make sure it calls Destroy() for the popup control and also deletes this object (usually as the last thing).
|
55
|
+
# @return [void]
|
56
|
+
def destroy_popup
|
57
|
+
end
|
58
|
+
|
59
|
+
# Implement to customize matching of value string to an item container entry.
|
60
|
+
#
|
61
|
+
# <div class="wxrb-remark">
|
62
|
+
# <b>Remark:</b>
|
63
|
+
# <p>Default implementation always return true and does not alter trueItem.
|
64
|
+
# </p>
|
65
|
+
# </div>
|
66
|
+
# @param item [String] String entered, usually by user or from SetValue() call.
|
67
|
+
# @param trueItem [Boolean] if true the true item string should be returned in case matching but different
|
68
|
+
# @return [Boolean, String] Returns true if a match is found or false if not. If trueItem == true and item matches an entry, but the entry's string representation is not exactly the same (case mismatch, for example), then the true item string should be returned as the match result.
|
69
|
+
def find_item(item, trueItem=false)
|
70
|
+
true
|
71
|
+
end
|
72
|
+
|
73
|
+
# The including class may implement this to return adjusted size for the popup control, according to the variables given.
|
74
|
+
#
|
75
|
+
# <div class="wxrb-remark">
|
76
|
+
# <b>Remark:</b>
|
77
|
+
# <p>This function is called each time popup is about to be shown.
|
78
|
+
# </p>
|
79
|
+
# </div>
|
80
|
+
# @param minWidth [Integer] Preferred minimum width.
|
81
|
+
# @param prefHeight [Integer] Preferred height. May be -1 to indicate no preference.
|
82
|
+
# @param maxHeight [Integer] Max height for window, as limited by screen size.
|
83
|
+
# @return [Wx::Size]
|
84
|
+
def get_adjusted_size(minWidth, prefHeight, maxHeight)
|
85
|
+
Wx::Size.new(minWidth, prefHeight)
|
86
|
+
end
|
87
|
+
|
88
|
+
# The including class must implement this to return pointer to the associated control created in {Wx::ComboPopup#create}.
|
89
|
+
# @return [Wx::Window]
|
90
|
+
def get_control
|
91
|
+
end
|
92
|
+
|
93
|
+
# The including class must implement this to receive string value changes from {Wx::ComboCtrl}.
|
94
|
+
# @param value [String]
|
95
|
+
# @return [void]
|
96
|
+
def set_string_value(value)
|
97
|
+
end
|
98
|
+
|
99
|
+
# The including class must implement this to return string representation of the value.
|
100
|
+
# @return [String]
|
101
|
+
def get_string_value
|
102
|
+
nil
|
103
|
+
end
|
104
|
+
|
105
|
+
# The including class may implement this to do something when the parent {Wx::ComboCtrl} gets double-clicked.
|
106
|
+
# @return [void]
|
107
|
+
def on_combo_double_click
|
108
|
+
end
|
109
|
+
|
110
|
+
# The including class may implement this to receive key down events from the parent {Wx::ComboCtrl}.
|
111
|
+
#
|
112
|
+
# Events not handled should be skipped, as usual.
|
113
|
+
# @param event [Wx::KeyEvent]
|
114
|
+
# @return [void]
|
115
|
+
def on_combo_key_event(event)
|
116
|
+
event.skip
|
117
|
+
end
|
118
|
+
|
119
|
+
# The including class may implement this to receive char events from the parent {Wx::ComboCtrl}.
|
120
|
+
#
|
121
|
+
# Events not handled should be skipped, as usual.
|
122
|
+
# @param event [Wx::KeyEvent]
|
123
|
+
# @return [void]
|
124
|
+
def on_combo_char_event(event)
|
125
|
+
event.skip
|
126
|
+
end
|
127
|
+
|
128
|
+
# The including class may implement this to do special processing when popup is hidden.
|
129
|
+
# @return [void]
|
130
|
+
def on_dismiss
|
131
|
+
end
|
132
|
+
|
133
|
+
# The including class may implement this to do special processing when popup is shown.
|
134
|
+
# @return [void]
|
135
|
+
def on_popup
|
136
|
+
end
|
137
|
+
|
138
|
+
# The including class may implement this to paint the parent {Wx::ComboCtrl}.
|
139
|
+
# This is called to custom paint in the combo control itself (ie. not the popup).
|
140
|
+
#
|
141
|
+
# Default implementation draws value as string.
|
142
|
+
# @param dc [Wx::DC]
|
143
|
+
# @param rect [Wx::Rect]
|
144
|
+
# @return [void]
|
145
|
+
def paint_combo_control(dc, rect)
|
146
|
+
combo = get_combo_ctrl
|
147
|
+
if combo.get_window_style.allbits?(Wx::CB_READONLY) # ie. no textctrl
|
148
|
+
combo.prepare_background(dc, rect,0)
|
149
|
+
|
150
|
+
dc.draw_text(combo.get_value,
|
151
|
+
rect.x + combo.get_margin_left,
|
152
|
+
(rect.height-dc.get_char_height)/2 + rect.y)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
class ComboPopupWx
|
161
|
+
|
162
|
+
include ComboPopup
|
163
|
+
|
164
|
+
# this method has not been wrapped as a default popup control will always already have been
|
165
|
+
# initialized before returned from #get_combo_control
|
166
|
+
# just do nothing here (or should we raise an exception?)
|
167
|
+
def init; end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
end
|
data/lib/wx/doc/comboctrl.rb
CHANGED
@@ -7,11 +7,136 @@
|
|
7
7
|
|
8
8
|
module Wx
|
9
9
|
|
10
|
-
class
|
10
|
+
# In order to use a custom popup with {Wx::ComboCtrl}, a class must include {Wx::ComboPopup}.
|
11
|
+
#
|
12
|
+
# For more information on how to use it, see {Wx::ComboCtrl Setting Custom Popup for Wx::ComboCtrl}.
|
13
|
+
module ComboPopup
|
11
14
|
|
12
|
-
|
15
|
+
# Returns pointer to the associated parent {Wx::ComboCtrl}.
|
16
|
+
# @return [Wx::ComboCtrl]
|
17
|
+
def get_combo_ctrl; end
|
13
18
|
|
14
|
-
|
19
|
+
# The including class must implement this to initialize its internal variables.
|
20
|
+
#
|
21
|
+
# This method is called immediately after construction finishes. m_combo member variable has been initialized before the call.
|
22
|
+
# @return [void]
|
23
|
+
def init; end
|
24
|
+
|
25
|
+
# The including class may implement this to return true if it wants to delay call to {Wx::ComboPopup#create} until the popup is shown for the first time.
|
26
|
+
#
|
27
|
+
# It is more efficient, but on the other hand it is often more convenient to have the control created immediately.
|
28
|
+
#
|
29
|
+
# <div class="wxrb-remark">
|
30
|
+
# <b>Remark:</b>
|
31
|
+
# <p>Base implementation returns false.
|
32
|
+
# </p>
|
33
|
+
# </div>
|
34
|
+
# @return [Boolean]
|
35
|
+
def lazy_create; end
|
36
|
+
|
37
|
+
# The including class must implement this to create the popup control.
|
38
|
+
#
|
39
|
+
# true if the call succeeded, false otherwise.
|
40
|
+
# @param parent [Wx::Window]
|
41
|
+
# @return [Boolean]
|
42
|
+
def create(parent) end
|
43
|
+
|
44
|
+
# You only need to implement this member function if you create your popup class in non-standard way.
|
45
|
+
#
|
46
|
+
# The default implementation can handle both multiple-inherited popup control (as seen in {Wx::ComboCtrl} samples) and one allocated separately in heap.
|
47
|
+
# If you do completely re-implement this function, make sure it calls Destroy() for the popup control and also deletes this object (usually as the last thing).
|
48
|
+
# @return [void]
|
49
|
+
def destroy_popup; end
|
50
|
+
|
51
|
+
# Implement to customize matching of value string to an item container entry.
|
52
|
+
#
|
53
|
+
# <div class="wxrb-remark">
|
54
|
+
# <b>Remark:</b>
|
55
|
+
# <p>Default implementation always return true and does not alter trueItem.
|
56
|
+
# </p>
|
57
|
+
# </div>
|
58
|
+
# @param item [String] String entered, usually by user or from SetValue() call.
|
59
|
+
# @param trueItem [Boolean] if true the true item string should be returned in case matching but different
|
60
|
+
# @return [Boolean, String] Returns true if a match is found or false if not. If trueItem == true and item matches an entry, but the entry's string representation is not exactly the same (case mismatch, for example), then the true item string should be returned as the match result.
|
61
|
+
def find_item(item, trueItem=false) end
|
62
|
+
|
63
|
+
# The including class may implement this to return adjusted size for the popup control, according to the variables given.
|
64
|
+
#
|
65
|
+
# <div class="wxrb-remark">
|
66
|
+
# <b>Remark:</b>
|
67
|
+
# <p>This function is called each time popup is about to be shown.
|
68
|
+
# </p>
|
69
|
+
# </div>
|
70
|
+
# @param minWidth [Integer] Preferred minimum width.
|
71
|
+
# @param prefHeight [Integer] Preferred height. May be -1 to indicate no preference.
|
72
|
+
# @param maxHeight [Integer] Max height for window, as limited by screen size.
|
73
|
+
# @return [Wx::Size]
|
74
|
+
def get_adjusted_size(minWidth, prefHeight, maxHeight) end
|
75
|
+
|
76
|
+
# The including class must implement this to return pointer to the associated control created in {Wx::ComboPopup#create}.
|
77
|
+
# @return [Wx::Window]
|
78
|
+
def get_control; end
|
79
|
+
|
80
|
+
# The including class must implement this to receive string value changes from {Wx::ComboCtrl}.
|
81
|
+
# @param value [String]
|
82
|
+
# @return [void]
|
83
|
+
def set_string_value(value) end
|
84
|
+
|
85
|
+
# The including class must implement this to return string representation of the value.
|
86
|
+
# @return [String]
|
87
|
+
def get_string_value; end
|
88
|
+
|
89
|
+
# The including class may implement this to do something when the parent {Wx::ComboCtrl} gets double-clicked.
|
90
|
+
# @return [void]
|
91
|
+
def on_combo_double_click; end
|
92
|
+
|
93
|
+
# The including class may implement this to receive key down events from the parent {Wx::ComboCtrl}.
|
94
|
+
#
|
95
|
+
# Events not handled should be skipped, as usual.
|
96
|
+
# @param event [Wx::KeyEvent]
|
97
|
+
# @return [void]
|
98
|
+
def on_combo_key_event(event) end
|
99
|
+
|
100
|
+
# The including class may implement this to receive char events from the parent {Wx::ComboCtrl}.
|
101
|
+
#
|
102
|
+
# Events not handled should be skipped, as usual.
|
103
|
+
# @param event [Wx::KeyEvent]
|
104
|
+
# @return [void]
|
105
|
+
def on_combo_char_event(event) end
|
106
|
+
|
107
|
+
# The including class may implement this to do special processing when popup is hidden.
|
108
|
+
# @return [void]
|
109
|
+
def on_dismiss; end
|
110
|
+
|
111
|
+
# The including class may implement this to do special processing when popup is shown.
|
112
|
+
# @return [void]
|
113
|
+
def on_popup; end
|
114
|
+
|
115
|
+
# The including class may implement this to paint the parent {Wx::ComboCtrl}.
|
116
|
+
# This is called to custom paint in the combo control itself (ie. not the popup).
|
117
|
+
#
|
118
|
+
# Default implementation draws value as string.
|
119
|
+
# @param dc [Wx::DC]
|
120
|
+
# @param rect [Wx::Rect]
|
121
|
+
# @return [void]
|
122
|
+
def paint_combo_control(dc, rect) end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
# A Ruby interface class for default comboctrl popup classes used by {Wx::OwnerDrawnComboBox} and
|
127
|
+
# {Wx::RichTextStyleListBox}.
|
128
|
+
#
|
129
|
+
# If no custom popup control has been installed with {Wx::ComboCtrl#SetPopupControl} an instance of this
|
130
|
+
# class will be returned when {Wx::ComboCtrl#GetPopupControl} is called for either of the widgets mentioned
|
131
|
+
# above.
|
132
|
+
# <div class="wxrb-remark">
|
133
|
+
# <b>Remark:</b>
|
134
|
+
# <p>This is an abstract class that cannot be derived from.
|
135
|
+
# </p>
|
136
|
+
# </div>
|
137
|
+
class ComboPopupWx
|
138
|
+
|
139
|
+
include ComboPopup
|
15
140
|
|
16
141
|
end
|
17
142
|
|
@@ -7,7 +7,11 @@
|
|
7
7
|
|
8
8
|
module Wx
|
9
9
|
|
10
|
-
class OwnerDrawnComboBox
|
10
|
+
class OwnerDrawnComboBox < ComboCtrl
|
11
|
+
|
12
|
+
alias :get_item_data :get_client_object
|
13
|
+
|
14
|
+
alias :set_item_data :set_client_object
|
11
15
|
|
12
16
|
# Returns the label of the selected item or an empty string if no item is selected.
|
13
17
|
#
|
data/lib/wx/version.rb
CHANGED
@@ -22,7 +22,8 @@ namespace Swig
|
|
22
22
|
DirectorRubyException(VALUE error, VALUE rcvr, ID fn_id)
|
23
23
|
: DirectorException(Qnil)
|
24
24
|
{
|
25
|
-
VALUE msg = rb_sprintf("Caught exception in SWIG director method for %s#%s", rb_class2name(CLASS_OF(rcvr)), rb_id2name(fn_id));
|
25
|
+
VALUE msg = rb_sprintf("Caught exception in SWIG director method for %s#%s : ", rb_class2name(CLASS_OF(rcvr)), rb_id2name(fn_id));
|
26
|
+
rb_str_append(msg, rb_funcall(error, rb_intern("message"), 0));
|
26
27
|
this->swig_msg = StringValuePtr(msg);
|
27
28
|
swig_error = rb_exc_new_str(rb_eRuntimeError, msg);
|
28
29
|
VALUE bt = rb_funcall(error, rb_intern("backtrace"), 0);
|
@@ -14,9 +14,10 @@ module WXRuby3
|
|
14
14
|
|
15
15
|
class ComboCtrl < Window
|
16
16
|
|
17
|
+
include Typemap::ComboPopup
|
18
|
+
|
17
19
|
def setup
|
18
20
|
super
|
19
|
-
spec.items << 'wxComboPopup'
|
20
21
|
# mixin TextEntry
|
21
22
|
spec.include_mixin 'wxComboCtrl', { 'Wx::TextEntry' => 'wxTextEntryBase' }
|
22
23
|
spec.override_inheritance_chain('wxComboCtrl',
|
@@ -29,8 +30,108 @@ module WXRuby3
|
|
29
30
|
wxComboCtrl::DoSetPopupControl
|
30
31
|
wxComboCtrl::DoShowPopup
|
31
32
|
]
|
32
|
-
|
33
|
-
|
33
|
+
spec.add_header_code <<~__HEREDOC
|
34
|
+
#include "wxruby-ComboPopup.h"
|
35
|
+
|
36
|
+
static VALUE g_rb_mWxComboPopup = Qnil;
|
37
|
+
static VALUE g_rb_cComboPopupWx = Qnil;
|
38
|
+
|
39
|
+
WXRUBY_EXPORT wxComboPopup* wxRuby_ComboPopupFromRuby(VALUE popup)
|
40
|
+
{
|
41
|
+
if (!NIL_P(popup) && !rb_obj_is_kind_of(popup, g_rb_mWxComboPopup))
|
42
|
+
{
|
43
|
+
rb_raise(rb_eArgError, "Expected a Wx::ComboPopup or nil for 1");
|
44
|
+
return nullptr;
|
45
|
+
}
|
46
|
+
|
47
|
+
wxComboPopup* cpp = nullptr;
|
48
|
+
if (!NIL_P(popup))
|
49
|
+
{
|
50
|
+
VALUE rb_cp_proxy = rb_iv_get(popup, "@_wx_combo_popup_proxy");
|
51
|
+
if (NIL_P(rb_cp_proxy))
|
52
|
+
{
|
53
|
+
cpp = new WxRubyComboPopup(popup);
|
54
|
+
rb_cp_proxy = Data_Wrap_Struct(rb_cObject, 0, 0, cpp);
|
55
|
+
rb_iv_set(popup, "@_wx_combo_popup_proxy", rb_cp_proxy);
|
56
|
+
}
|
57
|
+
else
|
58
|
+
{
|
59
|
+
Data_Get_Struct(rb_cp_proxy, wxComboPopup, cpp);
|
60
|
+
}
|
61
|
+
}
|
62
|
+
return cpp;
|
63
|
+
}
|
64
|
+
|
65
|
+
WXRUBY_EXPORT VALUE wxRuby_ComboPopupToRuby(wxComboPopup* cpp)
|
66
|
+
{
|
67
|
+
VALUE rb_cpp = Qnil;
|
68
|
+
if (cpp)
|
69
|
+
{
|
70
|
+
WxRubyComboPopup *wxrb_cpp = dynamic_cast<WxRubyComboPopup*> (cpp);
|
71
|
+
if (wxrb_cpp)
|
72
|
+
{
|
73
|
+
rb_cpp = wxrb_cpp->GetRubyComboPopup();
|
74
|
+
}
|
75
|
+
else
|
76
|
+
{
|
77
|
+
// in this case we're probably working for a wxOwnerDrawnComboBox or wxRichTextListbox
|
78
|
+
// with default popup control which is a C++ implemented class without any Ruby linkage.
|
79
|
+
// wrap this in the Wx::ComboPopupWx class to provide a Ruby interface
|
80
|
+
rb_cpp = Data_Wrap_Struct(g_rb_cComboPopupWx, 0, 0, cpp); // do not own or track
|
81
|
+
}
|
82
|
+
}
|
83
|
+
return rb_cpp;
|
84
|
+
}
|
85
|
+
|
86
|
+
static void wxRuby_markComboPopups()
|
87
|
+
{
|
88
|
+
WxRubyComboPopup::GC_mark_combo_popups();
|
89
|
+
}
|
90
|
+
__HEREDOC
|
91
|
+
# ignore these
|
92
|
+
spec.ignore 'wxComboCtrl::SetPopupControl',
|
93
|
+
'wxComboCtrl::GetPopupControl',
|
94
|
+
ignore_doc: false
|
95
|
+
# for GetPopupControl docs only
|
96
|
+
spec.map 'wxComboPopup*' => 'Wx::ComboPopup', swig: false do
|
97
|
+
map_out code: ''
|
98
|
+
end
|
99
|
+
# and replace
|
100
|
+
spec.add_extend_code 'wxComboCtrl', <<~__HEREDOC
|
101
|
+
void SetPopupControl(VALUE popup)
|
102
|
+
{
|
103
|
+
wxComboPopup* cpp = wxRuby_ComboPopupFromRuby(popup);
|
104
|
+
$self->SetPopupControl(cpp);
|
105
|
+
}
|
106
|
+
|
107
|
+
VALUE GetPopupControl()
|
108
|
+
{
|
109
|
+
return wxRuby_ComboPopupToRuby($self->GetPopupControl());
|
110
|
+
}
|
111
|
+
__HEREDOC
|
112
|
+
spec.add_init_code <<~__HEREDOC
|
113
|
+
wxRuby_AppendMarker(wxRuby_markComboPopups);
|
114
|
+
|
115
|
+
g_rb_mWxComboPopup = rb_define_module_under(mWxCore, "ComboPopup");
|
116
|
+
rb_define_method(g_rb_mWxComboPopup, "get_combo_ctrl", VALUEFUNC(wx_combo_popup_get_combo_ctrl), -1);
|
117
|
+
|
118
|
+
g_rb_cComboPopupWx = rb_define_class_under(mWxCore, "ComboPopupWx", rb_cObject);
|
119
|
+
rb_undef_alloc_func(g_rb_cComboPopupWx);
|
120
|
+
rb_define_method(g_rb_cComboPopupWx, "lazy_create", VALUEFUNC(combo_popup_wx_lazy_create), -1);
|
121
|
+
rb_define_method(g_rb_cComboPopupWx, "create", VALUEFUNC(combo_popup_wx_create), -1);
|
122
|
+
rb_define_method(g_rb_cComboPopupWx, "get_combo_ctrl", VALUEFUNC(combo_popup_wx_get_combo_ctrl), -1);
|
123
|
+
rb_define_method(g_rb_cComboPopupWx, "find_item", VALUEFUNC(combo_popup_wx_find_item), -1);
|
124
|
+
rb_define_method(g_rb_cComboPopupWx, "get_adjusted_size", VALUEFUNC(combo_popup_wx_get_adjusted_size), -1);
|
125
|
+
rb_define_method(g_rb_cComboPopupWx, "get_control", VALUEFUNC(combo_popup_wx_get_control), -1);
|
126
|
+
rb_define_method(g_rb_cComboPopupWx, "set_string_value", VALUEFUNC(combo_popup_wx_set_string_value), -1);
|
127
|
+
rb_define_method(g_rb_cComboPopupWx, "get_string_value", VALUEFUNC(combo_popup_wx_get_string_value), -1);
|
128
|
+
rb_define_method(g_rb_cComboPopupWx, "on_combo_double_click", VALUEFUNC(combo_popup_wx_on_combo_double_click), -1);
|
129
|
+
rb_define_method(g_rb_cComboPopupWx, "on_combo_key_event", VALUEFUNC(combo_popup_wx_on_combo_key_event), -1);
|
130
|
+
rb_define_method(g_rb_cComboPopupWx, "on_combo_char_event", VALUEFUNC(combo_popup_wx_on_combo_char_event), -1);
|
131
|
+
rb_define_method(g_rb_cComboPopupWx, "on_dismiss", VALUEFUNC(combo_popup_wx_on_dismiss), -1);
|
132
|
+
rb_define_method(g_rb_cComboPopupWx, "on_popup", VALUEFUNC(combo_popup_wx_on_popup), -1);
|
133
|
+
rb_define_method(g_rb_cComboPopupWx, "paint_combo_control", VALUEFUNC(combo_popup_wx_paint_combo_control), -1);
|
134
|
+
__HEREDOC
|
34
135
|
end
|
35
136
|
|
36
137
|
end # class ComboCtrl
|
@@ -49,6 +49,12 @@ module WXRuby3
|
|
49
49
|
'wxRect::Intersect(const wxRect &)',
|
50
50
|
'wxRect::Union(const wxRect &)'
|
51
51
|
]
|
52
|
+
if Config.instance.wx_version >= '3.3.0'
|
53
|
+
# ignore these as they are supposed to specify unary minus but confuse
|
54
|
+
# SWIG
|
55
|
+
spec.ignore 'wxPoint::operator-(const wxPoint&)',
|
56
|
+
'wxRealPoint::operator-(const wxRealPoint&)'
|
57
|
+
end
|
52
58
|
spec.regard 'wxRect::Offset', regard_doc: false
|
53
59
|
# overrule common wxPoint mapping for wxRect ctor to fix ctor ambiguities here wrt wxSize
|
54
60
|
spec.map 'const wxPoint& topLeft', 'const wxPoint& bottomRight', as: 'Wx::Point' do
|
@@ -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
|
27
|
+
if Config.instance.wx_version > '3.2.4'
|
28
28
|
spec.ignore_unless('WXMSW', 'wxMenuItem::SetBackgroundColour','wxMenuItem::SetFont','wxMenuItem::SetTextColour')
|
29
29
|
end
|
30
30
|
super
|
@@ -383,13 +383,11 @@ module WXRuby3
|
|
383
383
|
# hardcoded interface declarations
|
384
384
|
spec.add_interface_code <<~__HEREDOC
|
385
385
|
// Bit masks used for numeric validator styles.
|
386
|
-
enum wxNumValidatorStyle
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
wxNUM_VAL_NO_TRAILING_ZEROES = 0x4
|
392
|
-
};
|
386
|
+
enum wxNumValidatorStyle;
|
387
|
+
%constant int NumValidatorStyle_wxNUM_VAL_DEFAULT = 0x0;
|
388
|
+
%constant int NumValidatorStyle_wxNUM_VAL_THOUSANDS_SEPARATOR = 0x1;
|
389
|
+
%constant int NumValidatorStyle_wxNUM_VAL_ZERO_AS_BLANK = 0x2;
|
390
|
+
%constant int NumValidatorStyle_wxNUM_VAL_NO_TRAILING_ZEROES = 0x4;
|
393
391
|
|
394
392
|
%alias WXIntegerValidator::GetMin "min";
|
395
393
|
%alias WXIntegerValidator::SetMin "min=";
|
@@ -14,8 +14,8 @@ module WXRuby3
|
|
14
14
|
|
15
15
|
def setup
|
16
16
|
spec.items << 'wxPersistentTLW' << 'wxPersistentBookCtrl' << 'wxPersistentTreeBookCtrl'
|
17
|
-
if Config.instance.wx_version
|
18
|
-
#
|
17
|
+
if Config.instance.wx_version > '3.2.4'
|
18
|
+
# only after 3.2.4 properly available
|
19
19
|
spec.items << 'wxPersistentComboBox'
|
20
20
|
end
|
21
21
|
super
|
@@ -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
|
20
|
+
if Config.instance.wx_version > '3.2.4'
|
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
|
68
|
+
if Config.instance.wx_version > '3.2.4'
|
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
|
114
|
+
if Config.instance.wx_version > '3.2.4'
|
115
115
|
# currently missing from interface docs
|
116
116
|
spec.extend_interface kls,
|
117
117
|
'int GetIndex() const',
|
@@ -136,7 +136,7 @@ module WXRuby3
|
|
136
136
|
'wxLongStringProperty::DisplayEditorDialog',
|
137
137
|
'wxMultiChoiceProperty::DisplayEditorDialog',
|
138
138
|
'wxFontProperty::DisplayEditorDialog'
|
139
|
-
if Config.instance.wx_version
|
139
|
+
if Config.instance.wx_version > '3.2.4'
|
140
140
|
# for wxEnumProperty and derivatives ValueFromString_/ValueFromInt_
|
141
141
|
spec.map_apply 'int * OUTPUT' => 'int* pIndex'
|
142
142
|
end
|
@@ -113,7 +113,11 @@ module WXRuby3
|
|
113
113
|
# do not think this useful for wxRuby (Also; caused GC problems)
|
114
114
|
spec.ignore 'wxPGProperty::GetCellRenderer'
|
115
115
|
# obsolete
|
116
|
-
|
116
|
+
if Config.instance.wx_version < '3.3.0'
|
117
|
+
spec.ignore %w[wxPGProperty::AddChild wxPGProperty::GetValueString]
|
118
|
+
else
|
119
|
+
spec.ignore 'wxPGProperty::AddChild'
|
120
|
+
end
|
117
121
|
# not of use in Ruby
|
118
122
|
spec.ignore(%w[wxPGProperty::GetClientData wxPGProperty::SetClientData])
|
119
123
|
# only keep the const version
|
@@ -15,6 +15,7 @@ module WXRuby3
|
|
15
15
|
class RichTextStyleListBox < Window
|
16
16
|
|
17
17
|
include Typemap::RichText
|
18
|
+
include Typemap::ComboPopup
|
18
19
|
|
19
20
|
def setup
|
20
21
|
super
|
@@ -28,6 +29,10 @@ module WXRuby3
|
|
28
29
|
wxWindow
|
29
30
|
wxEvtHandler
|
30
31
|
wxObject])
|
32
|
+
# missing from docs; required so proxy calls correct override
|
33
|
+
spec.extend_interface 'wxRichTextStyleComboCtrl',
|
34
|
+
'virtual void DoSetPopupControl(wxComboPopup* popup)',
|
35
|
+
visibility: 'protected'
|
31
36
|
end
|
32
37
|
|
33
38
|
end
|
@@ -20,7 +20,7 @@ module WXRuby3
|
|
20
20
|
when 'wxSizer'
|
21
21
|
spec.items << 'wxSizerFlags'
|
22
22
|
spec.gc_as_untracked('wxSizerFlags')
|
23
|
-
|
23
|
+
unless Config.instance.wx_version > '3.2.4'
|
24
24
|
# missing from docs
|
25
25
|
spec.extend_interface 'wxSizerFlags',
|
26
26
|
'wxSizerFlags& HorzBorder()'
|
@@ -126,6 +126,10 @@ module WXRuby3
|
|
126
126
|
else
|
127
127
|
spec.ignore('wxWindow::SetAccessible',
|
128
128
|
'wxWindow::GetAccessible')
|
129
|
+
if Config.instance.wx_version > '3.2.4'
|
130
|
+
spec.ignore('wxWindow::CreateAccessible',
|
131
|
+
'wxWindow::GetOrCreateAccessible')
|
132
|
+
end
|
129
133
|
end
|
130
134
|
spec.ignore_unless('USE_HOTKEY', %w[wxWindow::RegisterHotKey wxWindow::UnregisterHotKey])
|
131
135
|
spec.ignore('wxWindow::SetSize(int, int)') # not useful as the wxSize variant will also accept an array
|
@@ -117,6 +117,13 @@ module WXRuby3
|
|
117
117
|
when 'file', 'namespace'
|
118
118
|
Extractor.extracting_msg(kind, element, 'compoundname')
|
119
119
|
element.xpath('sectiondef/memberdef').each { |node| self.add_element(node) }
|
120
|
+
# from doxygen 1.9.7 onwards some members are not included in the same XML file
|
121
|
+
# but referenced from another XML file; so we need to resolve such references
|
122
|
+
# and than add the resolved element
|
123
|
+
element.xpath('sectiondef/member').each do |node|
|
124
|
+
node = self.resolveRefId(node)
|
125
|
+
self.add_element(node)
|
126
|
+
end
|
120
127
|
|
121
128
|
else
|
122
129
|
raise ExtractorError.new('Unknown module item kind: %s' % kind)
|
@@ -124,6 +131,14 @@ module WXRuby3
|
|
124
131
|
item
|
125
132
|
end
|
126
133
|
|
134
|
+
def resolveRefId(node)
|
135
|
+
refid = node['refid'].split('_')
|
136
|
+
refid.pop
|
137
|
+
fname = File.join(Extractor.xml_dir, refid.join('_')+'.xml')
|
138
|
+
root = File.open(fname) {|f| Nokogiri::XML(f) }.root
|
139
|
+
root.at_xpath(".//sectiondef/memberdef[@id='#{node['refid']}']")
|
140
|
+
end
|
141
|
+
|
127
142
|
# Add a new C++ function into the module that is written by hand, not
|
128
143
|
# wrapped.
|
129
144
|
def add_cpp_function(type, name, argsString, body, doc = nil, **kwargs)
|