wxruby3 0.9.0.pre.beta.11 → 0.9.0.pre.beta.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +85 -0
- data/README.md +2 -0
- data/assets/logo.png +0 -0
- data/assets/logo.svg +170 -0
- data/assets/logo.xcf +0 -0
- data/ext/wxruby3/swig/wx.i +1 -1
- data/lib/wx/accessors.rb +8 -2
- data/lib/wx/core/array_ext.rb +26 -0
- data/lib/wx/core/art_locator.rb +92 -0
- data/lib/wx/core/artprovider.rb +1 -1
- data/lib/wx/core/bitmap.rb +90 -53
- data/lib/wx/core/cursor.rb +12 -0
- data/lib/wx/core/dataformat.rb +3 -1
- data/lib/wx/core/dc.rb +76 -52
- data/lib/wx/core/enum.rb +4 -0
- data/lib/wx/core/event.rb +38 -5
- data/lib/wx/core/evthandler.rb +64 -23
- data/lib/wx/core/icon.rb +50 -35
- data/lib/wx/core/id_helper.rb +32 -0
- data/lib/wx/core/image.rb +63 -53
- data/lib/wx/core/point.rb +14 -0
- data/lib/wx/core/real_point.rb +15 -1
- data/lib/wx/core/rect.rb +42 -7
- data/lib/wx/core/region_iterator.rb +37 -0
- data/lib/wx/core/size.rb +20 -0
- data/lib/wx/core/window.rb +8 -31
- data/lib/wx/doc/array_ext.rb +27 -0
- data/lib/wx/doc/art_locator.rb +57 -0
- data/lib/wx/doc/bitmap.rb +27 -0
- data/lib/wx/doc/clipboard.rb +12 -0
- data/lib/wx/doc/const.rb +77 -0
- data/lib/wx/doc/cursor.rb +16 -0
- data/lib/wx/doc/data_object.rb +1 -2
- data/lib/wx/doc/dc.rb +63 -46
- data/lib/wx/doc/event.rb +24 -0
- data/lib/wx/doc/events.rb +14 -0
- data/lib/wx/doc/evthandler.rb +24 -3
- data/lib/wx/doc/extra/00_starting.md +1 -1
- data/lib/wx/doc/extra/06_geometry.md +10 -4
- data/lib/wx/doc/extra/10_art.md +105 -0
- data/lib/wx/doc/gc_dc.rb +21 -0
- data/lib/wx/doc/gdi_common.rb +122 -1
- data/lib/wx/doc/graphics_context.rb +42 -0
- data/lib/wx/doc/icon.rb +18 -0
- data/lib/wx/doc/id_helper.rb +25 -0
- data/lib/wx/doc/image.rb +33 -0
- data/lib/wx/doc/region_iterator.rb +31 -0
- data/lib/wx/doc/scaled_dc.rb +1 -0
- data/lib/wx/doc/window.rb +18 -0
- data/lib/wx/global_const.rb +24 -18
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/cmd/sampler.rb +3 -21
- data/rakelib/lib/config.rb +4 -4
- data/rakelib/lib/core/package.rb +3 -3
- data/rakelib/lib/director/art_provider.rb +2 -2
- data/rakelib/lib/director/busy_info.rb +9 -7
- data/rakelib/lib/director/clipboard.rb +1 -1
- data/rakelib/lib/director/colour_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/data_object.rb +72 -4
- data/rakelib/lib/director/derived_dc.rb +100 -6
- data/rakelib/lib/director/dir_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/event.rb +73 -8
- data/rakelib/lib/director/events.rb +19 -1
- data/rakelib/lib/director/file_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/font_picker_ctrl.rb +1 -0
- data/rakelib/lib/director/gdicommon.rb +1 -3
- data/rakelib/lib/director/graphics_context.rb +89 -0
- data/rakelib/lib/director/help_controller.rb +2 -2
- data/rakelib/lib/director/html_data_object.rb +37 -0
- data/rakelib/lib/director/image.rb +55 -0
- data/rakelib/lib/director/region_iterator.rb +48 -0
- data/rakelib/lib/director/richtext_buffer.rb +1 -1
- data/rakelib/lib/director/richtext_buffer_data_object.rb +45 -0
- data/rakelib/lib/director/scroll_bar.rb +39 -0
- data/rakelib/lib/director/slider.rb +39 -0
- data/rakelib/lib/director/window.rb +36 -5
- data/rakelib/lib/director/window_disabler.rb +0 -7
- data/rakelib/lib/extractor/class.rb +1 -1
- data/rakelib/lib/extractor/function.rb +1 -1
- data/rakelib/lib/generate/doc.rb +27 -7
- data/rakelib/lib/specs/interfaces.rb +6 -1
- data/rakelib/lib/typemap/common.rb +1 -1
- data/rakelib/lib/util/string.rb +29 -8
- data/samples/art/wxruby-128x128.png +0 -0
- data/samples/art/wxruby-256x256.png +0 -0
- data/samples/art/wxruby-64x64.png +0 -0
- data/samples/art/wxruby.ico +0 -0
- data/samples/art/wxruby.png +0 -0
- data/samples/drawing/graphics_drawing.rb +1 -2
- data/samples/propgrid/propgrid.rb +65 -65
- data/samples/sample.xpm +246 -470
- data/samples/treectrl/treectrl.rb +1 -1
- data/tests/art/my_art/sample.xpm +251 -0
- data/tests/art/sample3.xpm +251 -0
- data/tests/art/test_art/bitmap/sample.xpm +251 -0
- data/tests/art/test_art/bitmap/wxruby.bmp +0 -0
- data/tests/art/test_art/bitmap/wxruby.png +0 -0
- data/tests/art/test_art/bitmap/wxruby.xpm +251 -0
- data/tests/art/test_art/cursor/wxruby.bmp +0 -0
- data/tests/art/test_art/icon/sample.xpm +251 -0
- data/tests/art/test_art/icon/wxruby.ico +0 -0
- data/tests/art/test_art/icon/wxruby.png +0 -0
- data/tests/art/test_art/image/sample.xpm +251 -0
- data/tests/art/test_art/image/wxruby.jpg +0 -0
- data/tests/art/test_art/image/wxruby.png +0 -0
- data/tests/art/test_art/sample2.xpm +251 -0
- data/tests/test_art.rb +91 -0
- data/tests/test_clipboard.rb +35 -0
- data/tests/test_dc.rb +70 -0
- data/tests/test_events.rb +12 -0
- data/tests/test_geometry.rb +13 -0
- metadata +51 -5
@@ -0,0 +1,251 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * sample2_xpm[] = {
|
3
|
+
"32 32 216 2",
|
4
|
+
" c None",
|
5
|
+
". c #872C2C",
|
6
|
+
"+ c #A52827",
|
7
|
+
"@ c #A42828",
|
8
|
+
"# c #553131",
|
9
|
+
"$ c #7D2D2D",
|
10
|
+
"% c #3D3232",
|
11
|
+
"& c #535331",
|
12
|
+
"* c #AEAE26",
|
13
|
+
"= c #85852C",
|
14
|
+
"- c #ACAC26",
|
15
|
+
"; c #88882C",
|
16
|
+
"> c #9B2929",
|
17
|
+
", c #A92626",
|
18
|
+
"' c #F10D0C",
|
19
|
+
") c #B32424",
|
20
|
+
"! c #D91919",
|
21
|
+
"~ c #A52727",
|
22
|
+
"{ c #E51414",
|
23
|
+
"] c #DC1817",
|
24
|
+
"^ c #9F2828",
|
25
|
+
"/ c #A5A527",
|
26
|
+
"( c #F2F20B",
|
27
|
+
"_ c #FFFF00",
|
28
|
+
": c #F1F10C",
|
29
|
+
"< c #AEAE25",
|
30
|
+
"[ c #E7E712",
|
31
|
+
"} c #BEBE22",
|
32
|
+
"| c #999929",
|
33
|
+
"1 c #DE1716",
|
34
|
+
"2 c #A82626",
|
35
|
+
"3 c #EF0E0D",
|
36
|
+
"4 c #CA1E1E",
|
37
|
+
"5 c #C42020",
|
38
|
+
"6 c #EC1010",
|
39
|
+
"7 c #9E2828",
|
40
|
+
"8 c #B12525",
|
41
|
+
"9 c #E91211",
|
42
|
+
"0 c #922A2A",
|
43
|
+
"a c #A8A827",
|
44
|
+
"b c #EFEF0D",
|
45
|
+
"c c #C5C520",
|
46
|
+
"d c #FBFB03",
|
47
|
+
"e c #A6A627",
|
48
|
+
"f c #FAFA04",
|
49
|
+
"g c #CACA1E",
|
50
|
+
"h c #DDDD18",
|
51
|
+
"i c #F8F806",
|
52
|
+
"j c #B8B823",
|
53
|
+
"k c #E3E315",
|
54
|
+
"l c #9E2929",
|
55
|
+
"m c #D01D1D",
|
56
|
+
"n c #B72423",
|
57
|
+
"o c #AD2625",
|
58
|
+
"p c #DD1817",
|
59
|
+
"q c #B22525",
|
60
|
+
"r c #D71A1A",
|
61
|
+
"s c #EBEB10",
|
62
|
+
"t c #B0B025",
|
63
|
+
"u c #C0C021",
|
64
|
+
"v c #E6E613",
|
65
|
+
"w c #97972A",
|
66
|
+
"x c #A22828",
|
67
|
+
"y c #BB2323",
|
68
|
+
"z c #B82424",
|
69
|
+
"A c #4A3232",
|
70
|
+
"B c #842D2D",
|
71
|
+
"C c #912B2B",
|
72
|
+
"D c #5B3131",
|
73
|
+
"E c #70702F",
|
74
|
+
"F c #C6C620",
|
75
|
+
"G c #8E8E2B",
|
76
|
+
"H c #9A9A29",
|
77
|
+
"I c #484832",
|
78
|
+
"J c #A4A428",
|
79
|
+
"K c #9D2828",
|
80
|
+
"L c #E61211",
|
81
|
+
"M c #E51212",
|
82
|
+
"N c #DF1615",
|
83
|
+
"O c #D21B1A",
|
84
|
+
"P c #423232",
|
85
|
+
"Q c #515131",
|
86
|
+
"R c #E4E412",
|
87
|
+
"S c #F3F307",
|
88
|
+
"T c #E2E213",
|
89
|
+
"U c #BEBE20",
|
90
|
+
"V c #ECEC0C",
|
91
|
+
"W c #B1B124",
|
92
|
+
"X c #999928",
|
93
|
+
"Y c #CF1D1D",
|
94
|
+
"Z c #CD1E1D",
|
95
|
+
"` c #D21C1C",
|
96
|
+
" . c #A42727",
|
97
|
+
".. c #ED0F0F",
|
98
|
+
"+. c #7E2D2D",
|
99
|
+
"@. c #92922B",
|
100
|
+
"#. c #FDFD01",
|
101
|
+
"$. c #D1D11C",
|
102
|
+
"%. c #E5E513",
|
103
|
+
"&. c #643030",
|
104
|
+
"*. c #E61313",
|
105
|
+
"=. c #EE0F0E",
|
106
|
+
"-. c #A92726",
|
107
|
+
";. c #C1C121",
|
108
|
+
">. c #ADAD25",
|
109
|
+
",. c #EEEE0E",
|
110
|
+
"'. c #5C5C31",
|
111
|
+
"). c #F00D0C",
|
112
|
+
"!. c #AA2726",
|
113
|
+
"~. c #AF2525",
|
114
|
+
"{. c #EA1110",
|
115
|
+
"]. c #32365A",
|
116
|
+
"^. c #333440",
|
117
|
+
"/. c #E2E215",
|
118
|
+
"(. c #F0F00D",
|
119
|
+
"_. c #C4C420",
|
120
|
+
":. c #F5F508",
|
121
|
+
"<. c #BCBC22",
|
122
|
+
"[. c #FCFC02",
|
123
|
+
"}. c #8C8C2B",
|
124
|
+
"|. c #B92323",
|
125
|
+
"1. c #E51413",
|
126
|
+
"2. c #633030",
|
127
|
+
"3. c #313A74",
|
128
|
+
"4. c #2D43AE",
|
129
|
+
"5. c #2E40A2",
|
130
|
+
"6. c #313975",
|
131
|
+
"7. c #77772E",
|
132
|
+
"8. c #F7F706",
|
133
|
+
"9. c #CBCB1E",
|
134
|
+
"0. c #BABA23",
|
135
|
+
"a. c #D81919",
|
136
|
+
"b. c #A62727",
|
137
|
+
"c. c #D41B1B",
|
138
|
+
"d. c #C91F1E",
|
139
|
+
"e. c #8F2B2B",
|
140
|
+
"f. c #323553",
|
141
|
+
"g. c #2C45BA",
|
142
|
+
"h. c #284CE0",
|
143
|
+
"i. c #2A4AD5",
|
144
|
+
"j. c #2C46C0",
|
145
|
+
"k. c #A3A328",
|
146
|
+
"l. c #DEDE17",
|
147
|
+
"m. c #772E2E",
|
148
|
+
"n. c #EC100F",
|
149
|
+
"o. c #AB2626",
|
150
|
+
"p. c #B12524",
|
151
|
+
"q. c #2B47C8",
|
152
|
+
"r. c #2D43AF",
|
153
|
+
"s. c #2453FF",
|
154
|
+
"t. c #2552FA",
|
155
|
+
"u. c #2D44B6",
|
156
|
+
"v. c #2C45BE",
|
157
|
+
"w. c #BEBE21",
|
158
|
+
"x. c #BFBF22",
|
159
|
+
"y. c #B2B224",
|
160
|
+
"z. c #6B2F2F",
|
161
|
+
"A. c #C6201F",
|
162
|
+
"B. c #2F409F",
|
163
|
+
"C. c #2551F8",
|
164
|
+
"D. c #2C44B9",
|
165
|
+
"E. c #2452FC",
|
166
|
+
"F. c #2F3E92",
|
167
|
+
"G. c #585831",
|
168
|
+
"H. c #8E8E2A",
|
169
|
+
"I. c #79792D",
|
170
|
+
"J. c #5C3030",
|
171
|
+
"K. c #333333",
|
172
|
+
"L. c #313971",
|
173
|
+
"M. c #2551F5",
|
174
|
+
"N. c #2A49D0",
|
175
|
+
"O. c #284EE6",
|
176
|
+
"P. c #294BD9",
|
177
|
+
"Q. c #294CDD",
|
178
|
+
"R. c #2650F1",
|
179
|
+
"S. c #323761",
|
180
|
+
"T. c #606030",
|
181
|
+
"U. c #294CDE",
|
182
|
+
"V. c #2D42AD",
|
183
|
+
"W. c #2D43B3",
|
184
|
+
"X. c #2A4AD6",
|
185
|
+
"Y. c #2C45BD",
|
186
|
+
"Z. c #303B7C",
|
187
|
+
"`. c #2650F0",
|
188
|
+
" + c #2650F3",
|
189
|
+
".+ c #2B46C3",
|
190
|
+
"++ c #284CDE",
|
191
|
+
"@+ c #2A49D1",
|
192
|
+
"#+ c #264FED",
|
193
|
+
"$+ c #31396F",
|
194
|
+
"%+ c #303D90",
|
195
|
+
"&+ c #2B47C6",
|
196
|
+
"*+ c #31386B",
|
197
|
+
"=+ c #2E41A7",
|
198
|
+
"-+ c #313A77",
|
199
|
+
";+ c #303C86",
|
200
|
+
">+ c #2551F7",
|
201
|
+
",+ c #2D43B1",
|
202
|
+
"'+ c #2E41A6",
|
203
|
+
")+ c #2552FB",
|
204
|
+
"!+ c #2552F9",
|
205
|
+
"~+ c #2552F8",
|
206
|
+
"{+ c #323765",
|
207
|
+
"]+ c #2B48CB",
|
208
|
+
"^+ c #2A49CF",
|
209
|
+
"/+ c #274EE7",
|
210
|
+
"(+ c #264FEE",
|
211
|
+
"_+ c #2D42AE",
|
212
|
+
":+ c #2650F2",
|
213
|
+
"<+ c #294BDA",
|
214
|
+
"[+ c #2C46C1",
|
215
|
+
"}+ c #313A78",
|
216
|
+
"|+ c #2D42AA",
|
217
|
+
"1+ c #294BDC",
|
218
|
+
"2+ c #2B48CA",
|
219
|
+
"3+ c #2453FD",
|
220
|
+
" ",
|
221
|
+
" ",
|
222
|
+
" ",
|
223
|
+
" ",
|
224
|
+
" ",
|
225
|
+
" . + + @ # $ + + + % & * * * = & - * * ; ",
|
226
|
+
" > , ' ' ) ! ~ { ' ] ^ / ( _ : < [ } _ _ < | ",
|
227
|
+
" 1 2 3 4 5 ' 6 7 3 8 9 0 a b c d e f _ g h i j k ",
|
228
|
+
" l ' m n o ' ' ' p q ~ ' r s _ < t b _ _ _ < u v _ w ",
|
229
|
+
" x y z A z y y y y B C y y D E F F G H F F F F } I c F J ",
|
230
|
+
" K L L ^ M L L L L , N L O P Q R S T U S S S S V W S S X ",
|
231
|
+
" Y ' Z ` ' ' ' ' .' ..+. @.#._ < _ _ _ _ $.%._ $. ",
|
232
|
+
" &.*.=., ' ' ' ! 5 ' -. } _ ;.( _ _ _ >._ ,.'. ",
|
233
|
+
" C ).!.=.' ' ~.{.Z ].^. /.(._._ _ :.<.[.}. ",
|
234
|
+
" |.` Z ' ' ~ 1.2. 3.4.5.6. 7.8.>._ _ 9.s 0. ",
|
235
|
+
" a.b.' c.d.e. f.g.h.i.j. k.F ,._ < l. ",
|
236
|
+
" m. .n.o.p. q.r.s.t.u.v. w.x.( y.E ",
|
237
|
+
" z.A.$ B.C.D.s.s.r.E.F. G.H._.I. ",
|
238
|
+
" J.K. L.M.N.O.s.s.P.Q.R.S. K.T. ",
|
239
|
+
" K. U.s.V.s.s.s.E.W.s.X. ",
|
240
|
+
" g.s.M.Y.s.s.s.s.W.E.s.V. ",
|
241
|
+
" Z.`. +.+++ + + + +@+N. +#+$+ ",
|
242
|
+
" %+&+&+*+W.&+&+&+&+=+-+&+&+;+ ",
|
243
|
+
" 6.E.>+,+'+)+s.s.!+=+r.E.~+{+ ",
|
244
|
+
" ]+^+/+(+,+s.s._+:+Q.<+[+ ",
|
245
|
+
" }+|+s.s.1+q.2+Q.s.3+=+{+ ",
|
246
|
+
" 6._+_+_+$+$+_+_+_+*+ ",
|
247
|
+
" ",
|
248
|
+
" ",
|
249
|
+
" ",
|
250
|
+
" ",
|
251
|
+
" "};
|
data/tests/test_art.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
3
|
+
|
4
|
+
class TestArt < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def test_icons
|
7
|
+
icons = []
|
8
|
+
assert_nothing_raised do
|
9
|
+
icons << Wx.Icon(:sample)
|
10
|
+
icons << Wx.Icon(:sample2)
|
11
|
+
icons << Wx.Icon(:sample3)
|
12
|
+
end
|
13
|
+
assert_all?(icons) { |ico| ico.instance_of?(Wx::Icon) }
|
14
|
+
assert_all?(icons) { |ico| ico.ok? }
|
15
|
+
icons.clear
|
16
|
+
assert_nothing_raised do
|
17
|
+
icons << Wx.Icon(:wxruby, Wx::BitmapType::BITMAP_TYPE_PNG)
|
18
|
+
end
|
19
|
+
assert_all?(icons) { |ico| ico.instance_of?(Wx::Icon) }
|
20
|
+
assert_all?(icons) { |ico| ico.ok? }
|
21
|
+
assert_raises(ArgumentError) do
|
22
|
+
Wx::Icon(:wxruby, Wx::BitmapType::BITMAP_TYPE_GIF)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_bitmap
|
27
|
+
bmps = []
|
28
|
+
assert_nothing_raised do
|
29
|
+
bmps << Wx.Bitmap(:wxruby)
|
30
|
+
bmps << Wx.Bitmap(:sample2)
|
31
|
+
bmps << Wx.Bitmap(:sample3)
|
32
|
+
end
|
33
|
+
assert_all?(bmps) { |bmp| bmp.instance_of?(Wx::Bitmap) }
|
34
|
+
assert_all?(bmps) { |bmp| bmp.ok? }
|
35
|
+
bmps.clear
|
36
|
+
assert_nothing_raised do
|
37
|
+
bmps << Wx.Bitmap(:wxruby, Wx::BitmapType::BITMAP_TYPE_PNG)
|
38
|
+
end
|
39
|
+
assert_all?(bmps) { |bmp| bmp.instance_of?(Wx::Bitmap) }
|
40
|
+
assert_all?(bmps) { |bmp| bmp.ok? }
|
41
|
+
assert_raises(ArgumentError) do
|
42
|
+
Wx::Bitmap(:wxruby, Wx::BitmapType::BITMAP_TYPE_GIF)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if Wx::PLATFORM == 'WXMSW'
|
47
|
+
|
48
|
+
def test_cursors
|
49
|
+
cursor = nil
|
50
|
+
assert_nothing_raised do
|
51
|
+
cursor = Wx.Cursor(:wxruby)
|
52
|
+
end
|
53
|
+
assert_instance_of(Wx::Cursor, cursor)
|
54
|
+
assert { cursor.ok? }
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_image
|
60
|
+
imgs = []
|
61
|
+
assert_nothing_raised do
|
62
|
+
imgs << Wx.Image(:wxruby, Wx::BitmapType::BITMAP_TYPE_JPEG)
|
63
|
+
imgs << Wx.Image(:sample2)
|
64
|
+
imgs << Wx.Image(:sample3)
|
65
|
+
end
|
66
|
+
assert_all?(imgs) { |img| img.instance_of?(Wx::Image) }
|
67
|
+
assert_all?(imgs) { |img| img.ok? }
|
68
|
+
imgs.clear
|
69
|
+
assert_nothing_raised do
|
70
|
+
imgs << Wx.Image(:wxruby, Wx::BitmapType::BITMAP_TYPE_PNG)
|
71
|
+
end
|
72
|
+
assert_all?(imgs) { |img| img.instance_of?(Wx::Image) }
|
73
|
+
assert_all?(imgs) { |img| img.ok? }
|
74
|
+
assert_raises(ArgumentError) do
|
75
|
+
Wx::Image(:wxruby, Wx::BitmapType::BITMAP_TYPE_GIF)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_art
|
80
|
+
art = nil
|
81
|
+
assert_nothing_raised do
|
82
|
+
art = Wx::ArtLocator.find_art(:sample, art_section: 'my_art')
|
83
|
+
end
|
84
|
+
assert_not_nil(art)
|
85
|
+
assert { File.exist?(art) }
|
86
|
+
assert_equal('sample', File.basename(art, '.*'))
|
87
|
+
img = Wx::Image.new(art)
|
88
|
+
assert { img.ok? }
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
data/tests/test_clipboard.rb
CHANGED
@@ -34,6 +34,41 @@ class TestTextData < Test::Unit::TestCase
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
if Wx.has_feature?(:USE_HTML) && Wx::WXWIDGETS_VERSION >= '3.3'
|
38
|
+
class TestHtmlData < Test::Unit::TestCase
|
39
|
+
# Using an in-built class
|
40
|
+
def test_text_data
|
41
|
+
td = Wx::HTMLDataObject.new('<html><body><h1>Header</h1></body></html>')
|
42
|
+
assert_equal('<html><body><h1>Header</h1></body></html>', td.html)
|
43
|
+
|
44
|
+
Wx::Clipboard.open do | clip |
|
45
|
+
assert clip.opened?
|
46
|
+
clip.clear
|
47
|
+
assert !clip.supported?(Wx::DF_BITMAP)
|
48
|
+
clip.place td
|
49
|
+
assert clip.supported?(Wx::DF_HTML)
|
50
|
+
assert !clip.supported?(Wx::DF_BITMAP)
|
51
|
+
end
|
52
|
+
|
53
|
+
td_2 = Wx::HTMLDataObject.new
|
54
|
+
Wx::Clipboard.open do | clip |
|
55
|
+
clip.fetch td_2
|
56
|
+
end
|
57
|
+
assert_equal('<html><body><h1>Header</h1></body></html>', td_2.html)
|
58
|
+
|
59
|
+
Wx::Clipboard.open do | clip |
|
60
|
+
clip.clear
|
61
|
+
end
|
62
|
+
|
63
|
+
td_3 = Wx::HTMLDataObject.new
|
64
|
+
Wx::Clipboard.open do | clip |
|
65
|
+
clip.fetch td_3
|
66
|
+
end
|
67
|
+
assert_equal('', td_3.get_data_here)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
37
72
|
class TestBitmapData < Test::Unit::TestCase
|
38
73
|
def test_bitmap_data
|
39
74
|
bmp = Wx::Bitmap.new(File.join(__dir__, '../samples/minimal/mondrian.png'))
|
data/tests/test_dc.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
|
2
|
+
require_relative './lib/wxapp_runner'
|
3
|
+
|
4
|
+
class TestDC < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def test_memory_dc
|
7
|
+
bmp = Wx::Bitmap.new(100, 100)
|
8
|
+
assert_nothing_raised do
|
9
|
+
Wx::MemoryDC.draw_on(bmp) do |mdc|
|
10
|
+
mdc.set_background(Wx::WHITE_BRUSH)
|
11
|
+
mdc.clear
|
12
|
+
mdc.set_pen(Wx::BLACK_PEN)
|
13
|
+
mdc.set_brush(Wx::WHITE_BRUSH)
|
14
|
+
mdc.draw_rectangle(0, 0, 60, 15)
|
15
|
+
mdc.draw_line(0, 0, 59, 14)
|
16
|
+
mdc.set_text_foreground(Wx::BLACK)
|
17
|
+
mdc.draw_text("x1", 0, 0)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_gc_dc
|
23
|
+
bmp = Wx::Bitmap.new(100, 100)
|
24
|
+
assert_nothing_raised do
|
25
|
+
Wx::MemoryDC.draw_on(bmp) do |mdc|
|
26
|
+
Wx::GCDC.draw_on(mdc) do |gdc|
|
27
|
+
gdc.set_background(Wx::WHITE_BRUSH)
|
28
|
+
gdc.clear
|
29
|
+
gdc.set_pen(Wx::BLACK_PEN)
|
30
|
+
gdc.set_brush(Wx::WHITE_BRUSH)
|
31
|
+
GC.start
|
32
|
+
gdc.draw_rectangle(0, 0, 60, 15)
|
33
|
+
gdc.draw_line(0, 0, 59, 14)
|
34
|
+
gdc.set_text_foreground(Wx::BLACK)
|
35
|
+
gdc.draw_text("x1", 0, 0)
|
36
|
+
GC.start
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_gc_dc_stress
|
43
|
+
10.times do
|
44
|
+
bmp = Wx::Bitmap.new(100, 100)
|
45
|
+
assert_nothing_raised do
|
46
|
+
Wx::MemoryDC.draw_on(bmp) do |mdc|
|
47
|
+
Wx::GCDC.draw_on(mdc) do |gdc|
|
48
|
+
|
49
|
+
gc = gdc.get_graphics_context
|
50
|
+
gc.scale(0.9, 0.9)
|
51
|
+
|
52
|
+
10.times do |i|
|
53
|
+
gdc.set_background(Wx::WHITE_BRUSH)
|
54
|
+
gdc.clear
|
55
|
+
gdc.set_pen(Wx::BLACK_PEN)
|
56
|
+
gdc.set_brush(Wx::WHITE_BRUSH)
|
57
|
+
GC.start
|
58
|
+
gdc.draw_rectangle(0, 0, 60, 15)
|
59
|
+
gdc.draw_line(0, 0, 59, 14)
|
60
|
+
gdc.set_text_foreground(Wx::BLACK)
|
61
|
+
gdc.draw_text("x1", 0, 0)
|
62
|
+
GC.start
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
data/tests/test_events.rb
CHANGED
@@ -31,6 +31,18 @@ class EventTests < Test::Unit::TestCase
|
|
31
31
|
assert_equal(evt.id, evt_dup.id)
|
32
32
|
assert_equal(evt.string, evt_dup.string)
|
33
33
|
end
|
34
|
+
|
35
|
+
def test_event_clone
|
36
|
+
evt = Wx::MouseEvent.new(Wx::EVT_LEFT_DOWN)
|
37
|
+
assert_equal(Wx::EVT_LEFT_DOWN, evt.event_type)
|
38
|
+
evt.position = Wx::Point.new(333,666)
|
39
|
+
assert_equal(Wx::Point.new(333,666), evt.position)
|
40
|
+
evt_dup = evt.clone
|
41
|
+
assert_instance_of(Wx::MouseEvent, evt_dup)
|
42
|
+
assert_not_equal(evt, evt_dup)
|
43
|
+
assert_equal(evt.event_type, evt_dup.event_type)
|
44
|
+
assert_equal(evt.position, evt_dup.position)
|
45
|
+
end
|
34
46
|
end
|
35
47
|
|
36
48
|
class TestApp < Wx::App
|
data/tests/test_geometry.rb
CHANGED
@@ -173,6 +173,19 @@ class GeometryTests < Test::Unit::TestCase
|
|
173
173
|
assert_equal(Wx::Rect.new(2, 20, 0, 290), (rect * Wx::Rect.new(2, 20, 0, 300)))
|
174
174
|
assert_equal(Wx::Rect.new(102, 20, 0, 0), (rect & Wx::Rect.new(102, 20, 100, 300)))
|
175
175
|
assert_equal(Wx::Rect.new(102, 20, -1, 290), (rect * Wx::Rect.new(102, 20, 100, 300)))
|
176
|
+
|
177
|
+
rect = Wx::Rect.new(5,5,10,10)
|
178
|
+
assert_equal([3,3,14,14], rect.inflate([2,2]))
|
179
|
+
assert_not_equal(rect.object_id, rect.inflate(2,2))
|
180
|
+
assert_equal([3,3,14,14], rect.inflate!(2))
|
181
|
+
assert_equal([3,3,14,14], rect)
|
182
|
+
assert_equal([5,5,10,10], rect.deflate([2,2]))
|
183
|
+
assert_not_equal(rect.object_id, rect.deflate(2,2))
|
184
|
+
assert_equal([5,5,10,10], rect.deflate!(2))
|
185
|
+
assert_equal([5,5,10,10], rect)
|
186
|
+
assert_equal([6,7,10,10], rect.offset(1,2))
|
187
|
+
assert_equal([6,7,10,10], rect.offset!(Wx::Point.new(1,2)))
|
188
|
+
assert_equal([6,7,10,10], rect)
|
176
189
|
end
|
177
190
|
|
178
191
|
end
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Corino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -77,8 +77,12 @@ extra_rdoc_files: []
|
|
77
77
|
files:
|
78
78
|
- ".yardopts"
|
79
79
|
- CREDITS.md
|
80
|
+
- INSTALL.md
|
80
81
|
- LICENSE
|
81
82
|
- README.md
|
83
|
+
- assets/logo.png
|
84
|
+
- assets/logo.svg
|
85
|
+
- assets/logo.xcf
|
82
86
|
- bin/wxruby
|
83
87
|
- ext/mkrf_conf_srcgem.rb
|
84
88
|
- ext/wxruby3/include/wxruby-ScaledDC.h
|
@@ -105,6 +109,8 @@ files:
|
|
105
109
|
- lib/wx/core/acceleratortable.rb
|
106
110
|
- lib/wx/core/animation.rb
|
107
111
|
- lib/wx/core/app.rb
|
112
|
+
- lib/wx/core/array_ext.rb
|
113
|
+
- lib/wx/core/art_locator.rb
|
108
114
|
- lib/wx/core/artprovider.rb
|
109
115
|
- lib/wx/core/bitmap.rb
|
110
116
|
- lib/wx/core/busycursor.rb
|
@@ -116,6 +122,7 @@ files:
|
|
116
122
|
- lib/wx/core/colour.rb
|
117
123
|
- lib/wx/core/combobox.rb
|
118
124
|
- lib/wx/core/controlwithitems.rb
|
125
|
+
- lib/wx/core/cursor.rb
|
119
126
|
- lib/wx/core/data_object.rb
|
120
127
|
- lib/wx/core/dataformat.rb
|
121
128
|
- lib/wx/core/dc.rb
|
@@ -133,6 +140,7 @@ files:
|
|
133
140
|
- lib/wx/core/helpcontrollerhelpprovider.rb
|
134
141
|
- lib/wx/core/helpprovider.rb
|
135
142
|
- lib/wx/core/icon.rb
|
143
|
+
- lib/wx/core/id_helper.rb
|
136
144
|
- lib/wx/core/image.rb
|
137
145
|
- lib/wx/core/imagelist.rb
|
138
146
|
- lib/wx/core/listbox.rb
|
@@ -149,6 +157,7 @@ files:
|
|
149
157
|
- lib/wx/core/point.rb
|
150
158
|
- lib/wx/core/real_point.rb
|
151
159
|
- lib/wx/core/rect.rb
|
160
|
+
- lib/wx/core/region_iterator.rb
|
152
161
|
- lib/wx/core/simplehelpprovider.rb
|
153
162
|
- lib/wx/core/size.rb
|
154
163
|
- lib/wx/core/sizer.rb
|
@@ -164,13 +173,21 @@ files:
|
|
164
173
|
- lib/wx/core/window.rb
|
165
174
|
- lib/wx/core/window_update_locker.rb
|
166
175
|
- lib/wx/core/xmlresource.rb
|
176
|
+
- lib/wx/doc/array_ext.rb
|
177
|
+
- lib/wx/doc/art_locator.rb
|
167
178
|
- lib/wx/doc/aui/auimanager.rb
|
168
179
|
- lib/wx/doc/aui/auinotebook.rb
|
180
|
+
- lib/wx/doc/bitmap.rb
|
181
|
+
- lib/wx/doc/clipboard.rb
|
169
182
|
- lib/wx/doc/colour_dialog.rb
|
183
|
+
- lib/wx/doc/const.rb
|
170
184
|
- lib/wx/doc/core.rb
|
185
|
+
- lib/wx/doc/cursor.rb
|
171
186
|
- lib/wx/doc/data_object.rb
|
172
187
|
- lib/wx/doc/dc.rb
|
173
188
|
- lib/wx/doc/enum.rb
|
189
|
+
- lib/wx/doc/event.rb
|
190
|
+
- lib/wx/doc/events.rb
|
174
191
|
- lib/wx/doc/evthandler.rb
|
175
192
|
- lib/wx/doc/extra/00_starting.md
|
176
193
|
- lib/wx/doc/extra/01_packages.md
|
@@ -182,11 +199,17 @@ files:
|
|
182
199
|
- lib/wx/doc/extra/07_colour_and_font.md
|
183
200
|
- lib/wx/doc/extra/08_extensions.md
|
184
201
|
- lib/wx/doc/extra/09_exceptions.md
|
202
|
+
- lib/wx/doc/extra/10_art.md
|
185
203
|
- lib/wx/doc/functions.rb
|
204
|
+
- lib/wx/doc/gc_dc.rb
|
186
205
|
- lib/wx/doc/gdi_common.rb
|
206
|
+
- lib/wx/doc/graphics_context.rb
|
187
207
|
- lib/wx/doc/grid/grid.rb
|
188
208
|
- lib/wx/doc/help_controller.rb
|
189
209
|
- lib/wx/doc/html/html_help_controller.rb
|
210
|
+
- lib/wx/doc/icon.rb
|
211
|
+
- lib/wx/doc/id_helper.rb
|
212
|
+
- lib/wx/doc/image.rb
|
190
213
|
- lib/wx/doc/pg/events.rb
|
191
214
|
- lib/wx/doc/pg/pg_property.rb
|
192
215
|
- lib/wx/doc/pg/pgeditor.rb
|
@@ -201,6 +224,7 @@ files:
|
|
201
224
|
- lib/wx/doc/rbn/ribbon_button_bar.rb
|
202
225
|
- lib/wx/doc/rbn/ribbon_gallery.rb
|
203
226
|
- lib/wx/doc/rbn/ribbon_tool_bar.rb
|
227
|
+
- lib/wx/doc/region_iterator.rb
|
204
228
|
- lib/wx/doc/rtc/richtext_printing.rb
|
205
229
|
- lib/wx/doc/scaled_dc.rb
|
206
230
|
- lib/wx/doc/screen_dc.rb
|
@@ -209,6 +233,7 @@ files:
|
|
209
233
|
- lib/wx/doc/system_settings.rb
|
210
234
|
- lib/wx/doc/treebook.rb
|
211
235
|
- lib/wx/doc/variant.rb
|
236
|
+
- lib/wx/doc/window.rb
|
212
237
|
- lib/wx/doc/xml_resource.rb
|
213
238
|
- lib/wx/global_const.rb
|
214
239
|
- lib/wx/grid.rb
|
@@ -367,6 +392,7 @@ files:
|
|
367
392
|
- rakelib/lib/director/help_controller.rb
|
368
393
|
- rakelib/lib/director/help_provider.rb
|
369
394
|
- rakelib/lib/director/html_cell.rb
|
395
|
+
- rakelib/lib/director/html_data_object.rb
|
370
396
|
- rakelib/lib/director/html_easy_printing.rb
|
371
397
|
- rakelib/lib/director/html_event.rb
|
372
398
|
- rakelib/lib/director/html_help_data.rb
|
@@ -415,6 +441,7 @@ files:
|
|
415
441
|
- rakelib/lib/director/property_grid_page_state.rb
|
416
442
|
- rakelib/lib/director/radio_box.rb
|
417
443
|
- rakelib/lib/director/region.rb
|
444
|
+
- rakelib/lib/director/region_iterator.rb
|
418
445
|
- rakelib/lib/director/ribbon_art_provider.rb
|
419
446
|
- rakelib/lib/director/ribbon_bar.rb
|
420
447
|
- rakelib/lib/director/ribbon_bar_event.rb
|
@@ -429,6 +456,7 @@ files:
|
|
429
456
|
- rakelib/lib/director/ribbon_tool_bar.rb
|
430
457
|
- rakelib/lib/director/ribbon_tool_bar_event.rb
|
431
458
|
- rakelib/lib/director/richtext_buffer.rb
|
459
|
+
- rakelib/lib/director/richtext_buffer_data_object.rb
|
432
460
|
- rakelib/lib/director/richtext_ctrl.rb
|
433
461
|
- rakelib/lib/director/richtext_event.rb
|
434
462
|
- rakelib/lib/director/richtext_file_handler.rb
|
@@ -437,9 +465,11 @@ files:
|
|
437
465
|
- rakelib/lib/director/sash_layout_event.rb
|
438
466
|
- rakelib/lib/director/sash_layout_window.rb
|
439
467
|
- rakelib/lib/director/sash_window.rb
|
468
|
+
- rakelib/lib/director/scroll_bar.rb
|
440
469
|
- rakelib/lib/director/scrolled_t.rb
|
441
470
|
- rakelib/lib/director/sizer.rb
|
442
471
|
- rakelib/lib/director/sizer_item.rb
|
472
|
+
- rakelib/lib/director/slider.rb
|
443
473
|
- rakelib/lib/director/splash_screen.rb
|
444
474
|
- rakelib/lib/director/splitter_event.rb
|
445
475
|
- rakelib/lib/director/splitter_window.rb
|
@@ -821,9 +851,25 @@ files:
|
|
821
851
|
- samples/xrc/samples.xrc
|
822
852
|
- samples/xrc/tn_xrc_sample.png
|
823
853
|
- samples/xrc/xrc_sample.rb
|
854
|
+
- tests/art/my_art/sample.xpm
|
855
|
+
- tests/art/sample3.xpm
|
856
|
+
- tests/art/test_art/bitmap/sample.xpm
|
857
|
+
- tests/art/test_art/bitmap/wxruby.bmp
|
858
|
+
- tests/art/test_art/bitmap/wxruby.png
|
859
|
+
- tests/art/test_art/bitmap/wxruby.xpm
|
860
|
+
- tests/art/test_art/cursor/wxruby.bmp
|
861
|
+
- tests/art/test_art/icon/sample.xpm
|
862
|
+
- tests/art/test_art/icon/wxruby.ico
|
863
|
+
- tests/art/test_art/icon/wxruby.png
|
864
|
+
- tests/art/test_art/image/sample.xpm
|
865
|
+
- tests/art/test_art/image/wxruby.jpg
|
866
|
+
- tests/art/test_art/image/wxruby.png
|
867
|
+
- tests/art/test_art/sample2.xpm
|
824
868
|
- tests/lib/wxapp_runner.rb
|
869
|
+
- tests/test_art.rb
|
825
870
|
- tests/test_basic.rb
|
826
871
|
- tests/test_clipboard.rb
|
872
|
+
- tests/test_dc.rb
|
827
873
|
- tests/test_dialog.rb
|
828
874
|
- tests/test_event_handling.rb
|
829
875
|
- tests/test_events.rb
|
@@ -837,10 +883,10 @@ homepage: https://github.com/mcorino/wxRuby3
|
|
837
883
|
licenses:
|
838
884
|
- MIT
|
839
885
|
metadata:
|
840
|
-
bug_tracker_uri: https://github.com/mcorino/
|
841
|
-
source_code_uri: https://github.com/mcorino/
|
886
|
+
bug_tracker_uri: https://github.com/mcorino/wxRuby3/issues
|
887
|
+
source_code_uri: https://github.com/mcorino/wxRuby3
|
842
888
|
documentation_uri: https://mcorino.github.io/wxRuby3
|
843
|
-
homepage_uri: https://github.com/mcorino/
|
889
|
+
homepage_uri: https://github.com/mcorino/wxRuby3
|
844
890
|
post_install_message: |2
|
845
891
|
|
846
892
|
wxRuby3 has been successfully installed including the 'wxruby' utility.
|