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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/ext/wxruby3/swig/custom/director.swg +6 -20
  3. data/lib/wx/core/animation.rb +35 -14
  4. data/lib/wx/core/choicedlg.rb +7 -10
  5. data/lib/wx/core/colour.rb +10 -0
  6. data/lib/wx/core/dialog.rb +2 -2
  7. data/lib/wx/core/event.rb +7 -0
  8. data/lib/wx/core/file_dialog.rb +25 -0
  9. data/lib/wx/core/gdi_object.rb +24 -0
  10. data/lib/wx/core/object.rb +26 -11
  11. data/lib/wx/core/variant.rb +108 -51
  12. data/lib/wx/doc/colour.rb +12 -0
  13. data/lib/wx/doc/evthandler.rb +6 -0
  14. data/lib/wx/doc/functions.rb +35 -3
  15. data/lib/wx/doc/gdi_object.rb +22 -0
  16. data/lib/wx/doc/object.rb +24 -0
  17. data/lib/wx/doc/variant.rb +8 -0
  18. data/lib/wx/helpers.rb +2 -3
  19. data/lib/wx/keyword_defs.rb +7 -0
  20. data/lib/wx/version.rb +1 -1
  21. data/rakelib/lib/config.rb +1 -1
  22. data/rakelib/lib/core/include/funcall.inc +9 -24
  23. data/rakelib/lib/core/include/swigdirector.inc +29 -11
  24. data/rakelib/lib/director/animation_ctrl.rb +6 -0
  25. data/rakelib/lib/director/defs.rb +3 -0
  26. data/rakelib/lib/director/dialog.rb +15 -7
  27. data/rakelib/lib/director/file_dialog_customize_hook.rb +77 -1
  28. data/rakelib/lib/director/functions.rb +0 -12
  29. data/rakelib/lib/director/validator.rb +7 -42
  30. data/rakelib/lib/generate/doc/credential_entry_dialog.yaml +10 -0
  31. data/rakelib/lib/generate/doc/generic_about_dialog.yaml +46 -0
  32. data/rakelib/lib/specs/interfaces.rb +2 -0
  33. data/rakelib/lib/swig_runner.rb +6 -3
  34. data/rakelib/lib/util/string.rb +7 -6
  35. data/samples/animate/anitest.rb +13 -9
  36. data/tests/lib/leaked_overload_exception_test.rb +25 -0
  37. data/tests/lib/leaked_process_event_exception_test.rb +33 -0
  38. data/tests/lib/leaked_queued_event_exception_test.rb +34 -0
  39. data/tests/lib/overload_type_exception_test.rb +25 -0
  40. data/tests/test_exceptions.rb +24 -24
  41. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c44502717c4bc43863f96c826432224a7cc81063d3768dcffa8a92c7bbead181
4
- data.tar.gz: c002fc5f501cba71fa127585102916daca951424e986a265e740e7ca9cbc6e9e
3
+ metadata.gz: ed10da8feaf6d3e77a775f3386dd9970314810239e7e4ce1c2c447658f6f4106
4
+ data.tar.gz: 125e2ddedb7148987456508b887dacae1262753a408cd39503faff80fe6435cc
5
5
  SHA512:
6
- metadata.gz: bdd8149612a7ef5637362c5e27a821afe3cd6f1f03c92c00529ab3df12e427a73af97aa1ffa6f89281e7ff259861aed925f3b737ff49bc7564f92b6369b97550
7
- data.tar.gz: dcce12022c263d4b5955b2417ab415460f38e5d0418e0c53d64d677c9c9352de5e1ff3b53a7318066b8e8c0b4ff47bf6fefb27ae194e0955801aac0edf99cd59
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 inline void raise(VALUE error, const char *msg)
151
- {
152
- throw DirectorTypeMismatchException(error, msg);
153
- }
150
+ static void raise(VALUE error, const char *msg);
154
151
 
155
- static inline void raise(const char *msg)
156
- {
157
- throw DirectorTypeMismatchException(msg);
158
- }
152
+ static void raise(const char *msg);
159
153
 
160
- static inline void raise(VALUE self, const char* method, VALUE error, const char *msg)
161
- {
162
- throw DirectorTypeMismatchException(self, method, error, msg);
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__
@@ -6,21 +6,42 @@
6
6
  # Copyright 2004-2007, wxRuby development team
7
7
  # released under the MIT-like wxRuby2 license
8
8
 
9
- class Wx::Animation
10
- # Redefine the initialize method so it raises an exception if a
11
- # non-existent file is given to the constructor; otherwise, wx Widgets
12
- # just carries on with an empty bitmap, which may cause faults later
13
- wx_init = self.instance_method(:initialize)
14
- define_method(:initialize) do | *args |
15
- if args[0].kind_of? String
16
- if not File.exist?( File.expand_path(args[0]) )
17
- Kernel.raise( ArgumentError,
18
- "Animation file does not exist: #{args[0]}" )
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
- res = wx_init.bind(self).call()
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
@@ -14,9 +14,8 @@ module Wx
14
14
  choices,
15
15
  parent = nil,
16
16
  initial_selection: 0,
17
- x: Wx::DEFAULT_COORD,
18
- y: Wx::DEFAULT_COORD)
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
- x: Wx::DEFAULT_COORD,
32
- y: Wx::DEFAULT_COORD)
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
- x: Wx::DEFAULT_COORD,
47
- y: Wx::DEFAULT_COORD)
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
@@ -45,6 +45,16 @@ module Wx
45
45
  def to_s
46
46
  "#<Wx::Colour: (#{red}, #{green}, #{blue} *#{alpha})>"
47
47
  end
48
+
49
+ # Copy ctor available.
50
+ def dup
51
+ self.class.new(self)
52
+ end
53
+
54
+ def clone
55
+ dup
56
+ end
57
+
48
58
  end
49
59
 
50
60
  end
@@ -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
@@ -58,4 +58,11 @@ module Wx
58
58
  Wx::EVT_NC_PAINT,
59
59
  Wx::NcPaintEvent
60
60
  ]
61
+ if Wx.const_defined?(:EVT_HOTKEY)
62
+ EvtHandler.register_event_type EvtHandler::EventType[
63
+ 'evt_hotkey', 1,
64
+ Wx::EVT_HOTKEY,
65
+ Wx::KeyEvent
66
+ ]
67
+ end
61
68
  end
@@ -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
@@ -8,16 +8,31 @@
8
8
 
9
9
  # The root class for most (not all) WxRuby classes
10
10
 
11
- class Wx::Object
12
- # Massage the output of inspect to show the public module name (Wx),
13
- # instead of the internal name (Wxruby2)
14
- # def to_s
15
- # super.sub('ruby2', '')
16
- # end
17
-
18
- # Returns a string containing the C++ pointer address of this
19
- # object. Only useful for debugging.
20
- def ptr_addr
21
- Wx::ptr_addr(self)
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
@@ -8,62 +8,119 @@
8
8
 
9
9
  require 'date'
10
10
 
11
- class Wx::Variant
12
- include ::Enumerable
11
+ module Wx
13
12
 
14
- # add a proper enumerator method
15
- def each
16
- if block_given?
17
- get_count.times { |i| yield self[i] }
18
- else
19
- ::Enumerator.new { |y| get_count.times { |i| y << self[i] } }
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
- # make assign return self and add it's handy alias
24
- wx_assign = instance_method :assign
25
- define_method :assign do |v|
26
- wx_assign.bind(self).call(v)
27
- self
28
- end
29
- alias :<< :assign
30
-
31
- # extend to_s to arraylist and list (easier in pure Ruby)
32
-
33
- wx_to_s = instance_method :to_s
34
- define_method :to_s do
35
- unless null?
36
- case type
37
- when 'list'
38
- return "[#{each.collect { |v| v.string? ? %Q{"#{v.to_s}"} : v.to_s }.join(', ')}]"
39
- when 'arrstring'
40
- return array_string.to_s
41
- when 'wxFont'
42
- return font.to_s
43
- when 'wxColour'
44
- return colour.to_s
45
- when 'wxColourPropertyValue'
46
- return colour_property_value.to_s
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
- wx_to_s.bind(self).call
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
@@ -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
@@ -158,9 +158,41 @@ module Wx
158
158
  # @!group Dialog shortcuts
159
159
 
160
160
  # @return [Array<Integer>] Selected choices
161
- def self.get_selected_choices(message, caption, choices,
162
- parent = nil, x = Wx::DEFAULT_COORD, y = Wx::DEFAULT_COORD,
163
- centre = true, width = Wx::CHOICE_WIDTH, height = Wx::CHOICE_HEIGHT) end
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
@@ -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
- if (arg = mixed_args[i]) || kwa.key?(param.name)
31
- arg = kwa.delete(param.name) unless arg
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?
@@ -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
@@ -3,5 +3,5 @@
3
3
  # This software is released under the MIT license.
4
4
 
5
5
  module Wx
6
- WXRUBY_VERSION = '1.2.1'
6
+ WXRUBY_VERSION = '1.3.0'
7
7
  end
@@ -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, *make_ruby_cmd(test)) { |ok,status| errors += 1 unless ok }
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