wxruby3 0.9.0.pre.beta.10-x64-mingw-ucrt → 0.9.0.pre.beta.11-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/wxbase32u_gcc_custom.dll +0 -0
- data/ext/wxbase32u_net_gcc_custom.dll +0 -0
- data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
- data/lib/wx/core/data_object.rb +74 -6
- data/lib/wx/core/point.rb +21 -10
- data/lib/wx/core/real_point.rb +21 -10
- data/lib/wx/core/rect.rb +2 -2
- data/lib/wx/core/size.rb +12 -5
- data/lib/wx/doc/data_object.rb +104 -0
- data/lib/wx/doc/gdi_common.rb +33 -5
- data/lib/wx/doc/gen/core.rb +2 -2
- data/lib/wx/doc/gen/data_object.rb +0 -20
- data/lib/wx/doc/gen/data_object_simple_base.rb +10 -0
- data/lib/wx/doc/gen/scaled_dc.rb +10 -0
- data/lib/wx/doc/scaled_dc.rb +16 -0
- data/lib/wx/global_const.rb +4 -3
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby_aui.so +0 -0
- data/lib/wxruby_core.so +0 -0
- data/lib/wxruby_grid.so +0 -0
- data/lib/wxruby_html.so +0 -0
- data/lib/wxruby_pg.so +0 -0
- data/lib/wxruby_prt.so +0 -0
- data/lib/wxruby_rbn.so +0 -0
- data/lib/wxruby_rtc.so +0 -0
- data/lib/wxruby_stc.so +0 -0
- data/tests/lib/wxapp_runner.rb +64 -0
- data/tests/test_basic.rb +0 -5
- data/tests/test_clipboard.rb +114 -17
- data/tests/test_dialog.rb +2 -13
- data/tests/test_event_handling.rb +2 -13
- data/tests/test_events.rb +2 -6
- data/tests/test_geometry.rb +54 -17
- data/tests/test_intl.rb +2 -15
- data/tests/test_item_data.rb +2 -15
- data/tests/test_variant.rb +1 -15
- data/tests/testapp.rb +0 -5
- data/tests/testapp_noframe.rb +0 -5
- metadata +12 -3
@@ -0,0 +1,64 @@
|
|
1
|
+
|
2
|
+
require 'test/unit'
|
3
|
+
require 'test/unit/ui/console/testrunner'
|
4
|
+
require 'wx'
|
5
|
+
|
6
|
+
module Wx::SF
|
7
|
+
|
8
|
+
module Test
|
9
|
+
|
10
|
+
class App < Wx::App
|
11
|
+
def initialize(test_runner, start_mtd)
|
12
|
+
super()
|
13
|
+
@test_runner = test_runner
|
14
|
+
@start_mtd = start_mtd
|
15
|
+
end
|
16
|
+
|
17
|
+
def on_init
|
18
|
+
@result = @start_mtd.bind(@test_runner).call
|
19
|
+
false
|
20
|
+
end
|
21
|
+
|
22
|
+
attr_reader :result
|
23
|
+
end
|
24
|
+
|
25
|
+
if defined? ::IntelliJ
|
26
|
+
require 'test/unit/ui/teamcity/testrunner'
|
27
|
+
BaseRunner = ::Test::Unit::UI::TeamCity::TestRunner
|
28
|
+
else
|
29
|
+
BaseRunner = ::Test::Unit::UI::Console::TestRunner
|
30
|
+
end
|
31
|
+
|
32
|
+
class Runner < BaseRunner
|
33
|
+
|
34
|
+
org_start_mtd = instance_method :start
|
35
|
+
define_method :start do
|
36
|
+
(app = Wx::SF::Test::App.new(self, org_start_mtd)).run
|
37
|
+
app.result
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
module Test
|
47
|
+
module Unit
|
48
|
+
AutoRunner.register_runner(:wxapp) do |auto_runner|
|
49
|
+
Wx::SF::Test::Runner
|
50
|
+
end
|
51
|
+
AutoRunner.default_runner = :wxapp
|
52
|
+
if defined? ::IntelliJ
|
53
|
+
class AutoRunner
|
54
|
+
alias :wx_initialize :initialize
|
55
|
+
private :wx_initialize
|
56
|
+
|
57
|
+
def initialize(*args)
|
58
|
+
wx_initialize(*args)
|
59
|
+
@runner = AutoRunner.default_runner
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/tests/test_basic.rb
CHANGED
data/tests/test_clipboard.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'wx'
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
4
3
|
|
5
4
|
class TestTextData < Test::Unit::TestCase
|
6
5
|
# Using an in-built class
|
@@ -31,7 +30,7 @@ class TestTextData < Test::Unit::TestCase
|
|
31
30
|
Wx::Clipboard.open do | clip |
|
32
31
|
clip.fetch td_3
|
33
32
|
end
|
34
|
-
assert_equal("", td_3.
|
33
|
+
assert_equal("", td_3.get_data_here)
|
35
34
|
end
|
36
35
|
end
|
37
36
|
|
@@ -66,6 +65,37 @@ class TestBitmapData < Test::Unit::TestCase
|
|
66
65
|
end
|
67
66
|
|
68
67
|
class TestDataObjectComposite < Test::Unit::TestCase
|
68
|
+
MY_INT_ARRAY_FORMAT = Wx::DataFormat.new('application/int_array_format')
|
69
|
+
|
70
|
+
class MySimpleIntArrayObject < Wx::DataObjectSimpleBase
|
71
|
+
def initialize(arr = nil)
|
72
|
+
super(MY_INT_ARRAY_FORMAT)
|
73
|
+
self.array = arr
|
74
|
+
end
|
75
|
+
|
76
|
+
def array
|
77
|
+
@arr
|
78
|
+
end
|
79
|
+
|
80
|
+
def array=(arr)
|
81
|
+
@arr = (arr || []).collect { |e| e.to_i }
|
82
|
+
end
|
83
|
+
|
84
|
+
# The default will do in this case but otherwise something like this:
|
85
|
+
# def _get_data_size
|
86
|
+
# @arr ? @arr.pack('i*').bytesize : 0
|
87
|
+
# end
|
88
|
+
|
89
|
+
def _get_data
|
90
|
+
@arr ? @arr.pack('i*') : nil
|
91
|
+
end
|
92
|
+
|
93
|
+
def _set_data(data)
|
94
|
+
@arr = data ? data.unpack('i*') : []
|
95
|
+
true
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
69
99
|
def test_data_object_composite
|
70
100
|
d_obj = Wx::DataObjectComposite.new
|
71
101
|
d_txt = Wx::TextDataObject.new
|
@@ -80,6 +110,9 @@ class TestDataObjectComposite < Test::Unit::TestCase
|
|
80
110
|
assert_equal( 2, d_txt.get_format_count(Wx::DataObject::Direction::Get) )
|
81
111
|
assert_equal( 3, d_obj.get_format_count(Wx::DataObject::Direction::Get) )
|
82
112
|
end
|
113
|
+
d_txt = nil
|
114
|
+
|
115
|
+
GC.start
|
83
116
|
|
84
117
|
d_bmp = Wx::BitmapDataObject.new(bmp)
|
85
118
|
Wx::Clipboard.open do | clip |
|
@@ -87,6 +120,8 @@ class TestDataObjectComposite < Test::Unit::TestCase
|
|
87
120
|
clip.place d_bmp
|
88
121
|
end
|
89
122
|
|
123
|
+
GC.start
|
124
|
+
|
90
125
|
Wx::Clipboard.open do | clip |
|
91
126
|
assert !clip.supported?( Wx::DF_TEXT )
|
92
127
|
assert clip.supported?( Wx::DF_BITMAP )
|
@@ -94,6 +129,8 @@ class TestDataObjectComposite < Test::Unit::TestCase
|
|
94
129
|
clip.fetch d_obj
|
95
130
|
end
|
96
131
|
|
132
|
+
GC.start
|
133
|
+
|
97
134
|
if Wx::PLATFORM == 'WXMSW'
|
98
135
|
assert_equal d_obj.received_format.get_type, Wx::DF_DIB.get_type
|
99
136
|
d_bmp = d_obj.get_object(Wx::DF_DIB)
|
@@ -112,6 +149,8 @@ class TestDataObjectComposite < Test::Unit::TestCase
|
|
112
149
|
clip.place d_txt
|
113
150
|
end
|
114
151
|
|
152
|
+
GC.start
|
153
|
+
|
115
154
|
d_obj_2 = Wx::DataObjectComposite.new
|
116
155
|
d_txt = Wx::TextDataObject.new
|
117
156
|
d_obj_2.add d_txt
|
@@ -125,6 +164,8 @@ class TestDataObjectComposite < Test::Unit::TestCase
|
|
125
164
|
clip.fetch d_obj_2
|
126
165
|
end
|
127
166
|
|
167
|
+
GC.start
|
168
|
+
|
128
169
|
assert_equal d_obj_2.received_format.get_type, d_txt.get_preferred_format(Wx::DataObject::Direction::Set).get_type
|
129
170
|
if Wx::PLATFORM == 'WXMSW'
|
130
171
|
d_txt = d_obj_2.get_object(Wx::DF_UNICODETEXT)
|
@@ -132,11 +173,58 @@ class TestDataObjectComposite < Test::Unit::TestCase
|
|
132
173
|
d_txt = d_obj_2.get_object(Wx::DF_TEXT)
|
133
174
|
end
|
134
175
|
assert_equal d_txt.text, 'THE TEXT'
|
176
|
+
|
177
|
+
GC.start
|
178
|
+
|
179
|
+
d_obj_2 = Wx::DataObjectComposite.new
|
180
|
+
d_obj_2.add Wx::TextDataObject.new
|
181
|
+
d_obj_2.add MySimpleIntArrayObject.new([1,2,3,4,5])
|
182
|
+
if Wx::PLATFORM == 'WXMSW'
|
183
|
+
assert_equal( 2, d_obj_2.get_format_count(Wx::DataObject::Direction::Get) )
|
184
|
+
else
|
185
|
+
assert_equal( 3, d_obj_2.get_format_count(Wx::DataObject::Direction::Get) )
|
186
|
+
end
|
187
|
+
|
188
|
+
Wx::Clipboard.open do | clip |
|
189
|
+
clip.clear
|
190
|
+
clip.place d_obj_2
|
191
|
+
end
|
192
|
+
|
193
|
+
GC.start
|
194
|
+
|
195
|
+
d_iarr = MySimpleIntArrayObject.new
|
196
|
+
Wx::Clipboard.open do | clip |
|
197
|
+
assert clip.supported?(MY_INT_ARRAY_FORMAT)
|
198
|
+
clip.fetch d_iarr
|
199
|
+
end
|
200
|
+
|
201
|
+
assert_equal([1,2,3,4,5], d_iarr.array)
|
135
202
|
end
|
136
203
|
end
|
137
204
|
|
138
205
|
class TestDataObject < Test::Unit::TestCase
|
139
206
|
MY_CUSTOM_FORMAT = Wx::DataFormat.new('text/custom_format')
|
207
|
+
MY_CUSTOM_TEXT = Wx::DataFormat.new('text/custom_text')
|
208
|
+
|
209
|
+
class MySimpleDataObject < Wx::DataObjectSimpleBase
|
210
|
+
def initialize
|
211
|
+
super(MY_CUSTOM_TEXT)
|
212
|
+
@data = ''
|
213
|
+
end
|
214
|
+
|
215
|
+
def _get_data_size
|
216
|
+
@data.bytesize
|
217
|
+
end
|
218
|
+
|
219
|
+
def _get_data
|
220
|
+
@data
|
221
|
+
end
|
222
|
+
|
223
|
+
def _set_data(data)
|
224
|
+
@data = data ? data : ''
|
225
|
+
true
|
226
|
+
end
|
227
|
+
end
|
140
228
|
|
141
229
|
class MyBasicDataObject < Wx::DataObject
|
142
230
|
attr_reader :my_data
|
@@ -187,9 +275,9 @@ class TestDataObject < Test::Unit::TestCase
|
|
187
275
|
def get_data_size(format)
|
188
276
|
case format.get_type
|
189
277
|
when Wx::DataFormatId::DF_TEXT
|
190
|
-
get_as_text.to_s.
|
278
|
+
get_as_text.to_s.bytesize
|
191
279
|
when MY_CUSTOM_FORMAT.get_type
|
192
|
-
get_formatted.to_s.
|
280
|
+
get_formatted.to_s.bytesize
|
193
281
|
else
|
194
282
|
0
|
195
283
|
end
|
@@ -208,17 +296,35 @@ class TestDataObject < Test::Unit::TestCase
|
|
208
296
|
end
|
209
297
|
end
|
210
298
|
|
299
|
+
def test_simple_data_obj
|
300
|
+
d_obj = MySimpleDataObject.new
|
301
|
+
d_obj.set_data('Simple Data')
|
302
|
+
assert_equal( 1, d_obj.get_format_count )
|
303
|
+
assert_equal('Simple Data', d_obj.get_data_here )
|
304
|
+
|
305
|
+
Wx::Clipboard.open do | clip |
|
306
|
+
clip.place d_obj
|
307
|
+
end
|
308
|
+
|
309
|
+
d_obj2 = MySimpleDataObject.new
|
310
|
+
Wx::Clipboard.open do | clip |
|
311
|
+
assert clip.supported?( d_obj2.get_format )
|
312
|
+
clip.fetch d_obj2
|
313
|
+
end
|
314
|
+
assert_equal('Simple Data', d_obj2.get_data_here )
|
315
|
+
end
|
316
|
+
|
211
317
|
def test_data_obj
|
212
318
|
d_obj = MyBasicDataObject.new
|
213
319
|
d_obj.set_data(Wx::DF_TEXT, 'HELLO')
|
214
|
-
assert_equal( 2, d_obj.get_format_count(
|
320
|
+
assert_equal( 2, d_obj.get_format_count(Wx::DataObject::Direction::Get) )
|
215
321
|
assert_equal('HELLO', d_obj.get_data_here(Wx::DF_TEXT) )
|
216
322
|
assert_equal('<b>HELLO</b>', d_obj.get_data_here(MY_CUSTOM_FORMAT) )
|
217
323
|
|
218
324
|
Wx::Clipboard.open do | clip |
|
219
325
|
clip.place d_obj
|
220
326
|
end
|
221
|
-
|
327
|
+
|
222
328
|
d_obj_2 = MyBasicDataObject.new
|
223
329
|
Wx::Clipboard.open do | clip |
|
224
330
|
assert clip.supported?( Wx::DF_TEXT )
|
@@ -230,12 +336,3 @@ class TestDataObject < Test::Unit::TestCase
|
|
230
336
|
assert_equal('HELLO', d_obj_2.get_data_here(Wx::DF_TEXT) )
|
231
337
|
end
|
232
338
|
end
|
233
|
-
|
234
|
-
Wx::App.run do
|
235
|
-
# Must run whilst App is alive
|
236
|
-
Test::Unit::UI::Console::TestRunner.run(TestTextData)
|
237
|
-
Test::Unit::UI::Console::TestRunner.run(TestBitmapData)
|
238
|
-
Test::Unit::UI::Console::TestRunner.run(TestDataObjectComposite)
|
239
|
-
Test::Unit::UI::Console::TestRunner.run(TestDataObject)
|
240
|
-
false
|
241
|
-
end
|
data/tests/test_dialog.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'wx'
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
4
3
|
|
5
4
|
class DialogTests < Test::Unit::TestCase
|
6
5
|
|
@@ -16,13 +15,3 @@ class DialogTests < Test::Unit::TestCase
|
|
16
15
|
assert_kind_of(Wx::Window, dlg)
|
17
16
|
end
|
18
17
|
end
|
19
|
-
|
20
|
-
class TestApp < Wx::App
|
21
|
-
def on_init
|
22
|
-
Test::Unit::UI::Console::TestRunner.run(DialogTests)
|
23
|
-
false
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
app = TestApp.new
|
28
|
-
app.run
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'wx'
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
4
3
|
|
5
4
|
class EventHandlingTests < Test::Unit::TestCase
|
6
5
|
|
@@ -91,13 +90,3 @@ class EventHandlingTests < Test::Unit::TestCase
|
|
91
90
|
assert_boolean(!win.child.test_cmd_event)
|
92
91
|
end
|
93
92
|
end
|
94
|
-
|
95
|
-
class TestApp < Wx::App
|
96
|
-
def on_init
|
97
|
-
Test::Unit::UI::Console::TestRunner.run(EventHandlingTests)
|
98
|
-
false
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
app = TestApp.new
|
103
|
-
app.run
|
data/tests/test_events.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'wx'
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
4
3
|
|
5
4
|
class EventTests < Test::Unit::TestCase
|
6
5
|
|
@@ -40,6 +39,3 @@ class TestApp < Wx::App
|
|
40
39
|
false
|
41
40
|
end
|
42
41
|
end
|
43
|
-
|
44
|
-
app = TestApp.new
|
45
|
-
app.run
|
data/tests/test_geometry.rb
CHANGED
@@ -12,9 +12,9 @@ class GeometryTests < Test::Unit::TestCase
|
|
12
12
|
assert_equal(10, w)
|
13
13
|
assert_equal(20, h)
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
assert_equal(sz, Wx::Size.new(w,h))
|
16
|
+
assert_equal(sz, [w,h])
|
17
|
+
assert_not_equal(sz,'10, 20' )
|
18
18
|
|
19
19
|
assert(sz.eql? Wx::Size.new(w,h))
|
20
20
|
refute(sz.eql?([w,h]))
|
@@ -30,6 +30,20 @@ class GeometryTests < Test::Unit::TestCase
|
|
30
30
|
assert(Wx::Size.new(12,22).eql?(sz + 2))
|
31
31
|
assert(Wx::Size.new(12,23).eql?(sz + Wx::Size.new(2,3)))
|
32
32
|
assert(Wx::Size.new(12,23).eql?(sz + [2,3]))
|
33
|
+
|
34
|
+
small_sz = Wx::Size.new(10, 10)
|
35
|
+
medium_sz = Wx::Size.new(20, 20)
|
36
|
+
large_sz = Wx::Size.new(30, 30)
|
37
|
+
a = [large_sz, small_sz, medium_sz]
|
38
|
+
a.sort!
|
39
|
+
assert_equal(a[0], small_sz)
|
40
|
+
assert_equal(a[1], medium_sz)
|
41
|
+
assert_equal(a[2], large_sz)
|
42
|
+
|
43
|
+
h = {large_sz => 'Large', small_sz => 'Small', medium_sz => 'Medium'}
|
44
|
+
assert_equal(h[Wx::Size.new(10, 10)], 'Small')
|
45
|
+
assert_equal(h[Wx::Size.new(20, 20)], 'Medium')
|
46
|
+
assert_equal(h[Wx::Size.new(30, 30)], 'Large')
|
33
47
|
end
|
34
48
|
|
35
49
|
def test_point
|
@@ -41,9 +55,9 @@ class GeometryTests < Test::Unit::TestCase
|
|
41
55
|
assert_equal(10, x)
|
42
56
|
assert_equal(20, y)
|
43
57
|
|
44
|
-
|
45
|
-
|
46
|
-
|
58
|
+
assert_equal(pt, Wx::Point.new(x,y))
|
59
|
+
assert_equal(pt, [x,y])
|
60
|
+
assert_not_equal(pt, '10, 20')
|
47
61
|
|
48
62
|
assert(pt.eql? Wx::Point.new(x,y))
|
49
63
|
refute(pt.eql?([x,y]))
|
@@ -61,6 +75,20 @@ class GeometryTests < Test::Unit::TestCase
|
|
61
75
|
assert(Wx::Point.new(12,23).eql?(pt + Wx::Point.new(2,3)))
|
62
76
|
assert(Wx::Point.new(12,23).eql?(pt + Wx::Size.new(2,3)))
|
63
77
|
assert(Wx::Point.new(12,23).eql?(pt + [2,3]))
|
78
|
+
|
79
|
+
nearest_pt = Wx::Point.new(10, 10)
|
80
|
+
mid_pt = Wx::Point.new(10, 20)
|
81
|
+
furthest_pt = Wx::Point.new(10, 30)
|
82
|
+
a = [furthest_pt, nearest_pt, mid_pt]
|
83
|
+
a.sort!
|
84
|
+
assert_equal(a[0], nearest_pt)
|
85
|
+
assert_equal(a[1], mid_pt)
|
86
|
+
assert_equal(a[2], furthest_pt)
|
87
|
+
|
88
|
+
h = {furthest_pt => 'Far', nearest_pt => 'Near', mid_pt => 'Mid'}
|
89
|
+
assert_equal(h[Wx::Point.new(10, 10)], 'Near')
|
90
|
+
assert_equal(h[Wx::Point.new(10, 20)], 'Mid')
|
91
|
+
assert_equal(h[Wx::Point.new(10, 30)], 'Far')
|
64
92
|
end
|
65
93
|
|
66
94
|
def test_real_point
|
@@ -72,9 +100,9 @@ class GeometryTests < Test::Unit::TestCase
|
|
72
100
|
assert_equal(10.0, x)
|
73
101
|
assert_equal(20.0, y)
|
74
102
|
|
75
|
-
|
76
|
-
|
77
|
-
|
103
|
+
assert_equal(pt, Wx::RealPoint.new(x,y))
|
104
|
+
assert_equal(pt, [x,y])
|
105
|
+
assert_not_equal(pt, '10.0, 20.0')
|
78
106
|
|
79
107
|
assert(pt.eql? Wx::RealPoint.new(x,y))
|
80
108
|
refute(pt.eql?([x,y]))
|
@@ -94,6 +122,20 @@ class GeometryTests < Test::Unit::TestCase
|
|
94
122
|
assert(Wx::RealPoint.new(12.0,23.0).eql?(pt + Wx::Point.new(2,3)))
|
95
123
|
assert(Wx::RealPoint.new(12.0,23.0).eql?(pt + Wx::Size.new(2,3)))
|
96
124
|
assert(Wx::RealPoint.new(12.0,23.0).eql?(pt + [2,3]))
|
125
|
+
|
126
|
+
nearest_pt = Wx::RealPoint.new(10, 10)
|
127
|
+
mid_pt = Wx::RealPoint.new(10, 20)
|
128
|
+
furthest_pt = Wx::RealPoint.new(10, 30)
|
129
|
+
a = [furthest_pt, nearest_pt, mid_pt]
|
130
|
+
a.sort!
|
131
|
+
assert_equal(a[0], nearest_pt)
|
132
|
+
assert_equal(a[1], mid_pt)
|
133
|
+
assert_equal(a[2], furthest_pt)
|
134
|
+
|
135
|
+
h = {furthest_pt => 'Far', nearest_pt => 'Near', mid_pt => 'Mid'}
|
136
|
+
assert_equal(h[Wx::RealPoint.new(10, 10)], 'Near')
|
137
|
+
assert_equal(h[Wx::RealPoint.new(10, 20)], 'Mid')
|
138
|
+
assert_equal(h[Wx::RealPoint.new(10, 30)], 'Far')
|
97
139
|
end
|
98
140
|
|
99
141
|
def test_rect
|
@@ -113,9 +155,9 @@ class GeometryTests < Test::Unit::TestCase
|
|
113
155
|
assert_equal(100, w)
|
114
156
|
assert_equal(300, h)
|
115
157
|
|
116
|
-
|
117
|
-
|
118
|
-
|
158
|
+
assert_equal(rect, Wx::Rect.new(x,y,w,h))
|
159
|
+
assert_equal(rect, [x,y,w,h])
|
160
|
+
assert_not_equal(rect, '10,0,20,0')
|
119
161
|
|
120
162
|
assert(rect.eql? Wx::Rect.new(x,y,w,h))
|
121
163
|
refute(rect.eql?([x,y,w,h]))
|
@@ -134,8 +176,3 @@ class GeometryTests < Test::Unit::TestCase
|
|
134
176
|
end
|
135
177
|
|
136
178
|
end
|
137
|
-
|
138
|
-
if $0 == __FILE__
|
139
|
-
require 'test/unit/ui/console/testrunner'
|
140
|
-
Test::Unit::UI::Console::TestRunner.run(GeometryTests)
|
141
|
-
end
|
data/tests/test_intl.rb
CHANGED
@@ -1,14 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'wx'
|
4
|
-
|
5
|
-
class TestApp < Wx::App
|
6
|
-
attr_accessor :test_class
|
7
|
-
def on_init
|
8
|
-
Test::Unit::UI::Console::TestRunner.run(self.test_class)
|
9
|
-
false # exit after tests
|
10
|
-
end
|
11
|
-
end
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
12
3
|
|
13
4
|
class TestInternationalisation < Test::Unit::TestCase
|
14
5
|
def test_encodings
|
@@ -101,7 +92,3 @@ class TestInternationalisation < Test::Unit::TestCase
|
|
101
92
|
locale = Wx::Locale.new(Wx::LANGUAGE_DEFAULT)
|
102
93
|
end
|
103
94
|
end
|
104
|
-
|
105
|
-
app = TestApp.new
|
106
|
-
app.test_class = TestInternationalisation
|
107
|
-
app.run
|
data/tests/test_item_data.rb
CHANGED
@@ -1,14 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'wx'
|
4
|
-
|
5
|
-
class TestApp < Wx::App
|
6
|
-
attr_accessor :test_class
|
7
|
-
def on_init
|
8
|
-
Test::Unit::UI::Console::TestRunner.run(self.test_class)
|
9
|
-
false
|
10
|
-
end
|
11
|
-
end
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
12
3
|
|
13
4
|
class CtrlContainerFrame < Wx::Frame
|
14
5
|
attr_accessor :control
|
@@ -181,7 +172,3 @@ class TestItemData < Test::Unit::TestCase
|
|
181
172
|
f.close(true)
|
182
173
|
end
|
183
174
|
end
|
184
|
-
|
185
|
-
app = TestApp.new
|
186
|
-
app.test_class = TestItemData
|
187
|
-
app.run
|
data/tests/test_variant.rb
CHANGED
@@ -1,15 +1,5 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'test/unit/ui/console/testrunner'
|
3
|
-
require 'wx'
|
4
1
|
|
5
|
-
|
6
|
-
attr_accessor :test_class
|
7
|
-
def on_init
|
8
|
-
Test::Unit::UI::Console::TestRunner.run(self.test_class)
|
9
|
-
GC.start
|
10
|
-
false # exit after tests
|
11
|
-
end
|
12
|
-
end
|
2
|
+
require_relative './lib/wxapp_runner'
|
13
3
|
|
14
4
|
class TestVariant < Test::Unit::TestCase
|
15
5
|
|
@@ -145,7 +135,3 @@ class TestVariant < Test::Unit::TestCase
|
|
145
135
|
end
|
146
136
|
|
147
137
|
end
|
148
|
-
|
149
|
-
app = TestApp.new
|
150
|
-
app.test_class = TestVariant
|
151
|
-
app.run
|
data/tests/testapp.rb
CHANGED
data/tests/testapp_noframe.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wxruby3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0.pre.beta.
|
4
|
+
version: 0.9.0.pre.beta.11
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Martin Corino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- lib/wx/doc/aui/auinotebook.rb
|
161
161
|
- lib/wx/doc/colour_dialog.rb
|
162
162
|
- lib/wx/doc/core.rb
|
163
|
+
- lib/wx/doc/data_object.rb
|
163
164
|
- lib/wx/doc/dc.rb
|
164
165
|
- lib/wx/doc/enum.rb
|
165
166
|
- lib/wx/doc/evthandler.rb
|
@@ -237,6 +238,7 @@ files:
|
|
237
238
|
- lib/wx/doc/gen/cursor.rb
|
238
239
|
- lib/wx/doc/gen/data_format.rb
|
239
240
|
- lib/wx/doc/gen/data_object.rb
|
241
|
+
- lib/wx/doc/gen/data_object_simple_base.rb
|
240
242
|
- lib/wx/doc/gen/date_event.rb
|
241
243
|
- lib/wx/doc/gen/date_picker_ctrl.rb
|
242
244
|
- lib/wx/doc/gen/dc.rb
|
@@ -413,6 +415,7 @@ files:
|
|
413
415
|
- lib/wx/doc/gen/sash_event.rb
|
414
416
|
- lib/wx/doc/gen/sash_layout_window.rb
|
415
417
|
- lib/wx/doc/gen/sash_window.rb
|
418
|
+
- lib/wx/doc/gen/scaled_dc.rb
|
416
419
|
- lib/wx/doc/gen/screen_dc.rb
|
417
420
|
- lib/wx/doc/gen/scrolled_canvas.rb
|
418
421
|
- lib/wx/doc/gen/scrolled_control.rb
|
@@ -493,6 +496,7 @@ files:
|
|
493
496
|
- lib/wx/doc/rbn/ribbon_gallery.rb
|
494
497
|
- lib/wx/doc/rbn/ribbon_tool_bar.rb
|
495
498
|
- lib/wx/doc/rtc/richtext_printing.rb
|
499
|
+
- lib/wx/doc/scaled_dc.rb
|
496
500
|
- lib/wx/doc/screen_dc.rb
|
497
501
|
- lib/wx/doc/stock_objects.rb
|
498
502
|
- lib/wx/doc/stream.rb
|
@@ -888,6 +892,7 @@ files:
|
|
888
892
|
- samples/xrc/samples.xrc
|
889
893
|
- samples/xrc/tn_xrc_sample.png
|
890
894
|
- samples/xrc/xrc_sample.rb
|
895
|
+
- tests/lib/wxapp_runner.rb
|
891
896
|
- tests/test_basic.rb
|
892
897
|
- tests/test_clipboard.rb
|
893
898
|
- tests/test_dialog.rb
|
@@ -902,7 +907,11 @@ files:
|
|
902
907
|
homepage: https://github.com/mcorino/wxRuby3
|
903
908
|
licenses:
|
904
909
|
- MIT
|
905
|
-
metadata:
|
910
|
+
metadata:
|
911
|
+
bug_tracker_uri: https://github.com/mcorino/wxruby3/issues
|
912
|
+
source_code_uri: https://github.com/mcorino/wxruby3
|
913
|
+
documentation_uri: https://mcorino.github.io/wxRuby3
|
914
|
+
homepage_uri: https://github.com/mcorino/wxruby3
|
906
915
|
post_install_message:
|
907
916
|
rdoc_options:
|
908
917
|
- "--exclude=\\.dll"
|