wxruby3 0.9.0.pre.rc.1-x64-mingw-ucrt → 0.9.0.pre.rc.2-x64-mingw-ucrt

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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +51 -22
  3. data/README.md +38 -6
  4. data/assets/hello_button-macos.png +0 -0
  5. data/assets/hello_button-msw.png +0 -0
  6. data/assets/hello_button_clicked-macos.png +0 -0
  7. data/assets/hello_button_clicked-msw.png +0 -0
  8. data/assets/hello_button_clicked_combi.png +0 -0
  9. data/assets/hello_world-macos.png +0 -0
  10. data/assets/hello_world-msw.png +0 -0
  11. data/assets/hello_world_combi.png +0 -0
  12. data/ext/wxbase32u_gcc_custom.dll +0 -0
  13. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  14. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  19. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  20. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  21. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  22. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  23. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  24. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  25. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  26. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  27. data/lib/wx/core/brush.rb +6 -0
  28. data/lib/wx/core/events/evt_list.rb +7 -0
  29. data/lib/wx/core/evthandler.rb +12 -2
  30. data/lib/wx/core/font.rb +22 -14
  31. data/lib/wx/core/helpprovider.rb +2 -2
  32. data/lib/wx/core/menu.rb +5 -0
  33. data/lib/wx/core/pen.rb +6 -0
  34. data/lib/wx/core/window.rb +28 -1
  35. data/lib/wx/doc/app.rb +40 -0
  36. data/lib/wx/doc/brush.rb +17 -0
  37. data/lib/wx/doc/font.rb +27 -0
  38. data/lib/wx/doc/gen/activity_indicator.rb +65 -0
  39. data/lib/wx/doc/gen/aui/aui_tool_bar.rb +2 -2
  40. data/lib/wx/doc/gen/context_help_button.rb +48 -0
  41. data/lib/wx/doc/gen/core.rb +2 -2
  42. data/lib/wx/doc/gen/event_blocker.rb +18 -16
  43. data/lib/wx/doc/gen/event_filter.rb +38 -45
  44. data/lib/wx/doc/gen/event_list.rb +7 -0
  45. data/lib/wx/doc/gen/file_dialog.rb +48 -49
  46. data/lib/wx/doc/gen/font.rb +9 -0
  47. data/lib/wx/doc/gen/hyperlink_ctrl.rb +147 -0
  48. data/lib/wx/doc/gen/hyperlink_event.rb +43 -0
  49. data/lib/wx/doc/gen/menu_bar.rb +0 -6
  50. data/lib/wx/doc/gen/radio_box.rb +0 -8
  51. data/lib/wx/doc/pen.rb +17 -0
  52. data/lib/wx/doc/radio_box.rb +20 -0
  53. data/lib/wx/doc/window.rb +27 -0
  54. data/lib/wx/keyword_defs.rb +77 -76
  55. data/lib/wx/prt/keyword_defs.rb +5 -1
  56. data/lib/wx/version.rb +1 -1
  57. data/lib/wxruby_aui.so +0 -0
  58. data/lib/wxruby_core.so +0 -0
  59. data/lib/wxruby_grid.so +0 -0
  60. data/lib/wxruby_html.so +0 -0
  61. data/lib/wxruby_pg.so +0 -0
  62. data/lib/wxruby_prt.so +0 -0
  63. data/lib/wxruby_rbn.so +0 -0
  64. data/lib/wxruby_rtc.so +0 -0
  65. data/lib/wxruby_stc.so +0 -0
  66. data/rakelib/install.rb +17 -6
  67. data/rakelib/lib/config/linux.rb +4 -2
  68. data/rakelib/lib/config/macosx.rb +120 -1
  69. data/rakelib/lib/config/mingw.rb +6 -1
  70. data/rakelib/lib/config/unixish.rb +26 -11
  71. data/rakelib/lib/config.rb +15 -6
  72. data/samples/aui/aui.rb +432 -363
  73. data/samples/propgrid/propgrid.rb +3 -0
  74. data/samples/sampler/editor.rb +33 -25
  75. data/samples/sampler/sample.rb +2 -2
  76. data/samples/sampler/stc_editor.rb +4 -2
  77. data/tests/lib/item_container_tests.rb +82 -0
  78. data/tests/lib/text_entry_tests.rb +80 -0
  79. data/tests/lib/wxapp_runner.rb +12 -0
  80. data/tests/lib/wxframe_runner.rb +89 -4
  81. data/tests/test_ext_controls.rb +28 -0
  82. data/tests/test_font.rb +239 -0
  83. data/tests/test_intl.rb +5 -1
  84. data/tests/test_std_controls.rb +263 -37
  85. data/tests/test_window.rb +340 -0
  86. metadata +25 -2
@@ -0,0 +1,340 @@
1
+
2
+ require_relative './lib/wxframe_runner'
3
+
4
+ class WindowTests < WxRuby::Test::GUITests
5
+
6
+ def setup
7
+ super
8
+ @window = Wx::Window.new(test_frame)
9
+ end
10
+
11
+ def cleanup
12
+ test_frame.destroy_children
13
+ @window = nil
14
+ super
15
+ end
16
+
17
+ attr_reader :window
18
+
19
+
20
+ def do_show_hide_event
21
+ count = count_events(window, :evt_show) do
22
+
23
+ assert(window.shown?)
24
+
25
+ window.show(false)
26
+
27
+ assert(!window.shown?)
28
+
29
+ window.show
30
+
31
+ assert(window.shown?)
32
+ end
33
+
34
+ assert_equal(2, count)
35
+ end
36
+
37
+ def test_show_hide_event
38
+
39
+ # normal
40
+ do_show_hide_event
41
+
42
+ # locked
43
+ window.locked do
44
+ assert(window.frozen?)
45
+
46
+ do_show_hide_event
47
+ end
48
+
49
+ end
50
+
51
+ if has_ui_simulator?
52
+
53
+ def test_key_event
54
+ if Wx::PLATFORM == 'WXGTK' || !is_ci_build?
55
+ count_events(window, :evt_key_down) do |c_keydown|
56
+ count_events(window, :evt_key_up) do |c_keyup|
57
+ count_events(window, :evt_char) do |c_keychar|
58
+
59
+ sim = Wx::UIActionSimulator.new
60
+
61
+ window.set_focus
62
+ Wx.get_app.yield
63
+
64
+ sim.text("text")
65
+ sim.char(Wx::K_SHIFT)
66
+ Wx.get_app.yield
67
+
68
+ assert_equal(5, c_keydown.count)
69
+ assert_equal(5, c_keyup.count)
70
+ assert_equal(4, c_keychar.count)
71
+
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ end
79
+
80
+ def test_focus_event
81
+ if Wx::PLATFORM != 'WXOSX'
82
+ count_events(window, :evt_set_focus) do |c_setfocus|
83
+ count_events(window, :evt_kill_focus) do |c_killfocus|
84
+ window.set_focus
85
+
86
+ assert(c_setfocus.wait_event(500))
87
+ assert_equal(window, Wx::Window.find_focus)
88
+
89
+ button = Wx::Button.new(test_frame, Wx::ID_ANY)
90
+
91
+ Wx.get_app.yield
92
+ button.set_focus
93
+
94
+ assert_equal(1, c_killfocus.count)
95
+ assert(!window.has_focus)
96
+ end
97
+ end
98
+ end
99
+ end
100
+
101
+ def test_mouse
102
+ cursor = Wx::Cursor.new(Wx::CURSOR_CHAR)
103
+ window.set_cursor(cursor)
104
+
105
+ assert(window.get_cursor.is_ok)
106
+
107
+ if Wx.has_feature?(:USE_CARET)
108
+ assert(!window.get_caret)
109
+
110
+ caret = nil
111
+
112
+ # Try creating the caret in two different, but normally equivalent, ways.
113
+ assert_nothing_raised("Caret 1-step") do
114
+ caret = Wx::Caret.new(window, [16, 16])
115
+
116
+ window.set_caret(caret)
117
+
118
+ assert(window.get_caret.ok?)
119
+ end
120
+
121
+ assert_nothing_raised("Caret 2-step") do
122
+ caret = Wx::Caret.new
123
+ caret.create(window, [16, 16])
124
+
125
+ window.set_caret(caret)
126
+
127
+ assert(window.get_caret.ok?)
128
+ end
129
+ end
130
+
131
+ window.capture_mouse
132
+
133
+ assert(window.has_capture)
134
+
135
+ window.release_mouse
136
+
137
+ assert(!window.has_capture)
138
+ end
139
+
140
+ def test_properties
141
+ window.set_label("label")
142
+
143
+ assert_equal('label', window.get_label)
144
+
145
+ window.set_name('name')
146
+
147
+ assert_equal('name', window.get_name)
148
+
149
+ #As we used wxID_ANY we should have a negative id
150
+ assert(window.get_id < 0)
151
+
152
+ window.set_id(Wx::ID_HIGHEST + 10)
153
+
154
+ assert_equal(Wx::ID_HIGHEST + 10, window.get_id)
155
+ end
156
+
157
+ if Wx.has_feature?(:USE_TOOLTIPS)
158
+ def test_tool_tip
159
+ assert(!window.get_tool_tip)
160
+ assert_equal('', window.get_tool_tip_text)
161
+
162
+ window.set_tool_tip("text tip")
163
+
164
+ assert_equal('text tip', window.get_tool_tip_text)
165
+
166
+ window.unset_tool_tip
167
+
168
+ assert(!window.get_tool_tip)
169
+ assert_equal('', window.get_tool_tip_text)
170
+
171
+ tip = Wx::ToolTip.new("other tip")
172
+
173
+ window.set_tool_tip(tip)
174
+
175
+ assert_equal(tip, window.get_tool_tip)
176
+ assert_equal('other tip', window.get_tool_tip_text)
177
+ end
178
+ end # wxUSE_TOOLTIPS
179
+
180
+ def test_help
181
+ if Wx.has_feature?(:USE_HELP)
182
+ Wx::HelpProvider.set(Wx::SimpleHelpProvider.new)
183
+
184
+ assert_equal('', window.get_help_text)
185
+
186
+ window.set_help_text("helptext")
187
+
188
+ assert_equal('helptext', window.get_help_text)
189
+ end
190
+ end
191
+
192
+ def test_parent
193
+ assert_equal(nil, window.get_grand_parent)
194
+ assert_equal(test_frame, window.get_parent)
195
+ end
196
+
197
+ def test_sibling
198
+ assert_equal(nil, window.get_next_sibling)
199
+ assert_equal(nil, window.get_prev_sibling)
200
+
201
+ newwin = Wx::Window.new(test_frame, Wx::ID_ANY)
202
+
203
+ assert_equal(newwin, window.get_next_sibling)
204
+ assert_equal(nil, window.get_prev_sibling)
205
+
206
+ assert_equal(nil, newwin.get_next_sibling)
207
+ assert_equal(window, newwin.get_prev_sibling)
208
+ end
209
+
210
+ def test_children
211
+ assert_equal(0, window.get_children.count)
212
+
213
+ child1 = Wx::Window.new(window, Wx::ID_ANY)
214
+
215
+ assert_equal(1, window.get_children.count)
216
+
217
+ window.remove_child(child1)
218
+
219
+ assert_equal(0, window.get_children.count)
220
+
221
+ child1.set_id(Wx::ID_HIGHEST + 1)
222
+ child1.set_name("child1")
223
+
224
+ window.add_child(child1)
225
+
226
+ assert_equal(1, window.get_children.count)
227
+ assert_equal(child1, window.find_window_by_id(Wx::ID_HIGHEST + 1))
228
+ assert_equal(child1, window.find_window_by_name("child1"))
229
+
230
+ window.destroy_children
231
+
232
+ assert_equal(0, window.get_children.count)
233
+ end
234
+
235
+ def test_focus
236
+ if Wx::PLATFORM != 'WXOSX'
237
+ assert(!window.has_focus)
238
+
239
+ if window.accepts_focus
240
+ window.set_focus
241
+ assert_equal(window, Wx::Window.find_focus)
242
+ end
243
+
244
+ # Set the focus back to the main window
245
+ test_frame.set_focus
246
+
247
+ if window.accepts_focus_from_keyboard
248
+ window.set_focus_from_kbd
249
+ assert_equal(window, Wx::Window.find_focus)
250
+ end
251
+ end
252
+ end
253
+
254
+ def test_positioning
255
+ # Some basic tests for consistency
256
+ pos = window.get_position
257
+ assert_equal(pos, window.get_position)
258
+ assert_equal(pos, window.get_rect.top_left)
259
+
260
+ pos = window.get_screen_position
261
+ assert_equal(pos, window.get_screen_position)
262
+ assert_equal(pos, window.get_screen_rect.top_left)
263
+ end
264
+
265
+ def test_show
266
+ assert(window.is_shown)
267
+
268
+ window.hide
269
+
270
+ assert(!window.is_shown)
271
+
272
+ window.show
273
+
274
+ assert(window.is_shown)
275
+
276
+ window.show(false)
277
+
278
+ assert(!window.is_shown)
279
+
280
+ window.show_with_effect(Wx::SHOW_EFFECT_BLEND)
281
+
282
+ assert(window.is_shown)
283
+
284
+ window.hide_with_effect(Wx::SHOW_EFFECT_BLEND)
285
+
286
+ assert(!window.is_shown)
287
+ end
288
+
289
+ def test_enable
290
+ assert(window.is_enabled)
291
+
292
+ window.disable
293
+
294
+ assert(!window.is_enabled)
295
+
296
+ window.enable
297
+
298
+ assert(window.is_enabled)
299
+
300
+ window.enable(false)
301
+
302
+ assert(!window.is_enabled)
303
+ window.enable
304
+
305
+
306
+ child = Wx::Window.new(window, Wx::ID_ANY)
307
+ assert(child.is_enabled)
308
+ assert(child.is_this_enabled)
309
+
310
+ window.disable
311
+ assert(!child.is_enabled)
312
+ assert(child.is_this_enabled)
313
+
314
+ child.disable
315
+ assert(!child.is_enabled)
316
+ assert(!child.is_this_enabled)
317
+
318
+ window.enable
319
+ assert(!child.is_enabled)
320
+ assert(!child.is_this_enabled)
321
+
322
+ child.enable
323
+ assert(child.is_enabled)
324
+ assert(child.is_this_enabled)
325
+ end
326
+
327
+ def test_find_window_by
328
+ window.set_id(Wx::ID_HIGHEST + 1)
329
+ window.set_name("name")
330
+ window.set_label("label")
331
+
332
+ assert_equal(window, Wx::Window.find_window_by_id(Wx::ID_HIGHEST + 1))
333
+ assert_equal(window, Wx::Window.find_window_by_name("name"))
334
+ assert_equal(window, Wx::Window.find_window_by_label("label"))
335
+
336
+ assert_equal(nil, Wx::Window.find_window_by_id(Wx::ID_HIGHEST + 3))
337
+ assert_equal(nil, Wx::Window.find_window_by_name("noname"))
338
+ assert_equal(nil, Wx::Window.find_window_by_label("nolabel"))
339
+ end
340
+ 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.rc.1
4
+ version: 0.9.0.pre.rc.2
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-06-30 00:00:00.000000000 Z
11
+ date: 2023-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -67,9 +67,17 @@ files:
67
67
  - INSTALL.md
68
68
  - LICENSE
69
69
  - README.md
70
+ - assets/hello_button-macos.png
71
+ - assets/hello_button-msw.png
70
72
  - assets/hello_button.png
73
+ - assets/hello_button_clicked-macos.png
74
+ - assets/hello_button_clicked-msw.png
71
75
  - assets/hello_button_clicked.png
76
+ - assets/hello_button_clicked_combi.png
77
+ - assets/hello_world-macos.png
78
+ - assets/hello_world-msw.png
72
79
  - assets/hello_world.png
80
+ - assets/hello_world_combi.png
73
81
  - assets/logo.png
74
82
  - assets/logo.svg
75
83
  - assets/logo.xcf
@@ -108,6 +116,7 @@ files:
108
116
  - lib/wx/core/artprovider.rb
109
117
  - lib/wx/core/bitmap.rb
110
118
  - lib/wx/core/bitmap_combobox.rb
119
+ - lib/wx/core/brush.rb
111
120
  - lib/wx/core/busycursor.rb
112
121
  - lib/wx/core/choice.rb
113
122
  - lib/wx/core/choicedlg.rb
@@ -152,6 +161,7 @@ files:
152
161
  - lib/wx/core/notebook.rb
153
162
  - lib/wx/core/object.rb
154
163
  - lib/wx/core/paintdc.rb
164
+ - lib/wx/core/pen.rb
155
165
  - lib/wx/core/pen_info.rb
156
166
  - lib/wx/core/platform_info.rb
157
167
  - lib/wx/core/point.rb
@@ -175,11 +185,13 @@ files:
175
185
  - lib/wx/core/window.rb
176
186
  - lib/wx/core/window_update_locker.rb
177
187
  - lib/wx/core/xmlresource.rb
188
+ - lib/wx/doc/app.rb
178
189
  - lib/wx/doc/array_ext.rb
179
190
  - lib/wx/doc/art_locator.rb
180
191
  - lib/wx/doc/aui/auimanager.rb
181
192
  - lib/wx/doc/aui/auinotebook.rb
182
193
  - lib/wx/doc/bitmap.rb
194
+ - lib/wx/doc/brush.rb
183
195
  - lib/wx/doc/busy_info.rb
184
196
  - lib/wx/doc/client_dc.rb
185
197
  - lib/wx/doc/clipboard.rb
@@ -207,12 +219,14 @@ files:
207
219
  - lib/wx/doc/extra/09_exceptions.md
208
220
  - lib/wx/doc/extra/10_art.md
209
221
  - lib/wx/doc/extra/11_drawing_and_dc.md
222
+ - lib/wx/doc/font.rb
210
223
  - lib/wx/doc/functions.rb
211
224
  - lib/wx/doc/gc_dc.rb
212
225
  - lib/wx/doc/gdi_common.rb
213
226
  - lib/wx/doc/gen/about_dialog_info.rb
214
227
  - lib/wx/doc/gen/accelerator.rb
215
228
  - lib/wx/doc/gen/accessible.rb
229
+ - lib/wx/doc/gen/activity_indicator.rb
216
230
  - lib/wx/doc/gen/animation.rb
217
231
  - lib/wx/doc/gen/animation_ctrl.rb
218
232
  - lib/wx/doc/gen/any_button.rb
@@ -356,6 +370,8 @@ files:
356
370
  - lib/wx/doc/gen/html/html_list_box.rb
357
371
  - lib/wx/doc/gen/html/html_printout.rb
358
372
  - lib/wx/doc/gen/html/html_window.rb
373
+ - lib/wx/doc/gen/hyperlink_ctrl.rb
374
+ - lib/wx/doc/gen/hyperlink_event.rb
359
375
  - lib/wx/doc/gen/icon.rb
360
376
  - lib/wx/doc/gen/icon_location.rb
361
377
  - lib/wx/doc/gen/image.rb
@@ -524,6 +540,7 @@ files:
524
540
  - lib/wx/doc/image.rb
525
541
  - lib/wx/doc/memory_dc.rb
526
542
  - lib/wx/doc/mirror_dc.rb
543
+ - lib/wx/doc/pen.rb
527
544
  - lib/wx/doc/pg/events.rb
528
545
  - lib/wx/doc/pg/pg_property.rb
529
546
  - lib/wx/doc/pg/pgeditor.rb
@@ -535,6 +552,7 @@ files:
535
552
  - lib/wx/doc/prt/print_dialog.rb
536
553
  - lib/wx/doc/prt/printer.rb
537
554
  - lib/wx/doc/prt/printer_dc.rb
555
+ - lib/wx/doc/radio_box.rb
538
556
  - lib/wx/doc/rbn/ribbon_bar.rb
539
557
  - lib/wx/doc/rbn/ribbon_button_bar.rb
540
558
  - lib/wx/doc/rbn/ribbon_gallery.rb
@@ -958,6 +976,8 @@ files:
958
976
  - tests/art/test_art/image/wxruby.jpg
959
977
  - tests/art/test_art/image/wxruby.png
960
978
  - tests/art/test_art/sample2.xpm
979
+ - tests/lib/item_container_tests.rb
980
+ - tests/lib/text_entry_tests.rb
961
981
  - tests/lib/wxapp_runner.rb
962
982
  - tests/lib/wxframe_runner.rb
963
983
  - tests/test_app_event_filter.rb
@@ -969,12 +989,15 @@ files:
969
989
  - tests/test_dialog.rb
970
990
  - tests/test_event_handling.rb
971
991
  - tests/test_events.rb
992
+ - tests/test_ext_controls.rb
993
+ - tests/test_font.rb
972
994
  - tests/test_gdi_object.rb
973
995
  - tests/test_geometry.rb
974
996
  - tests/test_intl.rb
975
997
  - tests/test_item_data.rb
976
998
  - tests/test_std_controls.rb
977
999
  - tests/test_variant.rb
1000
+ - tests/test_window.rb
978
1001
  - tests/testapp.rb
979
1002
  - tests/testapp_noframe.rb
980
1003
  homepage: https://github.com/mcorino/wxRuby3