wxruby3 1.3.0 → 1.4.2
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 +16 -12
- data/README.md +4 -3
- data/ext/wxruby3/include/wxRubyApp.h +9 -9
- data/ext/wxruby3/swig/custom/director.swg +11 -3
- data/ext/wxruby3/swig/custom/rubyapi.swg +15 -1
- data/ext/wxruby3/swig/mark_free_impl.i +47 -11
- data/ext/wxruby3/swig/wx.i +30 -12
- data/lib/wx/aui/auifloatframe.rb +1 -1
- data/lib/wx/aui/auimanager.rb +50 -14
- data/lib/wx/aui/auinotebook.rb +1 -1
- data/lib/wx/aui/require.rb +0 -2
- data/lib/wx/core/acceleratortable.rb +1 -1
- data/lib/wx/core/animation.rb +2 -2
- data/lib/wx/core/app.rb +1 -1
- data/lib/wx/core/array_ext.rb +1 -0
- data/lib/wx/core/artprovider.rb +4 -4
- data/lib/wx/core/bitmap.rb +1 -1
- data/lib/wx/core/bitmap_combobox.rb +2 -2
- data/lib/wx/core/brush.rb +8 -0
- data/lib/wx/core/clientdc.rb +1 -1
- data/lib/wx/core/clipboard.rb +4 -4
- data/lib/wx/core/colour.rb +1 -1
- data/lib/wx/core/combobox.rb +1 -1
- data/lib/wx/core/config.rb +7 -7
- data/lib/wx/core/controlwithitems.rb +3 -3
- data/lib/wx/core/data_object.rb +4 -4
- data/lib/wx/core/dataformat.rb +9 -3
- data/lib/wx/core/defs.rb +49 -0
- data/lib/wx/core/dialog.rb +3 -2
- data/lib/wx/core/enum.rb +16 -3
- data/lib/wx/core/event.rb +3 -3
- data/lib/wx/core/evthandler.rb +317 -289
- data/lib/wx/core/file_dialog.rb +1 -1
- data/lib/wx/core/find_replace_dialog.rb +2 -2
- data/lib/wx/core/font.rb +14 -0
- data/lib/wx/core/functions.rb +1 -1
- data/lib/wx/core/genericdirctrl.rb +1 -1
- data/lib/wx/core/geometry.rb +2 -2
- data/lib/wx/core/graphics_pen_info.rb +1 -1
- data/lib/wx/core/hboxsizer.rb +24 -4
- data/lib/wx/core/helpprovider.rb +1 -1
- data/lib/wx/core/icon.rb +1 -1
- data/lib/wx/core/image.rb +2 -2
- data/lib/wx/core/imagelist.rb +1 -1
- data/lib/wx/core/locale.rb +5 -5
- data/lib/wx/core/log.rb +8 -8
- data/lib/wx/core/menu.rb +3 -3
- data/lib/wx/core/module_ext.rb +16 -0
- data/lib/wx/core/owner_drawn_combobox.rb +3 -3
- data/lib/wx/core/pen.rb +20 -0
- data/lib/wx/core/pen_info.rb +1 -1
- data/lib/wx/core/persistence_manager.rb +2 -2
- data/lib/wx/core/real_point.rb +1 -0
- data/lib/wx/core/rect.rb +1 -1
- data/lib/wx/core/secret_store.rb +1 -1
- data/lib/wx/core/simplehelpprovider.rb +1 -1
- data/lib/wx/core/sizer.rb +166 -39
- data/lib/wx/core/splash_screen.rb +1 -1
- data/lib/wx/core/standard_paths.rb +1 -1
- data/lib/wx/core/task_bar_button.rb +1 -1
- data/lib/wx/core/text_entry.rb +1 -1
- data/lib/wx/core/textctrl.rb +2 -2
- data/lib/wx/core/timer.rb +2 -2
- data/lib/wx/core/tree_ctrl.rb +1 -1
- data/lib/wx/core/v_list_box.rb +1 -1
- data/lib/wx/core/validator.rb +2 -2
- data/lib/wx/core/variant.rb +2 -2
- data/lib/wx/core/vboxsizer.rb +24 -4
- data/lib/wx/core/window.rb +48 -2
- data/lib/wx/core/xmlresource.rb +4 -4
- data/lib/wx/core.rb +2 -0
- data/lib/wx/doc/array_ext.rb +1 -0
- data/lib/wx/doc/aui/auimanager.rb +2 -0
- data/lib/wx/doc/enum.rb +26 -0
- data/lib/wx/doc/evthandler.rb +1 -0
- data/lib/wx/doc/gdi_common.rb +1 -0
- data/lib/wx/doc/tip_window.rb +22 -0
- data/lib/wx/grid/grid.rb +3 -3
- data/lib/wx/grid/require.rb +0 -2
- data/lib/wx/html/htmlhelpcontroller.rb +1 -1
- data/lib/wx/html/htmlwindow.rb +1 -1
- data/lib/wx/html/require.rb +0 -2
- data/lib/wx/html/simple_html_listbox.rb +3 -3
- data/lib/wx/keyword_ctors.rb +14 -7
- data/lib/wx/keyword_defs.rb +7 -7
- data/lib/wx/pg/pg_properties.rb +1 -1
- data/lib/wx/pg/pg_property.rb +3 -3
- data/lib/wx/pg/property_grid.rb +2 -2
- data/lib/wx/pg/property_grid_interface.rb +2 -2
- data/lib/wx/pg/require.rb +0 -2
- data/lib/wx/prt/previewframe.rb +1 -1
- data/lib/wx/prt/require.rb +0 -2
- data/lib/wx/rbn/ribbon_control.rb +1 -1
- data/lib/wx/rbn/ribbon_page.rb +1 -1
- data/lib/wx/rbn/ribbon_panel.rb +1 -1
- data/lib/wx/rtc/require.rb +0 -2
- data/lib/wx/rtc/rich_text_composite_object.rb +1 -1
- data/lib/wx/rtc/rich_text_ctrl.rb +1 -1
- data/lib/wx/rtc/rich_text_paragraph.rb +1 -1
- data/lib/wx/rtc/richtext_buffer.rb +3 -3
- data/lib/wx/rtc/richtext_formatting_dialog.rb +2 -2
- data/lib/wx/rtc/richtext_style_organiser_dialog.rb +1 -1
- data/lib/wx/rtc/symbol_picker_dialog.rb +1 -1
- data/lib/wx/stc/require.rb +0 -2
- data/lib/wx/stc/styled_text_ctrl.rb +1 -1
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/base.rb +8 -2
- data/lib/wx/wxruby/cmd/setup.rb +61 -37
- data/rakelib/gem.rb +8 -4
- data/rakelib/lib/config/mingw.rb +1 -1
- data/rakelib/lib/core/include/swigrubyrun.inc +2 -2
- data/rakelib/lib/director/about_dialog_info.rb +1 -0
- data/rakelib/lib/director/aui_manager.rb +124 -3
- data/rakelib/lib/director/aui_notebook.rb +7 -0
- data/rakelib/lib/director/colour.rb +1 -1
- data/rakelib/lib/director/data_format.rb +1 -1
- data/rakelib/lib/director/dialog.rb +4 -2
- data/rakelib/lib/director/event.rb +1 -0
- data/rakelib/lib/director/event_handler.rb +82 -46
- data/rakelib/lib/director/functions.rb +0 -3
- data/rakelib/lib/director/list_ctrl.rb +14 -10
- data/rakelib/lib/director/locale.rb +2 -0
- data/rakelib/lib/director/num_validator.rb +7 -0
- data/rakelib/lib/director/pgproperties.rb +2 -2
- data/rakelib/lib/director/property_grid_interface.rb +4 -3
- data/rakelib/lib/director/textctrl.rb +7 -0
- data/rakelib/lib/director/tip_window.rb +34 -0
- data/rakelib/lib/director/variant.rb +2 -2
- data/rakelib/lib/director/window.rb +9 -1
- data/rakelib/lib/director.rb +0 -1
- data/rakelib/lib/extractor/function.rb +5 -0
- data/rakelib/lib/generate/doc/evt_handler.yaml +31 -12
- data/rakelib/lib/specs/interfaces.rb +1 -0
- data/rakelib/lib/typemap/common.rb +2 -2
- data/samples/dialogs/dialogs.rb +1 -1
- data/tests/test_combo_ctrl.rb +1 -0
- data/tests/test_event_handling.rb +158 -31
- metadata +7 -5
|
@@ -15,7 +15,7 @@ class Wx::SplashScreen
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# now redefine the overridden ctor to account for deviating arglist
|
|
18
|
-
|
|
18
|
+
wx_redefine_method :initialize do |bitmap, splashstyle, milliseconds, parent = nil, *mixed_args, &block|
|
|
19
19
|
# no zero-args ctor for use with XRC!
|
|
20
20
|
|
|
21
21
|
real_args = begin
|
|
@@ -9,7 +9,7 @@ module Wx
|
|
|
9
9
|
class TaskBarButton
|
|
10
10
|
|
|
11
11
|
wx_remove_thumb_bar_button = instance_method :remove_thumb_bar_button
|
|
12
|
-
|
|
12
|
+
wx_redefine_method :remove_thumb_bar_button do |button|
|
|
13
13
|
button = button.get_id if button.is_a?(Wx::ThumbBarButton)
|
|
14
14
|
wx_remove_thumb_bar_button.bind(self).call(button)
|
|
15
15
|
end
|
data/lib/wx/core/text_entry.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Wx
|
|
|
11
11
|
module TextEntry
|
|
12
12
|
|
|
13
13
|
wx_auto_complete = instance_method :auto_complete
|
|
14
|
-
|
|
14
|
+
wx_redefine_method :auto_complete do |completer|
|
|
15
15
|
if wx_auto_complete.bind(self).call(completer)
|
|
16
16
|
@completer = completer.is_a?(Wx::TextCompleter) ? completer : nil # keep the Ruby object alive or cleanup
|
|
17
17
|
true
|
data/lib/wx/core/textctrl.rb
CHANGED
|
@@ -58,14 +58,14 @@ module Wx
|
|
|
58
58
|
|
|
59
59
|
class TextCtrl
|
|
60
60
|
wx_op_append = instance_method :<<
|
|
61
|
-
|
|
61
|
+
wx_redefine_method :<< do |o|
|
|
62
62
|
wx_op_append.bind(self).call(o.to_s)
|
|
63
63
|
self
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
# Overload to provide Enumerator without block
|
|
67
67
|
wx_each_line = instance_method :each_line
|
|
68
|
-
|
|
68
|
+
wx_redefine_method :each_line do |&block|
|
|
69
69
|
if block
|
|
70
70
|
wx_each_line.bind(self).call(&block)
|
|
71
71
|
else
|
data/lib/wx/core/timer.rb
CHANGED
|
@@ -47,14 +47,14 @@ class Wx::Timer
|
|
|
47
47
|
|
|
48
48
|
# Redefine initialize
|
|
49
49
|
wx_init = self.instance_method(:initialize)
|
|
50
|
-
|
|
50
|
+
wx_redefine_method(:initialize) do | *args |
|
|
51
51
|
setup_owner_destruction_hook(args[0])
|
|
52
52
|
wx_init.bind(self).call(*args)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
# Redefine set_owner
|
|
56
56
|
wx_set_owner = self.instance_method(:set_owner)
|
|
57
|
-
|
|
57
|
+
wx_redefine_method(:set_owner) do | *args |
|
|
58
58
|
setup_owner_destruction_hook(args[0])
|
|
59
59
|
wx_set_owner.bind(self).call(*args)
|
|
60
60
|
end
|
data/lib/wx/core/tree_ctrl.rb
CHANGED
|
@@ -12,7 +12,7 @@ class Wx::TreeCtrl
|
|
|
12
12
|
|
|
13
13
|
# Overload to provide Enumerator without block
|
|
14
14
|
wx_traverse = instance_method :traverse
|
|
15
|
-
|
|
15
|
+
wx_redefine_method :traverse do |start_id=nil, &block|
|
|
16
16
|
if block
|
|
17
17
|
wx_traverse.bind(self).call(start_id, &block)
|
|
18
18
|
else
|
data/lib/wx/core/v_list_box.rb
CHANGED
data/lib/wx/core/validator.rb
CHANGED
|
@@ -34,7 +34,7 @@ class Wx::Validator
|
|
|
34
34
|
module Binding
|
|
35
35
|
def self.included(base)
|
|
36
36
|
wx_on_transfer_from_window = base.instance_method :on_transfer_from_window
|
|
37
|
-
base.
|
|
37
|
+
base.wx_redefine_method :on_transfer_from_window do |meth = nil, &block|
|
|
38
38
|
proc = if block and not meth
|
|
39
39
|
block
|
|
40
40
|
elsif meth and not block
|
|
@@ -54,7 +54,7 @@ class Wx::Validator
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
wx_on_transfer_to_window = base.instance_method :on_transfer_to_window
|
|
57
|
-
base.
|
|
57
|
+
base.wx_redefine_method :on_transfer_to_window do |meth = nil, &block|
|
|
58
58
|
proc = if block and not meth
|
|
59
59
|
block
|
|
60
60
|
elsif meth and not block
|
data/lib/wx/core/variant.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Wx
|
|
|
24
24
|
|
|
25
25
|
# make assign return self and add it's handy alias
|
|
26
26
|
wx_assign = instance_method :assign
|
|
27
|
-
|
|
27
|
+
wx_redefine_method :assign do |v|
|
|
28
28
|
wx_assign.bind(self).call(v)
|
|
29
29
|
self
|
|
30
30
|
end
|
|
@@ -33,7 +33,7 @@ module Wx
|
|
|
33
33
|
# extend to_s to arraylist and list (easier in pure Ruby)
|
|
34
34
|
|
|
35
35
|
wx_to_s = instance_method :to_s
|
|
36
|
-
|
|
36
|
+
wx_redefine_method :to_s do
|
|
37
37
|
unless null?
|
|
38
38
|
case type
|
|
39
39
|
when 'list'
|
data/lib/wx/core/vboxsizer.rb
CHANGED
|
@@ -9,14 +9,34 @@
|
|
|
9
9
|
# Just a shortcut version for creating a vertical box sizer
|
|
10
10
|
|
|
11
11
|
class Wx::VBoxSizer < Wx::BoxSizer
|
|
12
|
-
def initialize
|
|
13
|
-
super(Wx::VERTICAL)
|
|
12
|
+
def initialize(&block)
|
|
13
|
+
super(Wx::VERTICAL, &nil)
|
|
14
|
+
if block
|
|
15
|
+
if block.arity == -1 or block.arity == 0
|
|
16
|
+
self.instance_eval(&block)
|
|
17
|
+
elsif block.arity == 1
|
|
18
|
+
block.call(self)
|
|
19
|
+
else
|
|
20
|
+
Kernel.raise ArgumentError,
|
|
21
|
+
"Block to initialize should accept a single argument or none"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
14
24
|
end
|
|
15
25
|
end
|
|
16
26
|
|
|
17
27
|
# Just a shortcut version for creating a vertical wrap sizer
|
|
18
28
|
class Wx::VWrapSizer < Wx::WrapSizer
|
|
19
|
-
def initialize(flags=Wx::WRAPSIZER_DEFAULT_FLAGS)
|
|
20
|
-
super(Wx::VERTICAL)
|
|
29
|
+
def initialize(flags=Wx::WRAPSIZER_DEFAULT_FLAGS, &block)
|
|
30
|
+
super(Wx::VERTICAL, &nil)
|
|
31
|
+
if block
|
|
32
|
+
if block.arity == -1 or block.arity == 0
|
|
33
|
+
self.instance_eval(&block)
|
|
34
|
+
elsif block.arity == 1
|
|
35
|
+
block.call(self)
|
|
36
|
+
else
|
|
37
|
+
Kernel.raise ArgumentError,
|
|
38
|
+
"Block to initialize should accept a single argument or none"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
21
41
|
end
|
|
22
42
|
end
|
data/lib/wx/core/window.rb
CHANGED
|
@@ -30,6 +30,52 @@ class Wx::Window
|
|
|
30
30
|
alias :bring_to_front :raise_window
|
|
31
31
|
alias :send_to_back :lower_window
|
|
32
32
|
|
|
33
|
+
# Event handling overrides
|
|
34
|
+
class << self
|
|
35
|
+
def process_event(evh, event)
|
|
36
|
+
(@m_process_event ||= Wx::EvtHandler.instance_method(:process_event)).bind(evh).call(event)
|
|
37
|
+
end
|
|
38
|
+
def process_event_locally(evh, event)
|
|
39
|
+
(@m_process_event_locally ||= Wx::EvtHandler.instance_method(:process_event_locally)).bind(evh).call(event)
|
|
40
|
+
end
|
|
41
|
+
def safely_process_event(evh, event)
|
|
42
|
+
(@m_safely_process_event ||= Wx::EvtHandler.instance_method(:safely_process_event)).bind(evh).call(event)
|
|
43
|
+
end
|
|
44
|
+
def process_pending_events(evh)
|
|
45
|
+
(@m_process_pending_events ||= Wx::EvtHandler.instance_method(:process_pending_events)).bind(evh).call
|
|
46
|
+
end
|
|
47
|
+
def queue_event(evh, event)
|
|
48
|
+
(@m_queue_event ||= Wx::EvtHandler.instance_method(:queue_event)).bind(evh).call(event)
|
|
49
|
+
end
|
|
50
|
+
def add_pending_event(evh, event)
|
|
51
|
+
(@m_add_pending_event ||= Wx::EvtHandler.instance_method(:add_pending_event)).bind(evh).call(event)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def process_event(event)
|
|
56
|
+
Wx::Window.process_event(get_event_handler, event)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def process_event_locally(event)
|
|
60
|
+
Wx::Window.process_event_locally(get_event_handler, event)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def safely_process_event(event)
|
|
64
|
+
Wx::Window.safely_process_event(get_event_handler, event)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def process_pending_events
|
|
68
|
+
Wx::Window.process_pending_events(get_event_handler)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def queue_event(event)
|
|
72
|
+
Wx::Window.queue_event(get_event_handler, event)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def add_pending_event(event)
|
|
76
|
+
Wx::Window.add_pending_event(get_event_handler, event)
|
|
77
|
+
end
|
|
78
|
+
|
|
33
79
|
# Recursively searches all windows below +self+ and returns the first
|
|
34
80
|
# window which has the id +an_id+. This corresponds to the find_window
|
|
35
81
|
# method method in WxWidgets when called with an integer.
|
|
@@ -67,7 +113,7 @@ class Wx::Window
|
|
|
67
113
|
|
|
68
114
|
# Overload the wrapper method to check for @__painting__
|
|
69
115
|
wx_paint_buffered = instance_method :paint_buffered
|
|
70
|
-
|
|
116
|
+
wx_redefine_method :paint_buffered do |&block|
|
|
71
117
|
if instance_variable_defined?('@__painting__')
|
|
72
118
|
wx_paint_buffered.bind(self).call(&block)
|
|
73
119
|
else
|
|
@@ -77,7 +123,7 @@ class Wx::Window
|
|
|
77
123
|
|
|
78
124
|
# Overload to provide Enumerator without block
|
|
79
125
|
wx_each_child = instance_method :each_child
|
|
80
|
-
|
|
126
|
+
wx_redefine_method :each_child do |&block|
|
|
81
127
|
if block
|
|
82
128
|
wx_each_child.bind(self).call(&block)
|
|
83
129
|
else
|
data/lib/wx/core/xmlresource.rb
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
class Wx::XmlResource
|
|
10
10
|
class << self
|
|
11
11
|
wx_get = self.instance_method(:get)
|
|
12
|
-
|
|
12
|
+
wx_redefine_method(:get) do
|
|
13
13
|
result = wx_get.bind(self).call
|
|
14
14
|
result.init_all_handlers
|
|
15
15
|
result
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
wx_add_subclass_factory = self.instance_method(:add_subclass_factory)
|
|
19
|
-
|
|
19
|
+
wx_redefine_method(:add_subclass_factory) do |factory|
|
|
20
20
|
@factories ||= []
|
|
21
21
|
@factories << factory # keep Ruby factories alive through GC
|
|
22
22
|
wx_add_subclass_factory.bind(self).call(factory)
|
|
@@ -25,7 +25,7 @@ class Wx::XmlResource
|
|
|
25
25
|
|
|
26
26
|
# Again, if created via new, switch subclassing off and init_all_handlers
|
|
27
27
|
wx_init = self.instance_method(:initialize)
|
|
28
|
-
|
|
28
|
+
wx_redefine_method(:initialize) do | *args |
|
|
29
29
|
result = wx_init.bind(self).call(*args)
|
|
30
30
|
result.init_all_handlers
|
|
31
31
|
end
|
|
@@ -35,7 +35,7 @@ class Wx::XmlResource
|
|
|
35
35
|
# file. In ruby, in these circumstances, it's more natural to raise an
|
|
36
36
|
# Exception than expect the user to test the return value.
|
|
37
37
|
wx_load = self.instance_method(:load)
|
|
38
|
-
|
|
38
|
+
wx_redefine_method(:load) do | fname |
|
|
39
39
|
result = wx_load.bind(self).call(fname)
|
|
40
40
|
if not result
|
|
41
41
|
Kernel.raise( RuntimeError,
|
data/lib/wx/core.rb
CHANGED
|
@@ -38,6 +38,8 @@ require 'wx/global_const'
|
|
|
38
38
|
# ctor syntax sweeteners support
|
|
39
39
|
require 'wx/keyword_ctors'
|
|
40
40
|
|
|
41
|
+
require 'wx/core/module_ext'
|
|
42
|
+
|
|
41
43
|
# Load in all the class extension methods written in ruby
|
|
42
44
|
# evthandler must be required first b/c it sets up methods modified elsewhere
|
|
43
45
|
require 'wx/core/evthandler.rb'
|
data/lib/wx/doc/array_ext.rb
CHANGED
|
@@ -12,7 +12,9 @@ module Wx
|
|
|
12
12
|
class AuiManager
|
|
13
13
|
|
|
14
14
|
# Yield each pane to the given block.
|
|
15
|
+
# If no block passed returns an Enumerator.
|
|
15
16
|
# @yieldparam [Wx::AUI::AuiPaneInfo] pane the Aui pane info yielded
|
|
17
|
+
# @return [::Object, ::Enumerator] result of last block execution or enumerator
|
|
16
18
|
def each_pane; end
|
|
17
19
|
|
|
18
20
|
# Returns an array of all panes managed by the frame manager.
|
data/lib/wx/doc/enum.rb
CHANGED
|
@@ -18,6 +18,32 @@ module Wx
|
|
|
18
18
|
# type safety for arguments requiring the specific enum class.
|
|
19
19
|
class Enum < Numeric
|
|
20
20
|
|
|
21
|
+
class << self
|
|
22
|
+
|
|
23
|
+
# Sets a class specific list of enumerator ids (symbols) that should be considered
|
|
24
|
+
# non-distinctive enum values (examples would be convenience constants combining
|
|
25
|
+
# multiple distinctive enumerators or enumerators denoting the first/lowest and/or last/highest
|
|
26
|
+
# distinctive enumerators). Mostly useful for bitmask enum classes.
|
|
27
|
+
# @param [Array<Symbol>] lst
|
|
28
|
+
def set_non_distinct(lst) end
|
|
29
|
+
alias :non_distinct= :set_non_distinct
|
|
30
|
+
|
|
31
|
+
# Returns the class specific list of enumerator ids (symbols) that should be considered
|
|
32
|
+
# non-distinctive enum values. Returns nil if not set.
|
|
33
|
+
# @see set_non_distinct
|
|
34
|
+
# @return [Array<Symbol>,nil]
|
|
35
|
+
def non_distinct; end
|
|
36
|
+
|
|
37
|
+
# Returns a hash table with enumerator value : enumerator id (symbol) pairs for the enum class.
|
|
38
|
+
# @param [Array<Symbol>, nil] excludes list of enumerator ids (symbols) to exclude (by default the non_distinct list is used if defined)
|
|
39
|
+
# @return [Hash(Integer, Symbol)]
|
|
40
|
+
def enumerators(excludes = nil) end
|
|
41
|
+
|
|
42
|
+
# Returns the enumerator for the given enumerator symbol or nil if no such enumerator exists.
|
|
43
|
+
# @return [Wx::Enum, nil]
|
|
44
|
+
def [](enum_name) end
|
|
45
|
+
end
|
|
46
|
+
|
|
21
47
|
# Initialize a new enum value.
|
|
22
48
|
# @param [Integer] val enum integer value
|
|
23
49
|
def initialize(val)end
|
data/lib/wx/doc/evthandler.rb
CHANGED
|
@@ -143,6 +143,7 @@ module Wx
|
|
|
143
143
|
def call_after(meth = nil, *args, &block) end
|
|
144
144
|
|
|
145
145
|
# Process a {Wx::EVT_HOTKEY} event.
|
|
146
|
+
# @wxrb_require WXOSX|WXMSW
|
|
146
147
|
# @param [Integer] id hotkey id
|
|
147
148
|
# @param [String,Symbol,Method,Proc] meth (name of) method or handler proc
|
|
148
149
|
# @yieldparam [Wx::KeyEvent] event the event to handle
|
data/lib/wx/doc/gdi_common.rb
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# :stopdoc:
|
|
2
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
|
3
|
+
#
|
|
4
|
+
# This software is released under the MIT license.
|
|
5
|
+
# :startdoc:
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module Wx
|
|
9
|
+
|
|
10
|
+
class TipWindow < Wx::Window
|
|
11
|
+
|
|
12
|
+
# Constructor.
|
|
13
|
+
#
|
|
14
|
+
# The tip is shown immediately after the window is constructed.
|
|
15
|
+
# @param [Wx::Window] parent The parent window, must be non-nil
|
|
16
|
+
# @param [String] text The text to show, may contain the new line characters
|
|
17
|
+
# @param [Integer] max_length The length of each line, in pixels. Set to a very large value to avoid wrapping lines.
|
|
18
|
+
def initialize(parent, text, max_length = 100); end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
data/lib/wx/grid/grid.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Wx
|
|
|
13
13
|
alias :table= :assign_table
|
|
14
14
|
|
|
15
15
|
wx_each_selected_block = instance_method :each_selected_block
|
|
16
|
-
|
|
16
|
+
wx_redefine_method :each_selected_block do
|
|
17
17
|
if block_given?
|
|
18
18
|
wx_each_selected_block.bind(self).call
|
|
19
19
|
else
|
|
@@ -27,7 +27,7 @@ module Wx
|
|
|
27
27
|
alias :selected_blocks :get_selected_blocks
|
|
28
28
|
|
|
29
29
|
wx_each_selected_row_block = instance_method :each_selected_row_block
|
|
30
|
-
|
|
30
|
+
wx_redefine_method :each_selected_row_block do
|
|
31
31
|
if block_given?
|
|
32
32
|
wx_each_selected_row_block.bind(self).call
|
|
33
33
|
else
|
|
@@ -36,7 +36,7 @@ module Wx
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
wx_each_selected_col_block = instance_method :each_selected_col_block
|
|
39
|
-
|
|
39
|
+
wx_redefine_method :each_selected_col_block do
|
|
40
40
|
if block_given?
|
|
41
41
|
wx_each_selected_col_block.bind(self).call
|
|
42
42
|
else
|
data/lib/wx/grid/require.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Wx
|
|
|
14
14
|
|
|
15
15
|
# cache any explicitly assigned config for GC protection
|
|
16
16
|
wx_use_config = instance_method(:use_config)
|
|
17
|
-
|
|
17
|
+
wx_redefine_method :use_config do |cfg, *args|
|
|
18
18
|
@configuration = cfg
|
|
19
19
|
if get_help_window
|
|
20
20
|
# also set config var for any associated help window (as wxWidgets propagates it too)
|
data/lib/wx/html/htmlwindow.rb
CHANGED
data/lib/wx/html/require.rb
CHANGED
|
@@ -6,7 +6,7 @@ class Wx::HTML::SimpleHtmlListBox
|
|
|
6
6
|
|
|
7
7
|
# make sure to honor the inherited common overloads
|
|
8
8
|
wx_get_client_object = instance_method :get_client_object
|
|
9
|
-
|
|
9
|
+
wx_redefine_method :get_client_object do |*args|
|
|
10
10
|
if args.empty?
|
|
11
11
|
super()
|
|
12
12
|
else
|
|
@@ -14,7 +14,7 @@ class Wx::HTML::SimpleHtmlListBox
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
wx_set_client_object = instance_method :set_client_object
|
|
17
|
-
|
|
17
|
+
wx_redefine_method :set_client_object do |*args|
|
|
18
18
|
if args.size < 2
|
|
19
19
|
super(*args)
|
|
20
20
|
else
|
|
@@ -30,7 +30,7 @@ class Wx::HTML::SimpleHtmlListBox
|
|
|
30
30
|
|
|
31
31
|
# Overload to provide Enumerator without block
|
|
32
32
|
wx_each_string = instance_method :each_string
|
|
33
|
-
|
|
33
|
+
wx_redefine_method :each_string do |&block|
|
|
34
34
|
if block
|
|
35
35
|
wx_each_string.bind(self).call(&block)
|
|
36
36
|
else
|
data/lib/wx/keyword_ctors.rb
CHANGED
|
@@ -70,6 +70,13 @@ module Wx
|
|
|
70
70
|
# This module defines an inheritable class attribute like the ones defined
|
|
71
71
|
# by the Rails #class_attribute method.
|
|
72
72
|
module ParamSpec
|
|
73
|
+
|
|
74
|
+
if RUBY_VERSION < '2.7.0'
|
|
75
|
+
PARAM_SPEC_ARG = [:param_spec]
|
|
76
|
+
else
|
|
77
|
+
PARAM_SPEC_ARG = [:param_spec, false]
|
|
78
|
+
end
|
|
79
|
+
|
|
73
80
|
def self.included(mod)
|
|
74
81
|
mod.class_eval do
|
|
75
82
|
def self.param_spec
|
|
@@ -82,9 +89,9 @@ module Wx
|
|
|
82
89
|
|
|
83
90
|
def self.param_spec=(val)
|
|
84
91
|
singleton_class.class_eval do
|
|
85
|
-
if method_defined?(
|
|
92
|
+
if method_defined?(*PARAM_SPEC_ARG) || private_method_defined?(*PARAM_SPEC_ARG)
|
|
86
93
|
begin
|
|
87
|
-
remove_method(:param_spec)
|
|
94
|
+
remove_method(:param_spec)
|
|
88
95
|
rescue NameError;
|
|
89
96
|
end
|
|
90
97
|
end
|
|
@@ -93,9 +100,9 @@ module Wx
|
|
|
93
100
|
|
|
94
101
|
if singleton_class?
|
|
95
102
|
class_eval do
|
|
96
|
-
if method_defined?(
|
|
103
|
+
if method_defined?(*PARAM_SPEC_ARG) || private_method_defined?(*PARAM_SPEC_ARG)
|
|
97
104
|
begin
|
|
98
|
-
remove_method(:param_spec)
|
|
105
|
+
remove_method(:param_spec)
|
|
99
106
|
rescue NameError;
|
|
100
107
|
end
|
|
101
108
|
end
|
|
@@ -108,9 +115,9 @@ module Wx
|
|
|
108
115
|
val
|
|
109
116
|
end
|
|
110
117
|
|
|
111
|
-
if method_defined?(
|
|
118
|
+
if method_defined?(*PARAM_SPEC_ARG) || private_method_defined?(*PARAM_SPEC_ARG)
|
|
112
119
|
begin
|
|
113
|
-
remove_method(:param_spec)
|
|
120
|
+
remove_method(:param_spec)
|
|
114
121
|
rescue NameError;
|
|
115
122
|
end
|
|
116
123
|
end
|
|
@@ -191,7 +198,7 @@ module Wx
|
|
|
191
198
|
# The new definition of initialize; accepts a parent arg
|
|
192
199
|
# mixed_args, which may zero or more position args, optionally
|
|
193
200
|
# terminated with hash keyword args, and an optional block
|
|
194
|
-
|
|
201
|
+
wx_redefine_method :initialize do |parent = :default_ctor, *mixed_args, &block|
|
|
195
202
|
# allow zero-args ctor for use with XRC
|
|
196
203
|
if parent == :default_ctor
|
|
197
204
|
pre_wx_kwctor_init
|
data/lib/wx/keyword_defs.rb
CHANGED
|
@@ -61,13 +61,13 @@ end
|
|
|
61
61
|
# MISCELLANEOUS WINDOWS
|
|
62
62
|
|
|
63
63
|
# OpenGL Canvas
|
|
64
|
-
Wx::define_keyword_ctors('GLCanvas') do
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
end
|
|
64
|
+
# Wx::define_keyword_ctors('GLCanvas') do
|
|
65
|
+
# wx_ctor_params :id
|
|
66
|
+
# wx_ctor_params :pos, :size, :style => Wx::FULL_REPAINT_ON_RESIZE
|
|
67
|
+
# wx_ctor_params :name => 'GLCanvas'
|
|
68
|
+
# wx_ctor_params :attrib_list => [Wx::GL_RGBA, Wx::GL_DOUBLEBUFFER]
|
|
69
|
+
# wx_ctor_params :palette => Wx::NULL_PALETTE
|
|
70
|
+
# end
|
|
71
71
|
|
|
72
72
|
# A window whose colour changes according to current user settings
|
|
73
73
|
Wx::define_keyword_ctors(Wx::Panel) do
|
data/lib/wx/pg/pg_properties.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Wx::PG
|
|
|
10
10
|
|
|
11
11
|
# add some 'smart' conversions
|
|
12
12
|
wx_initialize = instance_method :initialize
|
|
13
|
-
|
|
13
|
+
wx_redefine_method :initialize do |label=Wx::PG_LABEL, name=Wx::PG_LABEL, value=Wx::PG::ColourPropertyValue.new|
|
|
14
14
|
value = case value
|
|
15
15
|
when Wx::Colour
|
|
16
16
|
Wx::PG::ColourPropertyValue.new(value)
|
data/lib/wx/pg/pg_property.rb
CHANGED
|
@@ -29,7 +29,7 @@ module Wx::PG
|
|
|
29
29
|
class PGProperty
|
|
30
30
|
|
|
31
31
|
wx_each_attribute = instance_method :each_attribute
|
|
32
|
-
|
|
32
|
+
wx_redefine_method :each_attribute do
|
|
33
33
|
if block_given?
|
|
34
34
|
wx_each_attribute.bind(self).call
|
|
35
35
|
else
|
|
@@ -52,7 +52,7 @@ module Wx::PG
|
|
|
52
52
|
class PGChoices
|
|
53
53
|
|
|
54
54
|
wx_each_label = instance_method :each_label
|
|
55
|
-
|
|
55
|
+
wx_redefine_method :each_label do
|
|
56
56
|
if block_given?
|
|
57
57
|
wx_each_label.bind(self).call
|
|
58
58
|
else
|
|
@@ -61,7 +61,7 @@ module Wx::PG
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
wx_each_entry = instance_method :each_entry
|
|
64
|
-
|
|
64
|
+
wx_redefine_method :each_entry do
|
|
65
65
|
if block_given?
|
|
66
66
|
wx_each_entry.bind(self).call
|
|
67
67
|
else
|
data/lib/wx/pg/property_grid.rb
CHANGED
|
@@ -29,7 +29,7 @@ module Wx::PG
|
|
|
29
29
|
private :property_editors
|
|
30
30
|
|
|
31
31
|
wx_do_register_editor_class = self.instance_method(:do_register_editor_class)
|
|
32
|
-
|
|
32
|
+
wx_redefine_method(:do_register_editor_class) do |editor_class, name|
|
|
33
33
|
editor = wx_do_register_editor_class.bind(self).call(editor_class, name)
|
|
34
34
|
property_editors[name] = editor # keep safe from GC and for lookup
|
|
35
35
|
end
|
|
@@ -44,7 +44,7 @@ module Wx::PG
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
wx_set_sorter = instance_method :set_sorter
|
|
47
|
-
|
|
47
|
+
wx_redefine_method :set_sorter do |meth, &block|
|
|
48
48
|
h_sorter = if block and not meth
|
|
49
49
|
block
|
|
50
50
|
elsif meth and not block
|
|
@@ -20,7 +20,7 @@ module Wx::PG
|
|
|
20
20
|
module PropertyGridInterface
|
|
21
21
|
|
|
22
22
|
wx_each_property = instance_method :each_property
|
|
23
|
-
|
|
23
|
+
wx_redefine_method :each_property do |flags = Wx::PG::PG_ITERATE_DEFAULT, start = nil, reverse: false, &block|
|
|
24
24
|
if block
|
|
25
25
|
wx_each_property.bind(self).call(flags.to_int, start, reverse, &block)
|
|
26
26
|
else
|
|
@@ -35,7 +35,7 @@ module Wx::PG
|
|
|
35
35
|
alias :properties_reversed :reverse_each_property
|
|
36
36
|
|
|
37
37
|
wx_each_property_attribute = instance_method :each_property_attribute
|
|
38
|
-
|
|
38
|
+
wx_redefine_method :each_property_attribute do |id, &block|
|
|
39
39
|
if block
|
|
40
40
|
wx_each_property_attribute.bind(self).call(id, &block)
|
|
41
41
|
else
|
data/lib/wx/pg/require.rb
CHANGED
data/lib/wx/prt/previewframe.rb
CHANGED
|
@@ -11,7 +11,7 @@ class Wx::PRT::PreviewFrame
|
|
|
11
11
|
# to assign it to an instance variable so it is marked correctly when
|
|
12
12
|
# the frame displaying it is marked.
|
|
13
13
|
wx_init = self.instance_method(:initialize)
|
|
14
|
-
|
|
14
|
+
wx_redefine_method(:initialize) do | *args |
|
|
15
15
|
wx_init.bind(self).call(*args)
|
|
16
16
|
@__preview = args[0]
|
|
17
17
|
end
|