wxruby3 1.3.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/lib/wx/core/config.rb
CHANGED
@@ -42,7 +42,7 @@ module Wx
|
|
42
42
|
|
43
43
|
# add protection against exceptions raised in blocks
|
44
44
|
wx_for_path = instance_method :for_path
|
45
|
-
|
45
|
+
wx_redefine_method :for_path do |path, &block|
|
46
46
|
if block
|
47
47
|
ex = nil
|
48
48
|
rc = wx_for_path.bind(self).call(path) do |cfg, key|
|
@@ -64,7 +64,7 @@ module Wx
|
|
64
64
|
# add Enumerator support
|
65
65
|
|
66
66
|
wx_each_entry = instance_method :each_entry
|
67
|
-
|
67
|
+
wx_redefine_method :each_entry do |&block|
|
68
68
|
if block_given?
|
69
69
|
wx_each_entry.bind(self).call { |k| block.call(k, read(k)) }
|
70
70
|
else
|
@@ -73,7 +73,7 @@ module Wx
|
|
73
73
|
end
|
74
74
|
|
75
75
|
wx_each_group = instance_method :each_group
|
76
|
-
|
76
|
+
wx_redefine_method :each_group do |&block|
|
77
77
|
if block_given?
|
78
78
|
wx_each_group.bind(self).call { |k| block.call(k, Group.new(self, self.path.dup.push(k))) }
|
79
79
|
else
|
@@ -83,20 +83,20 @@ module Wx
|
|
83
83
|
|
84
84
|
# make this return a path array
|
85
85
|
wx_path = instance_method :path
|
86
|
-
|
86
|
+
wx_redefine_method :path do
|
87
87
|
wx_path.bind(self).call.split(ConfigBase::SEPARATOR)
|
88
88
|
end
|
89
89
|
|
90
90
|
# protect against attempts to rename complete paths
|
91
91
|
wx_rename = instance_method :rename
|
92
|
-
|
92
|
+
wx_redefine_method :rename do |old_key, new_key|
|
93
93
|
raise ArgumentError, 'No paths allowed' if old_key.index(ConfigBase::SEPARATOR) || new_key.index(ConfigBase::SEPARATOR)
|
94
94
|
wx_rename.bind(self).call(old_key, new_key)
|
95
95
|
end
|
96
96
|
|
97
97
|
# fix recursive number_of_xxx methods as wxRegConfig does not support this currently
|
98
98
|
wx_number_of_entries = instance_method :number_of_entries
|
99
|
-
|
99
|
+
wx_redefine_method :number_of_entries do |recurse=false|
|
100
100
|
if recurse
|
101
101
|
each_group.inject(wx_number_of_entries.bind(self).call) { |c, (_, g)| c + g.number_of_entries(true) }
|
102
102
|
else
|
@@ -105,7 +105,7 @@ module Wx
|
|
105
105
|
end
|
106
106
|
|
107
107
|
wx_number_of_groups = instance_method :number_of_groups
|
108
|
-
|
108
|
+
wx_redefine_method :number_of_groups do |recurse=false|
|
109
109
|
if recurse
|
110
110
|
each_group.inject(wx_number_of_groups.bind(self).call) { |c, (_, g)| c + g.number_of_groups(true) }
|
111
111
|
else
|
@@ -15,7 +15,7 @@ module Wx
|
|
15
15
|
|
16
16
|
# make sure to honor the inherited common overloads
|
17
17
|
wx_get_client_object = instance_method :get_client_object
|
18
|
-
|
18
|
+
wx_redefine_method :get_client_object do |*args|
|
19
19
|
if args.empty?
|
20
20
|
super()
|
21
21
|
else
|
@@ -23,7 +23,7 @@ module Wx
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
wx_set_client_object = instance_method :set_client_object
|
26
|
-
|
26
|
+
wx_redefine_method :set_client_object do |*args|
|
27
27
|
if args.size < 2
|
28
28
|
super(*args)
|
29
29
|
else
|
@@ -45,7 +45,7 @@ module Wx
|
|
45
45
|
|
46
46
|
# Overload to provide Enumerator without block
|
47
47
|
wx_each_string = instance_method :each_string
|
48
|
-
|
48
|
+
wx_redefine_method :each_string do |&block|
|
49
49
|
if block
|
50
50
|
wx_each_string.bind(self).call(&block)
|
51
51
|
else
|
data/lib/wx/core/data_object.rb
CHANGED
@@ -25,17 +25,17 @@ module Wx
|
|
25
25
|
# using pure Ruby
|
26
26
|
|
27
27
|
wx_get_data_size = instance_method :get_data_size
|
28
|
-
|
28
|
+
wx_redefine_method :get_data_size do |format = nil|
|
29
29
|
wx_get_data_size.bind(self).call(format || self.get_format)
|
30
30
|
end
|
31
31
|
|
32
32
|
wx_get_data_here = instance_method :get_data_here
|
33
|
-
|
33
|
+
wx_redefine_method :get_data_here do |format = nil|
|
34
34
|
wx_get_data_here.bind(self).call(format || self.get_format)
|
35
35
|
end
|
36
36
|
|
37
37
|
wx_set_data = instance_method :set_data
|
38
|
-
|
38
|
+
wx_redefine_method :set_data do |*args|
|
39
39
|
if args.size>1
|
40
40
|
format, buf = args
|
41
41
|
else
|
@@ -66,7 +66,7 @@ module Wx
|
|
66
66
|
self._set_data(buf)
|
67
67
|
end
|
68
68
|
|
69
|
-
|
69
|
+
wx_redefine_method :_get_data_size do
|
70
70
|
(_get_data || '').bytesize
|
71
71
|
end
|
72
72
|
protected :_get_data_size
|
data/lib/wx/core/dataformat.rb
CHANGED
@@ -11,10 +11,16 @@
|
|
11
11
|
|
12
12
|
class Wx::DataFormat
|
13
13
|
def ==(other)
|
14
|
-
if
|
15
|
-
self.get_type == other
|
14
|
+
if other.is_a?(Wx::DataFormatId)
|
15
|
+
self.get_type == other
|
16
|
+
elsif other.is_a?(self.class)
|
17
|
+
if self.get_type > Wx::DataFormatId::DF_INVALID
|
18
|
+
self.get_type == other.get_type
|
19
|
+
else
|
20
|
+
self.id == other.id
|
21
|
+
end
|
16
22
|
else
|
17
|
-
|
23
|
+
false
|
18
24
|
end
|
19
25
|
end
|
20
26
|
end
|
data/lib/wx/core/defs.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
2
|
+
#
|
3
|
+
# This software is released under the MIT license.
|
4
|
+
#
|
5
|
+
# Some parts are
|
6
|
+
# Copyright 2004-2007, wxRuby development team
|
7
|
+
# released under the MIT-like wxRuby2 license
|
8
|
+
|
9
|
+
require_relative './enum'
|
10
|
+
|
11
|
+
module Wx
|
12
|
+
|
13
|
+
class Orientation < Wx::Enum
|
14
|
+
|
15
|
+
set_non_distinct(%i[ORIENTATION_MASK])
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
class Direction < Wx::Enum
|
20
|
+
|
21
|
+
set_non_distinct(%i[TOP BOTTOM NORTH SOUTH WEST EAST ALL DIRECTION_MASK])
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
class Alignment < Wx::Enum
|
26
|
+
|
27
|
+
set_non_distinct(%i[ALIGN_INVALID ALIGN_CENTRE_HORIZONTAL ALIGN_LEFT ALIGN_TOP ALIGN_CENTRE_VERTICAL ALIGN_CENTER ALIGN_MASK])
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
class SizerFlagBits < Wx::Enum
|
32
|
+
|
33
|
+
set_non_distinct(%i[SIZER_FLAG_BITS_MASK])
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
class Stretch < Wx::Enum
|
38
|
+
|
39
|
+
set_non_distinct(%i[GROW STRETCH_MASK])
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
class Border < Wx::Enum
|
44
|
+
|
45
|
+
set_non_distinct(%i[BORDER_THEME BORDER_MASK])
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
data/lib/wx/core/dialog.rb
CHANGED
@@ -13,9 +13,10 @@ class Wx::Dialog
|
|
13
13
|
class << self
|
14
14
|
|
15
15
|
wx_set_layout_adapter = instance_method :set_layout_adapter
|
16
|
-
|
16
|
+
wx_redefine_method :set_layout_adapter do |adapter|
|
17
17
|
prev_adapter = wx_set_layout_adapter.bind(self).call(adapter)
|
18
18
|
@adapter = adapter # cache here to prevent premature GC collection
|
19
|
+
prev_adapter
|
19
20
|
end
|
20
21
|
|
21
22
|
end
|
@@ -50,7 +51,7 @@ class Wx::Dialog
|
|
50
51
|
def self.inherited(sub)
|
51
52
|
sub.include Wx::Dialog::Functor
|
52
53
|
end
|
53
|
-
end
|
54
|
+
end unless klass.singleton_class.method_defined?(:inherited)
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
data/lib/wx/core/enum.rb
CHANGED
@@ -10,10 +10,23 @@ class Wx::Enum
|
|
10
10
|
|
11
11
|
class << self
|
12
12
|
|
13
|
-
def
|
13
|
+
def set_non_distinct(lst)
|
14
|
+
raise TypeError, 'Expected Array of Symbols' unless lst.is_a?(Array) && lst.all? { |e| e.is_a?(Symbol) }
|
15
|
+
@non_distinct = lst
|
16
|
+
end
|
17
|
+
alias :non_distinct= :set_non_distinct
|
18
|
+
|
19
|
+
def non_distinct
|
20
|
+
@non_distinct || []
|
21
|
+
end
|
22
|
+
|
23
|
+
def enumerators(excludes = nil)
|
24
|
+
excludes ||= self.non_distinct
|
14
25
|
self.constants(false).inject({}) do |tbl, cn|
|
15
|
-
|
16
|
-
|
26
|
+
unless excludes&.include?(cn)
|
27
|
+
cv = self.const_get(cn)
|
28
|
+
tbl[cv.to_i] = cn if self === cv
|
29
|
+
end
|
17
30
|
tbl
|
18
31
|
end
|
19
32
|
end
|
data/lib/wx/core/event.rb
CHANGED
@@ -16,7 +16,7 @@ module Wx
|
|
16
16
|
# overload the #initialize method to add a check on a
|
17
17
|
# correct match between EventType and event class
|
18
18
|
wx_init = self.instance_method(:initialize)
|
19
|
-
|
19
|
+
wx_redefine_method :initialize do |evt_type = Wx::EVT_NULL, *rest|
|
20
20
|
evt_klass = Wx::EvtHandler.event_class_for_type(evt_type)
|
21
21
|
if evt_klass >= self.class
|
22
22
|
wx_init.bind(self).call(evt_type, *rest)
|
@@ -34,7 +34,7 @@ module Wx
|
|
34
34
|
# overload the #initialize method to add a check on a
|
35
35
|
# correct match between EventType and event class
|
36
36
|
wx_init = self.instance_method(:initialize)
|
37
|
-
|
37
|
+
wx_redefine_method :initialize do |evt_type = Wx::EVT_NULL, *rest|
|
38
38
|
evt_klass = Wx::EvtHandler.event_class_for_type(evt_type)
|
39
39
|
if evt_klass >= self.class
|
40
40
|
wx_init.bind(self).call(evt_type, *rest)
|
@@ -58,7 +58,7 @@ module Wx
|
|
58
58
|
Wx::EVT_NC_PAINT,
|
59
59
|
Wx::NcPaintEvent
|
60
60
|
]
|
61
|
-
if Wx.const_defined?(:EVT_HOTKEY)
|
61
|
+
if Wx.has_feature?(:USE_HOTKEY) && Wx.const_defined?(:EVT_HOTKEY)
|
62
62
|
EvtHandler.register_event_type EvtHandler::EventType[
|
63
63
|
'evt_hotkey', 1,
|
64
64
|
Wx::EVT_HOTKEY,
|