wxruby3 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/ext/wxruby3/include/wxruby-runtime.h +3 -0
  3. data/ext/wxruby3/swig/common.i +22 -0
  4. data/ext/wxruby3/swig/custom/director.swg +296 -0
  5. data/ext/wxruby3/swig/custom/rubyapi.swg +19 -0
  6. data/ext/wxruby3/swig/custom/rubyerrors.swg +45 -0
  7. data/ext/wxruby3/swig/custom/rubyhead.swg +192 -0
  8. data/ext/wxruby3/swig/custom/rubyrun.swg +187 -0
  9. data/ext/wxruby3/swig/custom/swigrun.swg +363 -0
  10. data/ext/wxruby3/swig/custom/typemaps/swigtypemaps.swg +173 -0
  11. data/ext/wxruby3/swig/wx.i +50 -30
  12. data/lib/wx/core/const.rb +83 -0
  13. data/lib/wx/doc/const.rb +66 -66
  14. data/lib/wx/doc/event.rb +0 -6
  15. data/lib/wx/doc/functions.rb +9 -9
  16. data/lib/wx/doc/window.rb +5 -0
  17. data/lib/wx/keyword_defs.rb +43 -6
  18. data/lib/wx/version.rb +1 -1
  19. data/rakelib/lib/config/macosx.rb +1 -1
  20. data/rakelib/lib/core/include/funcall.inc +33 -14
  21. data/rakelib/lib/core/include/swigdirector.inc +384 -0
  22. data/rakelib/lib/core/include/swigrubyerrors.inc +161 -0
  23. data/{ext/wxruby3/swig/custom/swig4/rubyrun.swg → rakelib/lib/core/include/swigrubyrun.inc} +245 -120
  24. data/rakelib/lib/core/include/swigrun.inc +700 -0
  25. data/rakelib/lib/core/package.rb +5 -2
  26. data/rakelib/lib/core/parameter.rb +3 -0
  27. data/rakelib/lib/director/accelerator.rb +1 -1
  28. data/rakelib/lib/director/animation.rb +1 -1
  29. data/rakelib/lib/director/animation_ctrl.rb +20 -0
  30. data/rakelib/lib/director/app.rb +23 -5
  31. data/rakelib/lib/director/art_provider.rb +1 -1
  32. data/rakelib/lib/director/data_object_simple_base.rb +1 -2
  33. data/rakelib/lib/director/dialog.rb +5 -0
  34. data/rakelib/lib/director/dialup_event.rb +44 -0
  35. data/rakelib/lib/director/dialup_manager.rb +45 -0
  36. data/rakelib/lib/director/event.rb +20 -2
  37. data/rakelib/lib/director/file_ctrl.rb +35 -0
  38. data/rakelib/lib/director/file_ctrl_event.rb +26 -0
  39. data/rakelib/lib/director/gdicommon.rb +19 -1
  40. data/rakelib/lib/director/grid_cell_editor.rb +6 -6
  41. data/rakelib/lib/director/help_controller.rb +1 -1
  42. data/rakelib/lib/director/pgarray_editor_dialog.rb +0 -6
  43. data/rakelib/lib/director/pgeditor.rb +2 -2
  44. data/rakelib/lib/director/pgproperties.rb +2 -2
  45. data/rakelib/lib/director/richtext_buffer.rb +1 -1
  46. data/rakelib/lib/director/richtext_ctrl.rb +1 -1
  47. data/rakelib/lib/director/sash_event.rb +42 -0
  48. data/rakelib/lib/director/sizer.rb +64 -1
  49. data/rakelib/lib/director/sizer_item.rb +22 -0
  50. data/rakelib/lib/director/task_bar_icon.rb +1 -1
  51. data/rakelib/lib/director/tree_ctrl.rb +19 -44
  52. data/rakelib/lib/generate/doc/animation_ctrl.yaml +15 -0
  53. data/rakelib/lib/generate/doc/events.yaml +10 -4
  54. data/rakelib/lib/generate/doc/static_box.yaml +8 -0
  55. data/rakelib/lib/generate/doc/xml_resource.yaml +3 -0
  56. data/rakelib/lib/generate/doc.rb +14 -3
  57. data/rakelib/lib/generate/interface.rb +4 -3
  58. data/rakelib/lib/specs/interfaces.rb +5 -1
  59. data/rakelib/lib/swig_runner.rb +4 -50
  60. data/rakelib/lib/typemap/common.rb +24 -9
  61. data/rakelib/lib/typemap/data_format.rb +1 -1
  62. data/rakelib/lib/typemap/data_object_data.rb +2 -2
  63. data/rakelib/lib/typemap/pgprop_arg.rb +7 -2
  64. data/rakelib/lib/typemap/points_list.rb +5 -7
  65. data/rakelib/lib/util/string.rb +10 -8
  66. data/samples/text/richtext.rb +0 -30
  67. data/tests/test_app_exit_exception.rb +36 -0
  68. data/tests/test_app_init_exception.rb +20 -0
  69. data/tests/test_book_controls.rb +29 -0
  70. data/tests/test_exceptions.rb +41 -0
  71. data/tests/test_sizer.rb +43 -0
  72. data/tests/test_std_controls.rb +36 -0
  73. metadata +25 -4
  74. data/ext/wxruby3/swig/custom/swig3/rubyrun.swg +0 -456
@@ -0,0 +1,29 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ require_relative './lib/wxframe_runner'
6
+
7
+ class BookCtrlTests < WxRuby::Test::GUITests
8
+
9
+ def setup
10
+ super
11
+ @book = Wx::Choicebook.new(frame_win, name: 'ChoiceBook')
12
+ end
13
+
14
+ def cleanup
15
+ @book.destroy
16
+ super
17
+ GC.start
18
+ end
19
+
20
+ attr_reader :book
21
+
22
+ def test_control_sizer
23
+ btn = Wx::Button.new(book, Wx::ID_ANY, 'First')
24
+ # issue #199 : returning the control sizer should not cause it to be owned by Ruby
25
+ # because that would cause double deletes
26
+ book.get_control_sizer.add(btn, Wx::SizerFlags.new.expand.border(Wx::ALL))
27
+ end
28
+
29
+ end
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ require_relative './lib/wxframe_runner'
6
+
7
+ class DirectorExceptionTests < WxRuby::Test::GUITests
8
+
9
+ class InvalidOutputSizer < Wx::BoxSizer
10
+
11
+ def calc_min
12
+ Wx::Point.new(1,1) # expects Wx::Size
13
+ end
14
+
15
+ end
16
+
17
+ def test_invalid_output
18
+ szr = InvalidOutputSizer.new(Wx::Orientation::VERTICAL)
19
+ szr.add(Wx::Button.new(frame_win, name: 'button'), Wx::Direction::TOP)
20
+ frame_win.sizer = szr
21
+ assert_raise_kind_of(TypeError) { frame_win.layout }
22
+ frame_win.sizer = nil
23
+ end
24
+
25
+ class ExceptionSizer < Wx::BoxSizer
26
+
27
+ def calc_min
28
+ raise RuntimeError, 'AnyThing'
29
+ end
30
+
31
+ end
32
+
33
+ def test_exception_in_overload
34
+ szr = ExceptionSizer.new(Wx::Orientation::VERTICAL)
35
+ szr.add(Wx::Button.new(frame_win, name: 'button'), Wx::Direction::TOP)
36
+ frame_win.sizer = szr
37
+ assert_raise_kind_of(RuntimeError) { frame_win.layout }
38
+ frame_win.sizer = nil
39
+ end
40
+
41
+ end
@@ -0,0 +1,43 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ require_relative './lib/wxframe_runner'
6
+
7
+ class SizerTests < WxRuby::Test::GUITests
8
+
9
+ def setup
10
+ super
11
+ frame_win.set_sizer(Wx::VBoxSizer.new)
12
+ end
13
+
14
+ def cleanup
15
+ super
16
+ GC.start
17
+ end
18
+
19
+ def test_detach
20
+ frame_win.get_sizer.add(Wx::HBoxSizer.new)
21
+ frame_win.get_sizer.add_spacer(5)
22
+ # detaches HBoxSizer transferring ownership to Ruby; should not cause segfaults at GC
23
+ frame_win.get_sizer.detach(0)
24
+ end
25
+
26
+ def test_sizer_item_detach_and_re_attach
27
+ frame_win.get_sizer.add(Wx::HBoxSizer.new)
28
+ frame_win.get_sizer.add_spacer(5)
29
+ # get and detach
30
+ szr_itm = frame_win.get_sizer.get_item(0)
31
+ assert_not_nil(szr_itm)
32
+ assert_true(szr_itm.is_sizer)
33
+ szr = szr_itm.get_sizer
34
+ assert_not_nil(szr)
35
+ szr_itm.detach_sizer
36
+ assert_nil(szr_itm.get_sizer)
37
+ # remove sizer item
38
+ assert_true(frame_win.get_sizer.remove(0))
39
+ # re-attach detached sizer (should not cause segfaults at close due to incorrect ownership transfers)
40
+ assert_not_nil(frame_win.get_sizer.prepend(szr))
41
+ end
42
+
43
+ end
@@ -439,3 +439,39 @@ class GaugeTests < WxRuby::Test::GUITests
439
439
  assert_equal(100, gauge.value)
440
440
  end
441
441
  end
442
+
443
+ class StaticBoxTests < WxRuby::Test::GUITests
444
+
445
+ def setup
446
+ super
447
+ @box = nil
448
+ end
449
+
450
+ def cleanup
451
+ @box.destroy if @box
452
+ super
453
+ end
454
+
455
+ attr_reader :box
456
+
457
+ def test_basic
458
+ @box = Wx::StaticBox.new(frame_win, label: 'Box')
459
+
460
+ txt = Wx::StaticText.new(box, Wx::ID_ANY, "This window is a child of the staticbox")
461
+ assert_equal(box, txt.parent)
462
+ end
463
+
464
+ unless Wx::PLATFORM == 'WXOSX'
465
+
466
+ def test_label_window
467
+ check = Wx::CheckBox.new(frame_win, Wx::ID_ANY, 'Enable')
468
+ @box = Wx::StaticBox.new(frame_win, label: check)
469
+
470
+ button = Wx::Button.new(box, label: 'Button')
471
+ box.enable(false)
472
+ assert_false(button.is_enabled)
473
+ end
474
+
475
+ end
476
+
477
+ 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
4
+ version: 0.9.1
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-10-15 00:00:00.000000000 Z
11
+ date: 2023-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -102,10 +102,15 @@ files:
102
102
  - ext/wxruby3/include/wxruby-runtime.h
103
103
  - ext/wxruby3/swig/RubyStockObjects.i
104
104
  - ext/wxruby3/swig/common.i
105
+ - ext/wxruby3/swig/custom/director.swg
106
+ - ext/wxruby3/swig/custom/rubyapi.swg
107
+ - ext/wxruby3/swig/custom/rubyerrors.swg
108
+ - ext/wxruby3/swig/custom/rubyhead.swg
105
109
  - ext/wxruby3/swig/custom/rubyprimtypes.swg
110
+ - ext/wxruby3/swig/custom/rubyrun.swg
106
111
  - ext/wxruby3/swig/custom/rubytracking.swg
107
- - ext/wxruby3/swig/custom/swig3/rubyrun.swg
108
- - ext/wxruby3/swig/custom/swig4/rubyrun.swg
112
+ - ext/wxruby3/swig/custom/swigrun.swg
113
+ - ext/wxruby3/swig/custom/typemaps/swigtypemaps.swg
109
114
  - ext/wxruby3/swig/mark_free_impl.i
110
115
  - ext/wxruby3/swig/memory_management.i
111
116
  - ext/wxruby3/swig/typedefs.i
@@ -139,6 +144,7 @@ files:
139
144
  - lib/wx/core/combo_ctrl.rb
140
145
  - lib/wx/core/combobox.rb
141
146
  - lib/wx/core/config.rb
147
+ - lib/wx/core/const.rb
142
148
  - lib/wx/core/controlwithitems.rb
143
149
  - lib/wx/core/cursor.rb
144
150
  - lib/wx/core/data_object.rb
@@ -365,6 +371,10 @@ files:
365
371
  - rakelib/lib/core/include/enum.inc
366
372
  - rakelib/lib/core/include/funcall.inc
367
373
  - rakelib/lib/core/include/init.inc
374
+ - rakelib/lib/core/include/swigdirector.inc
375
+ - rakelib/lib/core/include/swigrubyerrors.inc
376
+ - rakelib/lib/core/include/swigrubyrun.inc
377
+ - rakelib/lib/core/include/swigrun.inc
368
378
  - rakelib/lib/core/mapping.rb
369
379
  - rakelib/lib/core/package.rb
370
380
  - rakelib/lib/core/parameter.rb
@@ -428,6 +438,8 @@ files:
428
438
  - rakelib/lib/director/defs.rb
429
439
  - rakelib/lib/director/derived_dc.rb
430
440
  - rakelib/lib/director/dialog.rb
441
+ - rakelib/lib/director/dialup_event.rb
442
+ - rakelib/lib/director/dialup_manager.rb
431
443
  - rakelib/lib/director/dir_filterlist_ctrl.rb
432
444
  - rakelib/lib/director/dir_picker_ctrl.rb
433
445
  - rakelib/lib/director/drag_image.rb
@@ -439,6 +451,8 @@ files:
439
451
  - rakelib/lib/director/event_handler.rb
440
452
  - rakelib/lib/director/event_loop.rb
441
453
  - rakelib/lib/director/events.rb
454
+ - rakelib/lib/director/file_ctrl.rb
455
+ - rakelib/lib/director/file_ctrl_event.rb
442
456
  - rakelib/lib/director/file_dialog_custom_control.rb
443
457
  - rakelib/lib/director/file_dialog_customize_hook.rb
444
458
  - rakelib/lib/director/file_picker_ctrl.rb
@@ -549,6 +563,7 @@ files:
549
563
  - rakelib/lib/director/richtext_printing.rb
550
564
  - rakelib/lib/director/richtext_style_listbox.rb
551
565
  - rakelib/lib/director/richtext_style_organiser_dialog.rb
566
+ - rakelib/lib/director/sash_event.rb
552
567
  - rakelib/lib/director/sash_layout_event.rb
553
568
  - rakelib/lib/director/sash_layout_window.rb
554
569
  - rakelib/lib/director/sash_window.rb
@@ -606,6 +621,7 @@ files:
606
621
  - rakelib/lib/generate/doc.rb
607
622
  - rakelib/lib/generate/doc/about_dialog_info.yaml
608
623
  - rakelib/lib/generate/doc/accelerator.yaml
624
+ - rakelib/lib/generate/doc/animation_ctrl.yaml
609
625
  - rakelib/lib/generate/doc/art_provider.yaml
610
626
  - rakelib/lib/generate/doc/aui_manager.yaml
611
627
  - rakelib/lib/generate/doc/bitmap.yaml
@@ -1070,11 +1086,14 @@ files:
1070
1086
  - tests/lib/wxapp_runner.rb
1071
1087
  - tests/lib/wxframe_runner.rb
1072
1088
  - tests/test_app_event_filter.rb
1089
+ - tests/test_app_exit_exception.rb
1090
+ - tests/test_app_init_exception.rb
1073
1091
  - tests/test_app_traits.rb
1074
1092
  - tests/test_art.rb
1075
1093
  - tests/test_art_provider.rb
1076
1094
  - tests/test_aui.rb
1077
1095
  - tests/test_basic.rb
1096
+ - tests/test_book_controls.rb
1078
1097
  - tests/test_box_sizer.rb
1079
1098
  - tests/test_clipboard.rb
1080
1099
  - tests/test_config.rb
@@ -1082,6 +1101,7 @@ files:
1082
1101
  - tests/test_dialog.rb
1083
1102
  - tests/test_event_handling.rb
1084
1103
  - tests/test_events.rb
1104
+ - tests/test_exceptions.rb
1085
1105
  - tests/test_ext_controls.rb
1086
1106
  - tests/test_file_dialog.rb
1087
1107
  - tests/test_font.rb
@@ -1094,6 +1114,7 @@ files:
1094
1114
  - tests/test_log.rb
1095
1115
  - tests/test_proof_check.rb
1096
1116
  - tests/test_richtext.rb
1117
+ - tests/test_sizer.rb
1097
1118
  - tests/test_std_controls.rb
1098
1119
  - tests/test_timer.rb
1099
1120
  - tests/test_variant.rb