wxruby3 0.9.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +183 -42
  3. data/README.md +40 -48
  4. data/ext/mkrf_conf_ext.rb +72 -0
  5. data/lib/wx/core/app.rb +16 -0
  6. data/lib/wx/core/colour.rb +36 -28
  7. data/lib/wx/core/const.rb +19 -0
  8. data/lib/wx/core/enum.rb +17 -1
  9. data/lib/wx/core/geometry.rb +121 -0
  10. data/lib/wx/core/graphics_pen_info.rb +18 -0
  11. data/lib/wx/core/image.rb +49 -0
  12. data/lib/wx/core/menu_bar.rb +11 -0
  13. data/lib/wx/core/paintdc.rb +9 -3
  14. data/lib/wx/core/secret_store.rb +38 -0
  15. data/lib/wx/doc/app.rb +97 -41
  16. data/lib/wx/doc/bitmap.rb +4 -0
  17. data/lib/wx/doc/client_dc.rb +2 -2
  18. data/lib/wx/doc/clipboard.rb +1 -1
  19. data/lib/wx/doc/colour.rb +12 -0
  20. data/lib/wx/doc/const.rb +16 -0
  21. data/lib/wx/doc/cursor.rb +4 -0
  22. data/lib/wx/doc/dc_overlay.rb +34 -0
  23. data/lib/wx/doc/enum.rb +7 -1
  24. data/lib/wx/doc/event_blocker.rb +1 -1
  25. data/lib/wx/doc/evthandler.rb +25 -3
  26. data/lib/wx/doc/functions.rb +3 -6
  27. data/lib/wx/doc/gc_dc.rb +13 -4
  28. data/lib/wx/doc/geometry.rb +136 -0
  29. data/lib/wx/doc/graphics_context.rb +25 -7
  30. data/lib/wx/doc/icon.rb +4 -0
  31. data/lib/wx/doc/image.rb +56 -0
  32. data/lib/wx/doc/list_ctrl.rb +6 -6
  33. data/lib/wx/doc/memory_dc.rb +2 -11
  34. data/lib/wx/doc/mirror_dc.rb +1 -1
  35. data/lib/wx/doc/pen.rb +26 -0
  36. data/lib/wx/doc/persistence_manager.rb +1 -1
  37. data/lib/wx/doc/persistent_object.rb +1 -1
  38. data/lib/wx/doc/pg/property_grid_interface.rb +3 -3
  39. data/lib/wx/doc/prt/printer_dc.rb +2 -2
  40. data/lib/wx/doc/region_iterator.rb +1 -1
  41. data/lib/wx/doc/scaled_dc.rb +1 -1
  42. data/lib/wx/doc/screen_dc.rb +1 -1
  43. data/lib/wx/doc/secret_store.rb +55 -0
  44. data/lib/wx/doc/svg_file_dc.rb +1 -1
  45. data/lib/wx/doc/textctrl.rb +1 -1
  46. data/lib/wx/doc/tree_ctrl.rb +2 -2
  47. data/lib/wx/doc/validator.rb +6 -6
  48. data/lib/wx/doc/variant.rb +2 -2
  49. data/lib/wx/doc/window.rb +5 -4
  50. data/lib/wx/grid/keyword_defs.rb +1 -1
  51. data/lib/wx/html/keyword_defs.rb +3 -3
  52. data/lib/wx/keyword_defs.rb +76 -71
  53. data/lib/wx/pg/keyword_defs.rb +2 -2
  54. data/lib/wx/pg/pg_property.rb +12 -0
  55. data/lib/wx/rbn/keyword_defs.rb +1 -1
  56. data/lib/wx/rtc/keyword_defs.rb +1 -1
  57. data/lib/wx/stc/keyword_defs.rb +1 -1
  58. data/lib/wx/version.rb +1 -1
  59. data/lib/wx/wxruby/base.rb +3 -5
  60. data/lib/wx/wxruby/cmd/check.rb +182 -0
  61. data/lib/wx/wxruby/cmd/sampler.rb +1 -1
  62. data/lib/wx/wxruby/cmd/setup.rb +9 -3
  63. data/lib/wx/wxruby/cmd/test.rb +1 -1
  64. data/rakelib/configure.rb +67 -52
  65. data/rakelib/gem.rake +97 -66
  66. data/rakelib/gem.rb +294 -41
  67. data/rakelib/install.rb +3 -3
  68. data/rakelib/lib/config/{cygwin.rb → freebsd.rb} +1 -1
  69. data/rakelib/lib/config/linux.rb +4 -2
  70. data/rakelib/lib/config/macosx.rb +42 -11
  71. data/rakelib/lib/config/mingw.rb +2 -2
  72. data/rakelib/lib/config/pkgman/{base.rb → linux.rb} +36 -61
  73. data/rakelib/lib/config/pkgman/macosx.rb +17 -78
  74. data/rakelib/lib/config/unixish.rb +17 -8
  75. data/rakelib/lib/config/{netbsd.rb → unknown.rb} +3 -2
  76. data/rakelib/lib/config.rb +74 -33
  77. data/rakelib/lib/core/include/enum.inc +31 -1
  78. data/rakelib/lib/director/affine_matrix.rb +51 -0
  79. data/rakelib/lib/director/app.rb +29 -13
  80. data/rakelib/lib/director/art_provider.rb +4 -0
  81. data/rakelib/lib/director/aui_manager.rb +1 -1
  82. data/rakelib/lib/director/cursor.rb +6 -2
  83. data/rakelib/lib/director/dc.rb +1 -6
  84. data/rakelib/lib/director/derived_dc.rb +88 -31
  85. data/rakelib/lib/director/geometry.rb +142 -0
  86. data/rakelib/lib/director/graphics_context.rb +3 -2
  87. data/rakelib/lib/director/graphics_object.rb +18 -25
  88. data/rakelib/lib/director/grid_ctrl.rb +2 -2
  89. data/rakelib/lib/director/image.rb +59 -0
  90. data/rakelib/lib/director/menu.rb +2 -3
  91. data/rakelib/lib/director/menu_bar.rb +0 -3
  92. data/rakelib/lib/director/pen.rb +1 -1
  93. data/rakelib/lib/director/richtext_composite_object.rb +2 -4
  94. data/rakelib/lib/director/richtext_ctrl.rb +1 -1
  95. data/rakelib/lib/director/secret_store.rb +117 -0
  96. data/rakelib/lib/director/system_settings.rb +1 -1
  97. data/rakelib/lib/director/tree_event.rb +2 -2
  98. data/rakelib/lib/director/window.rb +4 -3
  99. data/rakelib/lib/extractor/function.rb +1 -1
  100. data/rakelib/lib/generate/doc/animation_ctrl.yaml +10 -0
  101. data/rakelib/lib/generate/doc/banner_window.yaml +35 -0
  102. data/rakelib/lib/generate/doc/graphics_context.yaml +12 -0
  103. data/rakelib/lib/generate/doc/graphics_object.yaml +12 -0
  104. data/rakelib/lib/generate/doc/grid_ctrl.yaml +25 -0
  105. data/rakelib/lib/generate/doc/header_ctrl.yaml +91 -0
  106. data/rakelib/lib/generate/doc/icon.yaml +10 -0
  107. data/rakelib/lib/generate/doc/info_bar.yaml +27 -0
  108. data/rakelib/lib/generate/doc/log.yaml +1 -1
  109. data/rakelib/lib/generate/doc/media_ctrl.yaml +27 -0
  110. data/rakelib/lib/generate/doc/persistent_window.yaml +22 -0
  111. data/rakelib/lib/generate/doc/pg_editor.yaml +1 -1
  112. data/rakelib/lib/generate/doc/pg_property.yaml +4 -4
  113. data/rakelib/lib/generate/doc/rearrange_list.yaml +14 -0
  114. data/rakelib/lib/generate/doc/ribbon_panel.yaml +15 -0
  115. data/rakelib/lib/generate/doc/rich_text_formatting_dialog.yaml +26 -0
  116. data/rakelib/lib/generate/doc/secret_store.yaml +55 -0
  117. data/rakelib/lib/generate/doc/text_ctrl.yaml +1 -1
  118. data/rakelib/lib/generate/doc/wizard.yaml +27 -0
  119. data/rakelib/lib/generate/doc.rb +5 -5
  120. data/rakelib/lib/generate/interface.rb +1 -1
  121. data/rakelib/lib/specs/interfaces.rb +4 -0
  122. data/rakelib/lib/swig_runner.rb +24 -3
  123. data/rakelib/lib/typemap/common.rb +10 -0
  124. data/rakelib/lib/typemap/points_list.rb +8 -2
  125. data/rakelib/lib/typemap/richtext.rb +17 -0
  126. data/rakelib/prepost.rake +8 -1
  127. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +4 -0
  128. data/rakelib/yard/templates/default/fulldoc/html/setup.rb +3 -3
  129. data/samples/dialogs/wizard.rb +20 -19
  130. data/samples/drawing/art/drawing/image.bmp +0 -0
  131. data/samples/drawing/art/drawing/mask.bmp +0 -0
  132. data/samples/drawing/art/drawing/pat35.bmp +0 -0
  133. data/samples/drawing/art/drawing/pat36.bmp +0 -0
  134. data/samples/drawing/art/drawing/pat4.bmp +0 -0
  135. data/samples/drawing/art/drawing/smile.xpm +42 -0
  136. data/samples/drawing/drawing.rb +2276 -0
  137. data/samples/drawing/tn_drawing.png +0 -0
  138. data/samples/html/html.rb +1 -1
  139. data/samples/propgrid/propgrid.rb +1 -1
  140. data/samples/propgrid/propgrid_minimal.rb +1 -1
  141. data/samples/propgrid/sample_props.rb +1 -1
  142. data/samples/sampler/editor.rb +13 -11
  143. data/samples/sampler/sample.rb +2 -0
  144. data/samples/sampler.rb +14 -10
  145. data/samples/text/richtext.rb +53 -0
  146. data/samples/text/scintilla.rb +1 -1
  147. data/samples/text/unicode.rb +4 -4
  148. data/tests/lib/wxapp_runner.rb +1 -1
  149. data/tests/test_config.rb +7 -4
  150. data/tests/test_ext_controls.rb +12 -5
  151. data/tests/test_secret_store.rb +83 -0
  152. data/tests/test_std_controls.rb +12 -12
  153. metadata +66 -47
  154. data/lib/wx/doc/extra/00_starting.md +0 -154
  155. data/lib/wx/doc/extra/01_packages.md +0 -180
  156. data/lib/wx/doc/extra/02_lifecycles.md +0 -166
  157. data/lib/wx/doc/extra/03_dialogs.md +0 -57
  158. data/lib/wx/doc/extra/04_enums.md +0 -143
  159. data/lib/wx/doc/extra/05_event-handling.md +0 -191
  160. data/lib/wx/doc/extra/06_geometry.md +0 -62
  161. data/lib/wx/doc/extra/07_colour_and_font.md +0 -52
  162. data/lib/wx/doc/extra/08_extensions.md +0 -144
  163. data/lib/wx/doc/extra/09_exceptions.md +0 -54
  164. data/lib/wx/doc/extra/10_art.md +0 -111
  165. data/lib/wx/doc/extra/11_drawing_and_dc.md +0 -62
  166. data/lib/wx/doc/extra/12_client_data.md +0 -89
  167. data/lib/wx/doc/extra/13_validators.md +0 -139
  168. data/lib/wx/doc/extra/14_config.md +0 -101
  169. data/lib/wx/doc/extra/15_persistence.md +0 -148
  170. data/rakefile +0 -14
  171. data/rakelib/lib/config/pkgman/arch.rb +0 -53
  172. data/rakelib/lib/config/pkgman/debian.rb +0 -66
  173. data/rakelib/lib/config/pkgman/rhel.rb +0 -54
  174. data/rakelib/lib/config/pkgman/suse.rb +0 -54
  175. data/samples/sampler/back.xpm +0 -21
  176. data/samples/sampler/copy.xpm +0 -44
  177. data/samples/sampler/cut.xpm +0 -46
  178. data/samples/sampler/filesave.xpm +0 -42
  179. data/samples/sampler/find.xpm +0 -62
  180. data/samples/sampler/findrepl.xpm +0 -63
  181. data/samples/sampler/forward.xpm +0 -21
  182. data/samples/sampler/paste.xpm +0 -46
  183. data/samples/sampler/redo.xpm +0 -58
  184. data/samples/sampler/undo.xpm +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d5a9a4c753ce46aa02eddc50cd51d51928a7e00b25172d2eae30ad4a2a87547
4
- data.tar.gz: 36e5955935cf757e5aca26cf2df1b0ef3821e1c9a353508149ef4e0d95e2caa3
3
+ metadata.gz: 22f63fb730a7c17f84eac51d892cad2f35ef33211d88fafde508fe7c222712e6
4
+ data.tar.gz: 2cf9e0b4026e8c00b24873e77af5f4d5676e5af3181e6459104b5c6fef0675d1
5
5
  SHA512:
6
- metadata.gz: fbf51eea1ad3411d80f3f01c8d08f601b04096e3cd36dae6eb29d073157b87dd430cda87a73b89430d5fddc64a8b43ba29e3e45f28a201b180b0bd87ead3ccad
7
- data.tar.gz: ddd00e990557c587970ff0326eed3e61376ef74de243e7a1795cb7238d3aba06a2da15e4caa8b5438c6c34931ded3b486dbaea955e79cbf91b803013d732b4b4
6
+ metadata.gz: 48cce7a08e4f4bd15380178cab3ab38b53af6942d5054af617806d5b01bea0aabc26887ec26fc07a6bb6c2d9802ec512d59396a2361c88a12635ebf80b066d91
7
+ data.tar.gz: eba7856af27dcfe0e4eb50662bae9bb00af12f29258e0eb4b2d446c3351446651926e2e5c0eec017038fef2545671e8ac47faea0f75c1bb3efd54c751585ae08
data/INSTALL.md CHANGED
@@ -8,25 +8,26 @@
8
8
 
9
9
  The wxRuby3 gem provides a **worry-free** installation for all supported platforms.
10
10
 
11
- The default gem installation commands
11
+ The default gem installation command
12
+
12
13
  ```shell
13
14
  gem install wxruby3
14
15
  ```
15
16
 
16
- for Windows and
17
+ and the setup command
17
18
 
18
19
  ```shell
19
- gem install wxruby3 && wxruby setup
20
+ wxruby setup
20
21
  ```
21
- for Linux and MacOSX (see Note below) and Windows (if installing for Ruby releases older than the latest stable release)
22
- should always result in a successfully installed wxRuby3 version.<br>
23
- Just follow the (very few and in some cases none) prompts at the start of the setup procedure and sit back and relax.
22
+
23
+ for installations without prebuilt binary packages should always result in a successfully installed wxRuby3 version.
24
24
 
25
25
  > **NOTE**<br>
26
26
  > Currently installing the wxRuby3 gem for the system supplied Ruby on MacOSX systems does not work.<br>
27
27
  > The user is therefor required to install a Ruby interpreter using either [MacPorts](https://www.macports.org/) (both
28
28
  > privileged and user installations are supported) or [Homebrew](https://brew.sh/) or Ruby installers/version managers
29
- > like [ruby-install](https://github.com/postmodern/ruby-install) or [RVM](https://rvm.io) (only user installations supported) .
29
+ > like [ruby-install](https://github.com/postmodern/ruby-install) or [RVM](https://rvm.io) (only user installations
30
+ > supported) .
30
31
 
31
32
  [Below](INSTALL.md#installing-software-requirements) more details regarding the software requirements for wxRuby3, the
32
33
  setup procedure and various options to tweak and customize the installation (including platform specific details for
@@ -36,16 +37,65 @@ Linux, Windows and MacOSX) are described.
36
37
 
37
38
  Installing the wxRuby3 gem will also install the bundled `wxruby` CLI binary.
38
39
 
39
- For source gem installations the CLI will initially only provide the *setup* command.
40
+ For source gem installations the CLI will initially only provide the `check` and `setup` commands.
40
41
 
41
- For binary gem installations and successfully set up source gem installations the *setup* command is replaced by other
42
+ For finalized installations (either from binary packages or source builds) the *setup* command is replaced by other
42
43
  utility commands providing the ability to run the bundled regression tests and access (run or copy) the bundled examples.<br>
43
44
  Run the following command to see the available options at any time:
44
45
 
45
46
  ```shell
46
- wxruby --help
47
+ wxruby -h
47
48
  ```
48
49
 
50
+ ## Binary packages
51
+
52
+ The wxRuby3 gem installation process will by default attempt to match the current platform to any standard available
53
+ binary packages and if found install the matched package.
54
+
55
+ Binary packages are archives (custom format) containing prebuilt (extension) library artifacts for a single specific
56
+ platform. Any such platform is identified by:
57
+
58
+ - CPU architecture (x86_64, ARM64, etc.)
59
+ - Operating system type (linux, darwin, windows, etc.)
60
+ - OS distribution and release number (except for windows)
61
+ - Ruby ABI version (i.e. {major}.{minor})
62
+
63
+ The standard available binary packages provide both the wxRuby3 extension libraries as well as the embedded wxWidgets
64
+ libraries the extension libraries were built for.<br>
65
+ This is however not mandatory. User created binary packages can be built for separately installed (either distribution
66
+ or user provided) wxWidgets libraries.
67
+
68
+ ### Standard packages
69
+
70
+ The standard release artifacts at [Github](https://github.com/mcorino/wxRuby3/releases) provide a selection of binary
71
+ packages for all supported OS platforms which are automatically built and uploaded for every release.<br>
72
+ The following tables lists the packages provided by the current wxRuby3 release process:
73
+
74
+ | OS | Distributions | Architectures | Rubies |
75
+ |---------|-------------------------------|-------------------------|----------------------------------------------------|
76
+ | Linux | OpenSuSE Leap (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
77
+ | Linux | Fedora (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
78
+ | Linux | Debian (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
79
+ | Linux | Ubuntu (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
80
+ | Windows | NA | x86_64 | Latest stable Ruby |
81
+ | OSX | MacOSX 12 | x86_64 <b>and</b> ARM64 | Latest stable Ruby |
82
+ | OSX | MacOSX 13 | x86_64 <b>and</b> ARM64 | Latest stable Ruby |
83
+ | OSX | MacOSX 14 | ARM64 | Latest stable Ruby |
84
+
85
+ ### User created packages
86
+
87
+ Users can create their own wxRuby3 binary packages by building from source ([see here](#building-from-source)) and after
88
+ successfully having built the wxWidgets extension libraries execute the `rake binpkg` command.<br>
89
+ This creates two files in the `pkg` folder with names like<br>
90
+ `wxruby3_{distribution}_ruby{abi version}_v{wxruby version}_{os}_{arch}.pkg`<br>
91
+ and<br>
92
+ `wxruby3_{distribution}_ruby{abi version}_v{wxruby version}_{os}_{arch}.sha`<br>
93
+ where the `.pkg` file is the actual binary archive and the `.sha` file is the associated SHA256 digest signature of the
94
+ archive contents.
95
+
96
+ Both files are required for installation and should be located at the same path (either local path or http(s) url).<br>
97
+ [See here](#the-package-option) for information on how to use user created binary packages with the wxRuby3 gem installation process.
98
+
49
99
  ## Software requirements for wxRuby3
50
100
 
51
101
  The software requirements for setting up a wxRuby3 runtime environment are:
@@ -90,63 +140,129 @@ wxRuby3 can be built and installed for 3 different types of wxWidgets installati
90
140
  In this case the libraries and development files are most likely not found in standard locations and the wxRuby3
91
141
  installation procedure will require specific options to have these locations provided.
92
142
  3. An 'embedded' installation of wxWidgets setup by the wxRuby3 installation procedure.<br>
93
- This is the default when the installation procedure does not detect a (compatible!) system installation or if an
94
- option has been provided explicitly specifying to install an embedded wxWidgets version.
143
+ This is the default when using a standard binary package or when installing from source and the setup procedure does
144
+ not detect a (compatible!) system installation or if an option has been provided explicitly specifying to install an
145
+ embedded wxWidgets version.
95
146
 
96
147
  Please note that in case of option **2** the user is responsible to make sure the wxWidgets shared libraries can be
97
148
  found by the system's dynamic loader at runtime.
98
149
 
99
- As described with option **3** a wxWidgets system installation must be compatible (>= version 3.2) to be selected. In case
100
- the installed version does not meet this requirement it is ignored as if not installed.
150
+ As described with option **3** a wxWidgets system installation must be compatible (>= version 3.2) to be selected for
151
+ source installation. In case the installed version does not meet this requirement it is ignored as if not installed.
101
152
 
102
153
  For more information on how to install wxWidgets see the [Installing software requirements](INSTALL.md#installing-software-requirements) section below.
103
154
 
104
155
  ## wxRuby3 gem installation details
105
156
 
106
- The wxRuby3 project provides gems on [RubyGems](https://rubygems.org) which can be installed with the
157
+ The wxRuby3 project provides a gem on [RubyGems](https://rubygems.org) which can be installed with the
107
158
  standard `gem install` command line this:
108
159
 
109
160
  ```shell
110
161
  gem install wxruby3
111
162
  ```
112
163
 
113
- On Linux and MacOSX systems this will install the source based gem which will require a follow-up command to build the native wxruby3 extension
114
- for the platform on which wxRuby3 is being installed.<br>
115
- On Windows systems a prebuilt binary gem is available for the latest stable release(s) of [RubyInstaller](https://rubyinstaller.org)
116
- installed rubies that will be installed by default if installing for that platform (including an embedded, latest
117
- stable version, wxWidgets installation).<br>
118
- Alternatively the source gem can be installed on Windows by installing with an explicit platform specification like this:
164
+ Alternatively the gem can be downloaded from the [Github release assets](https://github.com/mcorino/wxRuby3/releases) and
165
+ stored locally. This local gem can than be installed like this:
119
166
 
120
167
  ```shell
121
- gem install wxruby3 --platform=ruby
168
+ gem install /path/to/local/wxruby3.gem
122
169
  ```
123
170
 
124
- > The result of installing the gem on a Linux platform should be something like this:
171
+ This default installation command will allow the wxRuby3 installation process to scan available standard binary packages
172
+ ([see here](#standard-packages)) for a match to the platform being installed on and install any matched package or revert
173
+ to a source install if none matched.<br>
174
+ This command will therefor succeed if:
175
+ - a matching binary package could be successfully downloaded and installed;
176
+ - the installation reverted to source install.
177
+
178
+ This command only fails when:
179
+ - a matching digest signature for the downloaded binary package could not be downloaded;
180
+ - the digest signature did not match the downloaded package contents.
181
+
182
+ > The result of successfully installing the gem on a Linux platform should be something like this:
125
183
  > ```
126
184
  > $ gem install wxruby3
185
+ > Building native extensions. This could take a while...
127
186
  >
128
- > The wxRuby3 Gem has been successfully installed.
129
- > Before being able to use wxRuby3 you need to run the post-install setup process
130
- > by executing the command 'wxruby setup'.
187
+ > The wxRuby3 Gem has been successfully installed including the 'wxruby' utility.
131
188
  >
132
- > Run 'wxruby setup -h' to see information on the available commandline options.
133
- >
134
- > Successfully installed wxruby3-0.9.5
135
- > Parsing documentation for wxruby3-0.9.5
136
- > Installing ri documentation for wxruby3-0.9.5
137
- > Done installing documentation for wxruby3 after 10 seconds
189
+ > In case no suitable binary release package was available for your platform you
190
+ > will need to run the post-install setup process by executing:
191
+ >
192
+ > $ wxruby setup
193
+ >
194
+ > To check whether wxRuby3 is ready to run or not you can at any time execute the
195
+ > following command:
196
+ >
197
+ > $ wxruby check
198
+ >
199
+ > Run 'wxruby check -h' for more information.
200
+ >
201
+ > When the wxRuby3 setup has been fully completed you can start using wxRuby3.
202
+ >
203
+ > You can run the regression tests to verify the installation by executing:
204
+ >
205
+ > $ wxruby test
206
+ >
207
+ > The wxRuby3 sample explorer can be run by executing:
208
+ >
209
+ > $ wxruby sampler
210
+ >
211
+ > Have fun using wxRuby3.
212
+ >
213
+ > Run 'wxruby -h' to see information on the available commands.
214
+ >
215
+ > Successfully installed wxruby3-0.9.8
216
+ > Parsing documentation for wxruby3-0.9.8
217
+ > Installing ri documentation for wxruby3-0.9.8
218
+ > Done installing documentation for wxruby3 after 2 seconds
138
219
  > 1 gem installed
139
220
  > ```
140
221
 
141
- As said, on Linux and MacOSX systems (also on Windows when installing the source gem) an additional command is required
142
- to build the actual wxRuby3 extension libraries for the platform which is a wxRuby3 CLI command installed by the gem:
222
+ ### Gem installation options
223
+
224
+ Two options are available to control the wxRuby3 gem installation process.
225
+
226
+ #### The `prebuilt` option
227
+
228
+ The `prebuilt=none|only` option can be used to either prevent binary package matching and installation (`prebuilt=none`)
229
+ or make binary package installation mandatory (`prebuilt=only`).
230
+
231
+ The following command therefor forces a wxRuby3 source installation and will never fail:
232
+
233
+ ```shell
234
+ gem install wxruby3 -- prebuilt=none
235
+ ```
236
+
237
+ And the following command will force binary package installation and fails if no matching package could be installed:
238
+
239
+ ```shell
240
+ gem install wxruby3 -- prebuilt=only
241
+ ```
242
+
243
+ #### The `package` option
244
+
245
+ The `package=URL` option can be used to explicitly specify a binary package to install. This option implies `prebuilt=only`.
246
+ No package matching will be performed so mismatched binary packages will cause wxRuby3 to fail after installation.<br>
247
+ The `URL` can be specified as:
248
+ - an <b>absolute</b> local path like `/path/to/binary/package.pkg`
249
+ - an absolute `file://` URI like `file:///path/to/binary/package.pkg`
250
+ - an `http://` or `https://` URL
251
+
252
+ In all cases the associated `.sha` file <b>must</b> be located at the same path as the package file itself. If not the
253
+ installation will fail as well as when the signature does not match the digest of the package contents.
254
+
255
+ ### Gem source setup
256
+
257
+ As said a gem-based source installation requires an additional command is to build the actual wxRuby3 extension libraries
258
+ for the platform installing on which is a wxRuby3 CLI command installed by the gem:
143
259
 
144
260
  ```shell
145
261
  wxruby setup
146
262
  ```
147
263
 
148
264
  The wxRuby3 CLI `wxruby` is installed by all wxRuby3 gems. In case of the source gem initially the CLI will provide only
149
- a single command `wxruby setup` to finish wxRuby3 extension (build and) installation.
265
+ the commands `wxruby setup` (to finish wxRuby3 extension installation) and `wxruby check`.
150
266
 
151
267
  For most (user) installations the default setup command as shown above will suffice nicely. In this case the setup
152
268
  (or installation) procedure will analyze the system to see if it meets the software requirements described above and if not
@@ -184,7 +300,7 @@ The initial message shown (between lines starting with '---' ) is indicative of
184
300
  on options passed to the setup command.<br>
185
301
  Building the wxRuby3 native extensions and generating reference documentation will always happen.
186
302
 
187
- ### Disable prompting for automatic install
303
+ #### Disable prompting for automatic install
188
304
 
189
305
  To prevent having the setup procedure asking consent the setup procedure can be started with the `--autoinstall` option
190
306
  like this:
@@ -195,7 +311,7 @@ wxruby setup --autoinstall
195
311
 
196
312
  Note that on Linux that may still present a prompt in case the `sudo` command requires a password.
197
313
 
198
- ### Prevent automatic installation of software requirements
314
+ #### Prevent automatic installation of software requirements
199
315
 
200
316
  To prevent the setup procedure from considering to automatically install (with or without prompting) any missing software
201
317
  requirements the setup procedure can be started with the `--no-autoinstall` option like this:
@@ -207,7 +323,7 @@ wxruby setup --no-autoinstall
207
323
  The setup procedure will still analyze the system for available software requirements and if it finds any missing it
208
324
  will end the procedure and show a message of what it found missing.
209
325
 
210
- ### Force embedded wxWidgets installation
326
+ #### Force embedded wxWidgets installation
211
327
 
212
328
  To prevent the setup procedure of using any system installed wxWidgets version the setup procedure can be started with
213
329
  the `--with-wxwin` option like this:
@@ -218,7 +334,22 @@ wxruby setup --with-wxwin
218
334
 
219
335
  This will force the setup procedure to build and install an embedded wxWidgets version for wxRuby3.
220
336
 
221
- ### Setup with user installed wxWidgets
337
+ #### Force embedded wxWidgets head installation
338
+
339
+ To force the setup procedure to build and install an embedded wxWidgets head (master) version the setup procedure can
340
+ be started with the `--with-wxhead` option like this:
341
+
342
+ ```shell
343
+ wxruby setup --with-wxhead
344
+ ```
345
+
346
+ > **NOTE**<br>
347
+ > Although wxRuby3 endeavors to keep up to date with the wxWidgets master branch your mileage may vary depending on
348
+ > the development state of the wxWidgets master branch. You can check the latest results of the wxRuby3 CI master build
349
+ > workflows of the [wxRuby3 Github Actions](https://github.com/mcorino/wxRuby3/actions) to get a feel of the current
350
+ > integration state.
351
+
352
+ #### Setup with user installed wxWidgets
222
353
 
223
354
  In case of a (custom) user installation of wxWidgets the `--wxwin` (and optionally `--wxxml`) option(s) can be used to
224
355
  start the setup procedure to build for this installation like this:
@@ -241,7 +372,14 @@ wxruby setup --wxwin=/my/custom/wxWidgets --wxxml=/my/alternate/wxWidgets/xml
241
372
  > responsible for making sure the wxRuby3 extension library can find the wxWidgets libraries at runtime (normally this
242
373
  > requires updating the standard shared library search path for the platform).
243
374
 
244
- ### Setup with customized tool paths
375
+ > **NOTE 2**<br>
376
+ > Please be aware that when building a user installation of wxWidgets on Windows this has to be done using the exact
377
+ > same compiler suite as used for building Ruby (and it's standard native extensions) itself.<br>
378
+ > Currently only RubyInstaller versions are supported which use the MingW64 compiler.
379
+ > Do **NOT** install a separate MSYS2/MingW64 release but rather use a RubyInstaller version with integrated DevKit
380
+ > installation (which includes MSYS2 and the right MingW64 compiler suite).
381
+
382
+ #### Setup with customized tool paths
245
383
 
246
384
  If for whatever reason the required development tools `doxygen`, `swig` and/or `git` have been installed in a location
247
385
  not in the standard executable search path the full path to these tools can be passed on the setup procedure using the
@@ -251,7 +389,7 @@ not in the standard executable search path the full path to these tools can be p
251
389
  wxruby setup --doxygen=/my/path/to/doxygen
252
390
  ```
253
391
 
254
- ### Redirect log to customized path
392
+ #### Redirect log to customized path
255
393
 
256
394
  The setup procedure will log full build results to a file setup.log at the location where the gem contents is stored.
257
395
  If the setup fails the error message will display the log file location and by default if the setup succeeds the log
@@ -364,7 +502,7 @@ Checkout the wxRuby3 sources from [GitHub](https://github.com/mcorino/wxRuby3) o
364
502
  Requirements are the same as for installing the source gem. Gem dependencies are listed in the Gemfile in the root
365
503
  of the wxRuby3 tree and should be installed by executing `bundle install`.<br>
366
504
  To be able to generate HTML documentation the optional `:documentation` group should be included.<br>
367
- To be able to run the Rake memory check task the option `:develop` group should be included.
505
+ To be able to run the Rake memory check task the optional `:develop` group should be included.
368
506
 
369
507
  The wxRuby3 project provides a Rake based build system. Call `rake help` to get an overview of the available commands.
370
508
  As mentioned there the `rake configure` command is required as the very first command. Call `rake configure[--help]` to
@@ -376,4 +514,7 @@ commands are executed using parallel task execution by default.
376
514
 
377
515
  When the build has finished without errors the regression tests can be run by calling `rake test`.
378
516
 
517
+ After successfully building the wxRuby3 extension libraries (and possibly embedded wxWidgets libraries) a binary package
518
+ can be created by calling `rake binpkg`.
519
+
379
520
  For more details concerning the wxRuby3 development strategy and build options see [here](TODO).
data/README.md CHANGED
@@ -41,7 +41,8 @@ end
41
41
 
42
42
  Anyone who is familiar with wxWidgets should feel right at home since the API may be Ruby-fied, it is still easily
43
43
  recognizable (but being Ruby-fied allowing for elegant and compact coding). And for those that do not have previous
44
- experience, do not fear, wxRuby3 comes with detailed [documentation](https://mcorino.github.io/wxRuby3/file.00_starting.html) and lots of examples and tests.
44
+ experience, do not fear, wxRuby3 comes with an extensive [User Guide](https://github.com/mcorino/wxRuby3/wiki/User-Guide-%3A-Introduction)
45
+ and detailed [reference documentation](https://mcorino.github.io/wxRuby3) and lots of examples and tests.
45
46
 
46
47
  ```ruby
47
48
  require 'wx'
@@ -90,17 +91,19 @@ README and license files for details.
90
91
  See [here](CREDITS.md) for more details on and acknowledgement of the developers
91
92
  of these products.
92
93
 
93
- ## FAQ
94
+ ## (Some of the) Most Frequently Asked Questions
95
+
96
+ (see the extended [FAQ](https://github.com/mcorino/wxRuby3/wiki/Frequently-Asked-Questions) in the [Wiki](https://github.com/mcorino/wxRuby3/wiki) for more information)
94
97
 
95
98
  ### What platforms and operating systems are supported in wxRuby3?
96
99
 
97
100
  Currently the following are fully supported:
98
101
 
99
- | Platform | Ruby version(s) | wxWidgets version(s) |
100
- |-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|----------------------|
101
- | Windows 10 (tested)<br>(most likely also Windows 11) | Ruby >= 2.5<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
102
- | Linux (tested; all major AMD-64 distributions: Ubuntu, Debian, Fedora, OpenSuSE and ArchLinux)<br>(most likely also i686 and ARM) | Ruby >= 2.5 | wxWidgets >= 3.2 |
103
- | MacOS >= 10.10 using Cocoa (tested on AMD-64 and ARM64 M2 Chip) | Ruby >= 2.5 (MacPorts, Homebrew, ruby-install, RVM) | wxWidgets >= 3.2 |
102
+ | Platform | Ruby version(s) | wxWidgets version(s) |
103
+ |------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|----------------------|
104
+ | Windows 10 (tested)<br>(most likely also Windows 11) | Ruby >= 2.5<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
105
+ | Linux (tested; all major AMD64 and ARM64 distributions: Ubuntu, Debian, Fedora, OpenSuSE and ArchLinux)<br>(most likely also i686) | Ruby >= 2.5 | wxWidgets >= 3.2 |
106
+ | MacOS >= 10.10 using Cocoa (tested on AMD64 and ARM64 M1/M2 Chip) | Ruby >= 2.5 (MacPorts, Homebrew, ruby-install, RVM) | wxWidgets >= 3.2 |
104
107
 
105
108
  Support for other platforms is not being actively developed at present,
106
109
  but patches are welcome. It is likely to be much simpler to get wxRuby
@@ -109,53 +112,59 @@ on legacy systems (eg Windows 98, Mac OS 9).
109
112
 
110
113
  ### How can I install wxRuby3?
111
114
 
112
- wxRuby3 is distributed as a Ruby gem on [RubyGems](https://rubygems.org).<br>
113
- Apart from a regular source-only version of the gem there is also a binary gem version for Windows 10 provided (for the
114
- latest stable Ruby release at the time of publishing) which includes an embedded wxWidgets installation (also latest
115
- stable version).
115
+ wxRuby3 is distributed as a Ruby gem on [RubyGems](https://rubygems.org). This gem can also be downloaded from the release
116
+ assets on [Github](https://github.com/mcorino/wxRuby3/releases).
116
117
 
117
118
  The wxRuby3 gem provides a **worry-free** installation procedure for all supported platforms.
118
119
 
119
- Installing the binary gem version on Windows (which is the default when installing for the latest stable Ruby release for
120
- that platform) requires no additional installation steps and/or additional software to be installed except for a supported
121
- version of the Ruby interpreter. So for this platform the following command is all it takes to get up and running:
120
+ Installing the gem requires no additional installation steps and/or additional software to be installed except for a
121
+ supported version of the Ruby interpreter. So the following command is all it takes to install:
122
122
 
123
123
  ```shell
124
124
  gem install wxruby3
125
125
  ```
126
126
 
127
- For the platforms requiring a source based installation (Linux and MacOSX as well as Windows for older Ruby releases
128
- or when explicitly selecting source based install) an additional (simple) setup step is required to finish installation.
129
- For these platforms the full installation sequence would be:
127
+ The wxRuby3 installation procedure will check the availability of a, prebuilt, binary package matching the platform
128
+ being installed on and if found will download and install that package resulting in a ready-to-run wxRuby3 installation.<br>
129
+ If no matching package is found the installation reverts to a source installation which will require an additional setup
130
+ step to finalize the wxRuby3 installation by executing the following command:
130
131
 
131
132
  ```shell
132
- gem install wxruby3 && wxruby setup
133
+ wxruby setup
133
134
  ```
134
135
 
135
- The second part of this command sequence is a fully automated setup procedure provided by the wxRuby3 **CLI** installed with
136
- the gem. This procedure (by default) will analyze your system and install (after asking your consent) any missing software
137
- requirements and build the wxRuby3 extension libraries (including a embedded copy of wxWidgets if necessary). It may take
138
- quite a while depending on your system but you can mostly sit back and relax.
136
+ This last command is a fully automated setup procedure provided by the wxRuby3 **CLI** installed with the gem. This
137
+ procedure (by default) will analyze your system and install (after asking your consent) any missing software
138
+ requirements and build the wxRuby3 extension libraries (including a embedded copy of wxWidgets if necessary). It may
139
+ take quite a while depending on your system but you can mostly sit back and relax.
139
140
 
140
141
  > **NOTE**<br>
141
142
  > A source based installation requires the availability of the Ruby development headers. User installed Rubies in most cases
142
143
  > will already include those but (especially on Linux) system installed Rubies may require having an additional '-dev/-devel'
143
- > package installed.
144
+ > package installed (although actually you may already have needed those to install the gems that the wxRuby3 gem depends
145
+ > on like the nokogiri gem).
146
+
147
+ The wxRuby3 CLI also provides a 'check' command with which the runtime status of the wxRuby3 installation can be checked
148
+ at any time. By default running `wxruby check` will display a message reporting the runtime and suggestions on finalizing
149
+ the installation if not finalized yet. No message is displayed if wxRuby3 is ready to run. Run `wxruby check -h` for
150
+ details concerning this command.
151
+
152
+ A selection of (prebuilt) binary packages is provided as release assets on [Github](https://github.com/mcorino/wxRuby3/releases).
153
+ See the [INSTALL](INSTALL.md#binary-packages) document for more details.
144
154
 
145
155
  This install procedure can of course be tweaked and customized with commandline arguments.
146
156
  See the [INSTALL](INSTALL.md) document for more details.
147
157
 
148
-
149
158
  ### Where can I ask a question, or report a bug?
150
159
 
151
160
  Use GitHUb Issues.
152
161
 
153
162
  When asking a question, if something is not working as you expect,
154
163
  please provide a *minimal*, *runnable* sample of code that demonstrates
155
- the problem, and say what you expected to happen, and what actually
164
+ the problem, and describe clearly what you expected to happen and what actually
156
165
  happened. Please also provide basic details of your platform, Ruby,
157
166
  wxRuby and wxWidgets version, and make a reasonable effort to find answers
158
- in the archive and documentation before posting. People are mostly happy
167
+ in the archive, wiki and/or documentation before posting. People are mostly happy
159
168
  to help, but it's too much to expect them to guess what you're trying to
160
169
  do, or try and debug 1,000 lines of your application.
161
170
  Very important also; do not use offensive language and be **polite**.
@@ -171,13 +180,17 @@ some use a more modern coding style than others. Use the bundled `wxruby`
171
180
  CLI to access the samples (see the section **Bundled CLI** in
172
181
  the [INSTALL](INSTALL.md) document for more details).
173
182
 
183
+ An extensive [User Guide](https://github.com/mcorino/wxRuby3/wiki/User-Guide-%3A-Introduction)
184
+ is available at the [wxRuby3 Wiki](https://github.com/mcorino/wxRuby3/wiki) providing detailed
185
+ information about how to build desktop applications with wxRuby3.
186
+
174
187
  Complete (more or less) wxRuby API documentation should be part of any
175
188
  complete wxRuby3 build. This tends to focus on providing a reference
176
189
  of all available modules, classes and methods and how to use specific
177
190
  classes and methods, rather than on how to construct an application
178
191
  overall.
179
192
  This documentation (for the latest release) is also available online
180
- [here](https://mcorino.github.io/wxRuby3/file.00_starting.html).
193
+ [here](https://mcorino.github.io/wxRuby3).
181
194
 
182
195
  One of the advantages of wxRuby3 is the much larger ecosystem of
183
196
  wxWidgets and wxPython resources out there. There is a book for
@@ -193,18 +206,6 @@ example, if you wanted answers about the "Grid" class, try searching for
193
206
  "wxGrid" as this will turn up results relating to wxWidgets and wxPython
194
207
  which may be relevant.
195
208
 
196
- ### What wxWidgets features are supported by wxRuby3?
197
-
198
- wxRuby supports almost all of the wxWidgets 3.2+ GUI API, providing over
199
- 600 classes in total. wxWidgets classes that provide general and/or non-GUI
200
- programming support features, such as strings, networking, threading, database
201
- access and such are not and will never be ported, as it's assumed that
202
- in all these cases it's preferable to use pure Ruby features.
203
-
204
- If you know of a feature in wxWidgets that you would like to see
205
- supported in wxRuby3 you are free to ask but do not **EXPECT** unconditional
206
- agreement or immediate response.
207
-
208
209
  ### How does wxRuby3 relate to the wxRuby 2.0 (and even older 0.6.0) release?
209
210
 
210
211
  wxRuby 0.6.0 was the last in a series of releases developed using a
@@ -225,12 +226,3 @@ maintainable solution.
225
226
 
226
227
  Please double-check the instructions above and in the [INSTALL](INSTALL.md) document and search issue archives. If
227
228
  this doesn't help, please post your question using GitHub Issues.
228
-
229
- ### Is there another, more declarative way, for writing wxRuby3 desktop GUI applications?
230
-
231
- Yes. [Glimmer DSL for WX](https://github.com/AndyObtiva/glimmer-dsl-wx) enables software engineers to build GUI
232
- using wxruby3 following the Ruby way with the least amount of code possible. That is by offering a minimalistic
233
- declarative high-level DSL that maps visually to the way software engineers think about the GUI hierarchy in addition
234
- to adopting Rails' strategy of Convention over Configuration via smart defaults and automation of wxruby3 low-level
235
- details. You can check out the [Glimmer DSL for WX README "Coming From wxruby3" section](https://github.com/AndyObtiva/glimmer-dsl-wx#coming-from-wxruby3) for more information on
236
- how to translate wxruby3 apps to [Glimmer DSL for WX](https://github.com/AndyObtiva/glimmer-dsl-wx) syntax.
@@ -0,0 +1,72 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ ###
6
+ # wxRuby3 extension configuration file for gems
7
+ ###
8
+
9
+ OPTIONS = {
10
+ }
11
+
12
+ until ARGV.empty?
13
+ switch = ARGV.shift
14
+ case switch
15
+ when /^prebuilt=(none|only|head)$/
16
+ OPTIONS[:prebuilt] = $1.to_sym
17
+ when /^package=(.+)$/
18
+ OPTIONS[:package] = $1
19
+ when 'help'
20
+ puts <<~__INFO_TXT
21
+ wxRuby3 extension build script
22
+
23
+ Usage: gem install wxruby3 -- help OR gem install wxruby3 [-- options [...]]
24
+
25
+ options:
26
+
27
+ prebuilt=OPT Specifies to either require (OPT == 'only') or avoid (OPT == 'none') installing prebuilt
28
+ binary packages. If not specified installing a prebuilt package will be attempted reverting
29
+ to source install if none found.
30
+
31
+ package=URL Specifies the http(s) url or absolute path to the prebuilt binary package to install.
32
+ Implies 'prebuilt=only'.
33
+
34
+ help Show this message.
35
+ __INFO_TXT
36
+ puts
37
+ exit(1)
38
+ else
39
+ $stderr.puts "ERROR: Invalid option [#{switch}] for wxRuby3 extension build script."
40
+ exit(1)
41
+ end
42
+ end
43
+
44
+ task_args = []
45
+ unless OPTIONS[:prebuilt].nil?
46
+ case OPTIONS[:prebuilt]
47
+ when :only
48
+ task_args << "'--prebuilt'"
49
+ when :none
50
+ task_args << "'--no-prebuilt'"
51
+ end
52
+ end
53
+ if OPTIONS[:package]
54
+ pkg = RUBY_PLATFORM =~ /mingw/ ? OPTIONS[:package].gsub('\\', '/') : OPTIONS[:package] # make sure the path is URI compatible
55
+ task_args << "'--package'" << "'#{pkg}'"
56
+ end
57
+
58
+ # generate new rakefile with appropriate default task (calls actual task in rakelib)
59
+ File.open('../Rakefile', 'w') do |f|
60
+ f.puts <<EOF__
61
+ ###
62
+ # wxRuby3 rake file
63
+ # Copyright (c) M.J.N. Corino, The Netherlands
64
+ ###
65
+
66
+ unless File.file?(File.join('lib', 'wx', 'wxruby_core.so'))
67
+ task :default do
68
+ Rake::Task['wxruby:gem:install'].invoke(#{task_args.join(', ')})
69
+ end
70
+ end
71
+ EOF__
72
+ end
data/lib/wx/core/app.rb CHANGED
@@ -14,6 +14,22 @@ require_relative './ext'
14
14
  # Controller class which creates and manages all windows.
15
15
  class Wx::App
16
16
 
17
+ if Wx::PLATFORM == 'WXOSX'
18
+ class << self
19
+ # provide aliases for macosx specials
20
+ alias :mac_about_menu_itemid= :set_mac_about_menu_itemid
21
+ alias :mac_about_menu_itemid :get_mac_about_menu_itemid
22
+ alias :mac_preferences_menu_itemid= :set_mac_preferences_menu_itemid
23
+ alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid
24
+ alias :mac_exit_menu_itemid= :set_mac_exit_menu_itemid
25
+ alias :mac_exit_menu_itemid :get_mac_exit_menu_itemid
26
+ alias :mac_help_menu_title= :set_mac_help_menu_title
27
+ alias :mac_help_menu_title :get_mac_help_menu_title
28
+ alias :mac_window_menu_title= :set_mac_window_menu_title
29
+ alias :mac_window_menu_title :get_mac_window_menu_title
30
+ end
31
+ end
32
+
17
33
  # convenience method to retrieve global Wx::App instance
18
34
  def self.the_app
19
35
  if Wx::const_defined?(:THE_APP) and Wx::THE_APP.is_running