wxruby3 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/wxruby3/swig/custom/director.swg +6 -20
- data/lib/wx/core/animation.rb +35 -14
- data/lib/wx/core/choicedlg.rb +7 -10
- data/lib/wx/core/colour.rb +10 -0
- data/lib/wx/core/dialog.rb +2 -2
- data/lib/wx/core/event.rb +7 -0
- data/lib/wx/core/file_dialog.rb +25 -0
- data/lib/wx/core/gdi_object.rb +24 -0
- data/lib/wx/core/object.rb +26 -11
- data/lib/wx/core/variant.rb +108 -51
- data/lib/wx/doc/colour.rb +12 -0
- data/lib/wx/doc/evthandler.rb +6 -0
- data/lib/wx/doc/functions.rb +35 -3
- data/lib/wx/doc/gdi_object.rb +22 -0
- data/lib/wx/doc/object.rb +24 -0
- data/lib/wx/doc/variant.rb +8 -0
- data/lib/wx/helpers.rb +2 -3
- data/lib/wx/keyword_defs.rb +7 -0
- data/lib/wx/version.rb +1 -1
- data/rakelib/lib/config.rb +1 -1
- data/rakelib/lib/core/include/funcall.inc +9 -24
- data/rakelib/lib/core/include/swigdirector.inc +29 -11
- data/rakelib/lib/director/animation_ctrl.rb +6 -0
- data/rakelib/lib/director/defs.rb +3 -0
- data/rakelib/lib/director/dialog.rb +15 -7
- data/rakelib/lib/director/file_dialog_customize_hook.rb +77 -1
- data/rakelib/lib/director/functions.rb +0 -12
- data/rakelib/lib/director/validator.rb +7 -42
- data/rakelib/lib/generate/doc/credential_entry_dialog.yaml +10 -0
- data/rakelib/lib/generate/doc/generic_about_dialog.yaml +46 -0
- data/rakelib/lib/specs/interfaces.rb +2 -0
- data/rakelib/lib/swig_runner.rb +6 -3
- data/rakelib/lib/util/string.rb +7 -6
- data/samples/animate/anitest.rb +13 -9
- data/tests/lib/leaked_overload_exception_test.rb +25 -0
- data/tests/lib/leaked_process_event_exception_test.rb +33 -0
- data/tests/lib/leaked_queued_event_exception_test.rb +34 -0
- data/tests/lib/overload_type_exception_test.rb +25 -0
- data/tests/test_exceptions.rb +24 -24
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed10da8feaf6d3e77a775f3386dd9970314810239e7e4ce1c2c447658f6f4106
|
4
|
+
data.tar.gz: 125e2ddedb7148987456508b887dacae1262753a408cd39503faff80fe6435cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe29edc61e3c139efec7d90d5f80b17b3671c141f3f6f3421905320de87b2900e90785bd83550e6b9d502bb184bef4a58c5061c7271629dc5f83d4c2f55ac94
|
7
|
+
data.tar.gz: 2b420414ee1c4b8eefa3fa797c5452e8490048876bfe2172fa14f8ffdd4937c907a4714c6af1650768e91cab08f4746881b5c19989bf66778f4ed4a1d2506020
|
@@ -147,20 +147,14 @@ namespace Swig {
|
|
147
147
|
|
148
148
|
DirectorTypeMismatchException(VALUE self, const char *method, VALUE error, const char *msg="");
|
149
149
|
|
150
|
-
static
|
151
|
-
{
|
152
|
-
throw DirectorTypeMismatchException(error, msg);
|
153
|
-
}
|
150
|
+
static void raise(VALUE error, const char *msg);
|
154
151
|
|
155
|
-
static
|
156
|
-
{
|
157
|
-
throw DirectorTypeMismatchException(msg);
|
158
|
-
}
|
152
|
+
static void raise(const char *msg);
|
159
153
|
|
160
|
-
static
|
161
|
-
|
162
|
-
|
163
|
-
|
154
|
+
static void raise(VALUE self, const char* method, VALUE error, const char *msg);
|
155
|
+
|
156
|
+
private:
|
157
|
+
static void print(const DirectorTypeMismatchException& ex);
|
164
158
|
};
|
165
159
|
|
166
160
|
/* Any Ruby exception that occurs during a director method call */
|
@@ -195,14 +189,6 @@ namespace Swig {
|
|
195
189
|
}
|
196
190
|
};
|
197
191
|
|
198
|
-
/* wxRuby customization */
|
199
|
-
class WXRUBY_EXPORT DirectorRubyException : public DirectorException
|
200
|
-
{
|
201
|
-
public:
|
202
|
-
DirectorRubyException(VALUE error, VALUE rcvr, ID fn_id);
|
203
|
-
|
204
|
-
};
|
205
|
-
|
206
192
|
/* Simple thread abstraction for pthreads on win32 */
|
207
193
|
#ifdef __THREAD__
|
208
194
|
# define __PTHREAD__
|
data/lib/wx/core/animation.rb
CHANGED
@@ -6,21 +6,42 @@
|
|
6
6
|
# Copyright 2004-2007, wxRuby development team
|
7
7
|
# released under the MIT-like wxRuby2 license
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
module Wx
|
10
|
+
|
11
|
+
class Animation
|
12
|
+
# Redefine the initialize method so it raises an exception if a
|
13
|
+
# non-existent file is given to the constructor; otherwise, wx Widgets
|
14
|
+
# just carries on with an empty bitmap, which may cause faults later
|
15
|
+
wx_init = self.instance_method(:initialize)
|
16
|
+
define_method(:initialize) do | *args |
|
17
|
+
if args[0].kind_of? String
|
18
|
+
if not File.exist?( File.expand_path(args[0]) )
|
19
|
+
Kernel.raise( ArgumentError,
|
20
|
+
"Animation file does not exist: #{args[0]}" )
|
21
|
+
end
|
22
|
+
res = wx_init.bind(self).call()
|
23
|
+
res.load_file(args[0], args[1] || Wx::ANIMATION_TYPE_ANY)
|
24
|
+
else
|
25
|
+
wx_init.bind(self).call(*args)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if Wx::WXWIDGETS_VERSION >= '3.3.0'
|
31
|
+
|
32
|
+
class AnimationCtrl
|
33
|
+
|
34
|
+
# Redefine this method to accept either a single animation or an animation bundle
|
35
|
+
wx_set_animation = self.instance_method(:set_animation)
|
36
|
+
define_method(:set_animation) do | arg |
|
37
|
+
if Wx::Animation === arg
|
38
|
+
arg = Wx::AnimationBundle.new(arg)
|
39
|
+
end
|
40
|
+
wx_set_animation.bind(self).call(arg)
|
19
41
|
end
|
20
|
-
|
21
|
-
res.load_file(args[0], args[1] || Wx::ANIMATION_TYPE_ANY)
|
22
|
-
else
|
23
|
-
wx_init.bind(self).call(*args)
|
42
|
+
|
24
43
|
end
|
44
|
+
|
25
45
|
end
|
46
|
+
|
26
47
|
end
|
data/lib/wx/core/choicedlg.rb
CHANGED
@@ -14,9 +14,8 @@ module Wx
|
|
14
14
|
choices,
|
15
15
|
parent = nil,
|
16
16
|
initial_selection: 0,
|
17
|
-
|
18
|
-
|
19
|
-
dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, nil, Wx::CHOICEDLG_STYLE, [x, y])
|
17
|
+
pos: Wx::DEFAULT_POSITION)
|
18
|
+
dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, pos)
|
20
19
|
|
21
20
|
dialog.selection = initial_selection
|
22
21
|
return dialog.show_modal == Wx::ID_OK ? dialog.get_string_selection : ''
|
@@ -28,9 +27,8 @@ module Wx
|
|
28
27
|
choices,
|
29
28
|
parent = nil,
|
30
29
|
initial_selection: 0,
|
31
|
-
|
32
|
-
|
33
|
-
dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, nil, Wx::CHOICEDLG_STYLE, [x, y])
|
30
|
+
pos: Wx::DEFAULT_POSITION)
|
31
|
+
dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, pos)
|
34
32
|
|
35
33
|
dialog.selection = initial_selection
|
36
34
|
return dialog.show_modal == Wx::ID_OK ? dialog.get_selection : -1
|
@@ -43,16 +41,15 @@ module Wx
|
|
43
41
|
choices,
|
44
42
|
parent = nil,
|
45
43
|
initial_selections: [],
|
46
|
-
|
47
|
-
|
48
|
-
dialog = Wx::MultiChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, [x, y])
|
44
|
+
pos: Wx::DEFAULT_POSITION)
|
45
|
+
dialog = Wx::MultiChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, pos)
|
49
46
|
|
50
47
|
# call this even if selections array is empty and this then (correctly)
|
51
48
|
# deselects the first item which is selected by default
|
52
49
|
dialog.selections = initial_selections
|
53
50
|
|
54
51
|
if dialog.show_modal != Wx::ID_OK
|
55
|
-
return
|
52
|
+
return nil
|
56
53
|
end
|
57
54
|
|
58
55
|
dialog.get_selections
|
data/lib/wx/core/colour.rb
CHANGED
data/lib/wx/core/dialog.rb
CHANGED
@@ -25,8 +25,8 @@ class Wx::Dialog
|
|
25
25
|
scope = klass.name.split('::')
|
26
26
|
functor_nm = scope.pop
|
27
27
|
code = <<~__CODE
|
28
|
-
def #{functor_nm}(*args, &block)
|
29
|
-
dlg = #{klass.name}.new(*args)
|
28
|
+
def #{functor_nm}(*args, **kwargs, &block)
|
29
|
+
dlg = #{klass.name}.new(*args, **kwargs)
|
30
30
|
begin
|
31
31
|
if block_given?
|
32
32
|
return block.call(dlg)
|
data/lib/wx/core/event.rb
CHANGED
data/lib/wx/core/file_dialog.rb
CHANGED
@@ -20,4 +20,29 @@ module Wx
|
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
+
class FileDialogCustomizeHook
|
24
|
+
|
25
|
+
# prevent construction of abstract base
|
26
|
+
if RUBY_VERSION < '2.7.0'
|
27
|
+
def self.new(*)
|
28
|
+
raise NotImplementedError, 'Wx::FileDialogCustomizeHook is an abstract class.' if self == Wx::FileDialogCustomizeHook
|
29
|
+
super
|
30
|
+
end
|
31
|
+
else
|
32
|
+
def self.new(*, **)
|
33
|
+
raise NotImplementedError, 'Wx::FileDialogCustomizeHook is an abstract class.' if self == Wx::FileDialogCustomizeHook
|
34
|
+
super
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# provide default no-ops
|
39
|
+
|
40
|
+
def add_custom_controls(customizer) end
|
41
|
+
|
42
|
+
def update_custom_controls; end
|
43
|
+
|
44
|
+
def transfer_data_from_custom_controls; end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
23
48
|
end
|
@@ -0,0 +1,24 @@
|
|
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
|
+
module Wx
|
10
|
+
|
11
|
+
class GDIObject < Object
|
12
|
+
|
13
|
+
# GDIObjects have safe, working (and relatively cheap) copy ctors.
|
14
|
+
def dup
|
15
|
+
self.class.new(self)
|
16
|
+
end
|
17
|
+
|
18
|
+
def clone
|
19
|
+
dup
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/wx/core/object.rb
CHANGED
@@ -8,16 +8,31 @@
|
|
8
8
|
|
9
9
|
# The root class for most (not all) WxRuby classes
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
module Wx
|
12
|
+
|
13
|
+
class Object
|
14
|
+
# Massage the output of inspect to show the public module name (Wx),
|
15
|
+
# instead of the internal name (Wxruby2)
|
16
|
+
# def to_s
|
17
|
+
# super.sub('ruby2', '')
|
18
|
+
# end
|
19
|
+
|
20
|
+
# Returns a string containing the C++ pointer address of this
|
21
|
+
# object. Only useful for debugging.
|
22
|
+
def ptr_addr
|
23
|
+
Wx::ptr_addr(self)
|
24
|
+
end
|
25
|
+
|
26
|
+
# By default Wx:::Object derived class instances cannot be #dup-licated.
|
27
|
+
def dup
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
# By default Wx::Object derived class instances cannot be cloned but instead return self.
|
32
|
+
def clone
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
22
36
|
end
|
37
|
+
|
23
38
|
end
|
data/lib/wx/core/variant.rb
CHANGED
@@ -8,62 +8,119 @@
|
|
8
8
|
|
9
9
|
require 'date'
|
10
10
|
|
11
|
-
|
12
|
-
include ::Enumerable
|
11
|
+
module Wx
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
class Variant
|
14
|
+
include ::Enumerable
|
15
|
+
|
16
|
+
# add a proper enumerator method
|
17
|
+
def each
|
18
|
+
if block_given?
|
19
|
+
get_count.times { |i| yield self[i] }
|
20
|
+
else
|
21
|
+
::Enumerator.new { |y| get_count.times { |i| y << self[i] } }
|
22
|
+
end
|
20
23
|
end
|
21
|
-
end
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
25
|
+
# make assign return self and add it's handy alias
|
26
|
+
wx_assign = instance_method :assign
|
27
|
+
define_method :assign do |v|
|
28
|
+
wx_assign.bind(self).call(v)
|
29
|
+
self
|
30
|
+
end
|
31
|
+
alias :<< :assign
|
32
|
+
|
33
|
+
# extend to_s to arraylist and list (easier in pure Ruby)
|
34
|
+
|
35
|
+
wx_to_s = instance_method :to_s
|
36
|
+
define_method :to_s do
|
37
|
+
unless null?
|
38
|
+
case type
|
39
|
+
when 'list'
|
40
|
+
return "[#{each.collect { |v| v.string? ? %Q{"#{v.to_s}"} : v.to_s }.join(', ')}]"
|
41
|
+
when 'arrstring'
|
42
|
+
return array_string.to_s
|
43
|
+
when 'wxFont'
|
44
|
+
return font.to_s
|
45
|
+
when 'wxColour'
|
46
|
+
return colour.to_s
|
47
|
+
when 'wxColourPropertyValue'
|
48
|
+
return colour_property_value.to_s
|
49
|
+
end
|
47
50
|
end
|
51
|
+
wx_to_s.bind(self).call
|
52
|
+
end
|
53
|
+
|
54
|
+
# extend with more Ruby-like type checking
|
55
|
+
|
56
|
+
def string?
|
57
|
+
!null? && is_type('string');
|
58
|
+
end
|
59
|
+
|
60
|
+
def bool?
|
61
|
+
!null? && is_type('bool');
|
62
|
+
end
|
63
|
+
|
64
|
+
def long?
|
65
|
+
!null? && is_type('long');
|
66
|
+
end
|
67
|
+
|
68
|
+
def long_long?
|
69
|
+
!null? && is_type('longlong');
|
70
|
+
end
|
71
|
+
|
72
|
+
def u_long_long?
|
73
|
+
!null? && is_type('ulonglong');
|
74
|
+
end
|
75
|
+
|
76
|
+
def integer?
|
77
|
+
!null? && (long? || long_long? || u_long_long?);
|
78
|
+
end
|
79
|
+
|
80
|
+
def date_time?
|
81
|
+
!null? && is_type('datetime');
|
48
82
|
end
|
49
|
-
|
83
|
+
|
84
|
+
def double?
|
85
|
+
!null? && is_type('double');
|
86
|
+
end
|
87
|
+
|
88
|
+
def numeric?
|
89
|
+
!null? && (integer? || double?);
|
90
|
+
end
|
91
|
+
|
92
|
+
def list?
|
93
|
+
!null? && is_type('list');
|
94
|
+
end
|
95
|
+
|
96
|
+
def array_string?
|
97
|
+
!null? && is_type('arrstring');
|
98
|
+
end
|
99
|
+
|
100
|
+
def font?
|
101
|
+
!null? && is_type('wxFont');
|
102
|
+
end
|
103
|
+
|
104
|
+
def colour?
|
105
|
+
!null? && is_type('wxColour');
|
106
|
+
end
|
107
|
+
|
108
|
+
def colour_property_value?
|
109
|
+
!null? && is_type('wxColourPropertyValue');
|
110
|
+
end
|
111
|
+
|
112
|
+
def object?(klass = Object)
|
113
|
+
!null? && is_type('WXRB_VALUE') && klass === object;
|
114
|
+
end
|
115
|
+
|
116
|
+
def dup
|
117
|
+
self.class.new(self)
|
118
|
+
end
|
119
|
+
|
120
|
+
def clone
|
121
|
+
dup
|
122
|
+
end
|
123
|
+
|
50
124
|
end
|
51
125
|
|
52
|
-
# extend with more Ruby-like type checking
|
53
|
-
|
54
|
-
def string?; !null? && is_type('string'); end
|
55
|
-
def bool?; !null? && is_type('bool'); end
|
56
|
-
def long?; !null? && is_type('long'); end
|
57
|
-
def long_long?; !null? && is_type('longlong'); end
|
58
|
-
def u_long_long?; !null? && is_type('ulonglong'); end
|
59
|
-
def integer?; !null? && (long? || long_long? || u_long_long?); end
|
60
|
-
def date_time?; !null? && is_type('datetime'); end
|
61
|
-
def double?; !null? && is_type('double'); end
|
62
|
-
def numeric?; !null? && (integer? || double?); end
|
63
|
-
def list?; !null? && is_type('list'); end
|
64
|
-
def array_string?; !null? && is_type('arrstring'); end
|
65
|
-
def font?; !null? && is_type('wxFont'); end
|
66
|
-
def colour?; !null? && is_type('wxColour'); end
|
67
|
-
def colour_property_value?; !null? && is_type('wxColourPropertyValue'); end
|
68
|
-
def object?(klass=Object) !null? && is_type('WXRB_VALUE') && klass === object; end
|
69
126
|
end
|
data/lib/wx/doc/colour.rb
CHANGED
@@ -9,4 +9,16 @@ module Wx
|
|
9
9
|
|
10
10
|
TRANSPARENT_COLOUR = Wx::Colour.new(0, 0, 0, Wx::ALPHA_TRANSPARENT)
|
11
11
|
|
12
|
+
class Colour < Object
|
13
|
+
|
14
|
+
# Returns a copy-constructed Colour object.
|
15
|
+
# @return [Wx::Colour] the duplicated Colour object
|
16
|
+
def dup; end
|
17
|
+
|
18
|
+
# Calls #dup.
|
19
|
+
# @return [Wx::Colour]
|
20
|
+
def clone; end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
12
24
|
end
|
data/lib/wx/doc/evthandler.rb
CHANGED
@@ -142,6 +142,12 @@ module Wx
|
|
142
142
|
# @yield [*args] optional arguments
|
143
143
|
def call_after(meth = nil, *args, &block) end
|
144
144
|
|
145
|
+
# Process a {Wx::EVT_HOTKEY} event.
|
146
|
+
# @param [Integer] id hotkey id
|
147
|
+
# @param [String,Symbol,Method,Proc] meth (name of) method or handler proc
|
148
|
+
# @yieldparam [Wx::KeyEvent] event the event to handle
|
149
|
+
def evt_hotkey(id, meth = nil, &block) end
|
150
|
+
|
145
151
|
end
|
146
152
|
|
147
153
|
end
|
data/lib/wx/doc/functions.rb
CHANGED
@@ -158,9 +158,41 @@ module Wx
|
|
158
158
|
# @!group Dialog shortcuts
|
159
159
|
|
160
160
|
# @return [Array<Integer>] Selected choices
|
161
|
-
|
162
|
-
|
163
|
-
|
161
|
+
|
162
|
+
# Get the user selection as a string.
|
163
|
+
# @param [String] message
|
164
|
+
# @param [String] caption
|
165
|
+
# @param [Array<String>] choices choice strings
|
166
|
+
# @param [Wx::Window,nil] parent
|
167
|
+
# @param [Integer] initial_selection initial choice index
|
168
|
+
# @param [Wx::Point,Array(Integer,Integer)] pos
|
169
|
+
# @return [String] selected choice or '' if cancelled
|
170
|
+
def self.get_single_choice(message, caption, choices, parent = nil,
|
171
|
+
initial_selection: 0,
|
172
|
+
pos: Wx::DEFAULT_POSITION) end
|
173
|
+
|
174
|
+
# Get the user selection as an index.
|
175
|
+
# @param [String] message
|
176
|
+
# @param [String] caption
|
177
|
+
# @param [Array<String>] choices choice strings
|
178
|
+
# @param [Wx::Window,nil] parent
|
179
|
+
# @param [Integer] initial_selection
|
180
|
+
# @param [Wx::Point,Array(Integer,Integer)] pos
|
181
|
+
# @return [Integer] selected choice index or -1 if cancelled
|
182
|
+
def self.get_single_choice_index(message, caption, choices, parent = nil,
|
183
|
+
initial_selection: 0,
|
184
|
+
pos: Wx::DEFAULT_POSITION) end
|
185
|
+
|
186
|
+
# @param [String] message
|
187
|
+
# @param [String] caption
|
188
|
+
# @param [Array<String>] choices choice strings
|
189
|
+
# @param [Wx::Window,nil] parent
|
190
|
+
# @param [Array<Integer>] initial_selections array of initial choice indexes
|
191
|
+
# @param [Wx::Point,Array(Integer,Integer)] pos
|
192
|
+
# @return [Array<Integer>,nil] selected choice indexes (can be empty array if none selected) or nil if cancelled
|
193
|
+
def self.get_selected_choices(message, caption, choices, parent = nil,
|
194
|
+
initial_selections: [],
|
195
|
+
pos: Wx::DEFAULT_POSITION) end
|
164
196
|
|
165
197
|
# Pops up a file selector box.
|
166
198
|
#
|
@@ -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 GDIObject < Object
|
11
|
+
|
12
|
+
# Returns a copy-constructed GDI object.
|
13
|
+
# @return [Wx::GDIObject] the duplicated GDI object
|
14
|
+
def dup; end
|
15
|
+
|
16
|
+
# Calls #dup.
|
17
|
+
# @return [Wx::GDIObject]
|
18
|
+
def clone; end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
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 Object
|
11
|
+
|
12
|
+
# By default Wx:::Object derived classes cannot be #dup-licated.
|
13
|
+
# Some derived classes (like GDIObject-s) may provide functional overloads.
|
14
|
+
# @return [nil]
|
15
|
+
def dup; end
|
16
|
+
|
17
|
+
# By default Wx::Object derived class instances cannot be cloned but instead return self.
|
18
|
+
# Derived classes (like the Event classes) may provide functional overloads.
|
19
|
+
# @return [self]
|
20
|
+
def clone; end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/wx/doc/variant.rb
CHANGED
@@ -168,6 +168,14 @@ module Wx
|
|
168
168
|
# @return [true,false]
|
169
169
|
def object?(klass=Object) end
|
170
170
|
|
171
|
+
# Copy constructs a Variant instance.
|
172
|
+
# @return [Wx::Variant]
|
173
|
+
def dup; end
|
174
|
+
|
175
|
+
# Calls #dup.
|
176
|
+
# @return [Wx::Variant]
|
177
|
+
def clone; end
|
178
|
+
|
171
179
|
end
|
172
180
|
|
173
181
|
end
|
data/lib/wx/helpers.rb
CHANGED
@@ -27,9 +27,8 @@ module Wx
|
|
27
27
|
out_args = []
|
28
28
|
param_spec.each_with_index do | param, i |
|
29
29
|
# has supplied list arg or the keyword arg?
|
30
|
-
|
31
|
-
|
32
|
-
end
|
30
|
+
arg = mixed_args[i]
|
31
|
+
arg = kwa.delete(param.name) if arg.nil? && kwa.key?(param.name)
|
33
32
|
if Proc === param.default_or_proc
|
34
33
|
arg = param.default_or_proc.call(arg) # provides default or converts arg
|
35
34
|
elsif arg.nil?
|
data/lib/wx/keyword_defs.rb
CHANGED
@@ -267,6 +267,13 @@ Wx::define_keyword_ctors(Wx::PropertySheetDialog) do
|
|
267
267
|
wx_ctor_params :name => Wx::DIALOG_NAME_STR
|
268
268
|
end
|
269
269
|
|
270
|
+
# Credentials entry dialog
|
271
|
+
Wx::define_keyword_ctors(Wx::CredentialEntryDialog) do
|
272
|
+
wx_ctor_params :message => ''
|
273
|
+
wx_ctor_params :title => 'Enter credentials'
|
274
|
+
wx_ctor_params :cred => ->(cred) { cred || Wx::WebCredentials.new }
|
275
|
+
end
|
276
|
+
|
270
277
|
### CONTROLS
|
271
278
|
|
272
279
|
# Push button control, displaying text
|
data/lib/wx/version.rb
CHANGED
data/rakelib/lib/config.rb
CHANGED
@@ -360,7 +360,7 @@ module WXRuby3
|
|
360
360
|
test = File.join(Config.instance.test_dir, test)
|
361
361
|
test = Dir.glob(test+'.rb').shift || test unless File.exist?(test)
|
362
362
|
end
|
363
|
-
Rake.sh(Config.instance.exec_env,
|
363
|
+
Rake.sh(Config.instance.exec_env.merge({'RUBYLIB'=>rb_lib_path}), FileUtils::RUBY, test) { |ok,status| errors += 1 unless ok }
|
364
364
|
end
|
365
365
|
end
|
366
366
|
fail "ERRORS: ##{errors} test scripts failed." if errors>0
|