wxruby3 0.9.0.pre.rc.1 → 0.9.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +51 -22
- data/README.md +38 -6
- data/assets/hello_button-macos.png +0 -0
- data/assets/hello_button-msw.png +0 -0
- data/assets/hello_button_clicked-macos.png +0 -0
- data/assets/hello_button_clicked-msw.png +0 -0
- data/assets/hello_button_clicked_combi.png +0 -0
- data/assets/hello_world-macos.png +0 -0
- data/assets/hello_world-msw.png +0 -0
- data/assets/hello_world_combi.png +0 -0
- data/lib/wx/core/brush.rb +6 -0
- data/lib/wx/core/evthandler.rb +12 -2
- data/lib/wx/core/font.rb +22 -14
- data/lib/wx/core/helpprovider.rb +2 -2
- data/lib/wx/core/menu.rb +5 -0
- data/lib/wx/core/pen.rb +6 -0
- data/lib/wx/core/window.rb +28 -1
- data/lib/wx/doc/app.rb +40 -0
- data/lib/wx/doc/brush.rb +17 -0
- data/lib/wx/doc/font.rb +27 -0
- data/lib/wx/doc/pen.rb +17 -0
- data/lib/wx/doc/radio_box.rb +20 -0
- data/lib/wx/doc/window.rb +27 -0
- data/lib/wx/keyword_defs.rb +77 -76
- data/lib/wx/prt/keyword_defs.rb +5 -1
- data/lib/wx/version.rb +1 -1
- data/rakelib/install.rb +17 -6
- data/rakelib/lib/config/linux.rb +4 -2
- data/rakelib/lib/config/macosx.rb +120 -1
- data/rakelib/lib/config/mingw.rb +6 -1
- data/rakelib/lib/config/unixish.rb +26 -11
- data/rakelib/lib/config.rb +15 -6
- data/rakelib/lib/core/package.rb +1 -1
- data/rakelib/lib/core/spec.rb +2 -2
- data/rakelib/lib/director/app.rb +30 -1
- data/rakelib/lib/director/aui_toolbar.rb +41 -0
- data/rakelib/lib/director/brush.rb +10 -1
- data/rakelib/lib/director/combobox.rb +1 -1
- data/rakelib/lib/director/context_help_button.rb +23 -0
- data/rakelib/lib/director/dialog.rb +8 -2
- data/rakelib/lib/director/font.rb +12 -3
- data/rakelib/lib/director/help_provider.rb +8 -10
- data/rakelib/lib/director/hyperlink_event.rb +22 -0
- data/rakelib/lib/director/menu.rb +0 -3
- data/rakelib/lib/director/menu_bar.rb +3 -0
- data/rakelib/lib/director/pen.rb +10 -1
- data/rakelib/lib/director/popup_window.rb +18 -0
- data/rakelib/lib/director/radio_box.rb +15 -4
- data/rakelib/lib/director/searchctrl.rb +2 -1
- data/rakelib/lib/director/static_box.rb +1 -1
- data/rakelib/lib/director/styled_text_ctrl.rb +1 -1
- data/rakelib/lib/director/text_entry.rb +5 -0
- data/rakelib/lib/director/textctrl.rb +1 -1
- data/rakelib/lib/director/window.rb +37 -1
- data/rakelib/lib/generate/doc/context_help_button.yaml +16 -0
- data/rakelib/lib/generate/doc/event_blocker.yaml +27 -0
- data/rakelib/lib/generate/doc/event_filter.yaml +47 -0
- data/rakelib/lib/generate/doc/file_dialog.yaml +68 -0
- data/rakelib/lib/generate/doc.rb +1 -1
- data/rakelib/lib/generate/interface.rb +11 -10
- data/rakelib/lib/specs/interfaces.rb +4 -1
- data/samples/aui/aui.rb +432 -363
- data/samples/propgrid/propgrid.rb +3 -0
- data/samples/sampler/editor.rb +33 -25
- data/samples/sampler/sample.rb +2 -2
- data/samples/sampler/stc_editor.rb +4 -2
- data/tests/lib/item_container_tests.rb +82 -0
- data/tests/lib/text_entry_tests.rb +80 -0
- data/tests/lib/wxapp_runner.rb +12 -0
- data/tests/lib/wxframe_runner.rb +89 -4
- data/tests/test_ext_controls.rb +28 -0
- data/tests/test_font.rb +239 -0
- data/tests/test_intl.rb +5 -1
- data/tests/test_std_controls.rb +263 -37
- data/tests/test_window.rb +340 -0
- metadata +28 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bc61b2275cfa2dd3f0616b3b899a0bdc8c006cb0f06d77b150cf1f596d3874e
|
4
|
+
data.tar.gz: 5c4ecc0394f8aeb5257f243adf488991add90a3f4f6fbe77e91d06e0f08abde6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e765d9941397f20fc0f770bbfc5e2e0a73ca00b76101c098d84a9802a5d3f924ea52f65ea8f960f3a1269f30aaa3fb5636aef61bf064784dc0716eb31ac27ab2
|
7
|
+
data.tar.gz: 994a3226ca8f8d61fc0bdff11fa1bce572614d40b6f351b49dea7f6b2ce0f2a4915114dbfccd20562c7a236280ce7575ef779cc358f628d5188613abee37d060
|
data/INSTALL.md
CHANGED
@@ -4,32 +4,45 @@
|
|
4
4
|
|
5
5
|
# Installation of wxRuby3
|
6
6
|
|
7
|
+
## Minimal requirements for installing wxRuby3
|
8
|
+
|
9
|
+
The minimal requirements for installing any source based setup (gem, source package or Github clone) of wxRuby3 are:
|
10
|
+
|
11
|
+
| Sofware | Notes |
|
12
|
+
|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
13
|
+
| Ruby | A supported version of the Ruby interpreter needs to be installed. |
|
14
|
+
| C++ compiler<br>(incl. dev tools like `make`) | On linux a recent version of the GNU C++ compiler (with c++-14 support) needs to be installed<br>On Windows the RubyInstaller MSYS2-Devkit needs to be installed<br>On MacOS XCode with commandline tools needs to be installed |
|
15
|
+
| Git version control toolkit | |
|
16
|
+
| SWIG >= 3.0.12 | On MacOS install [Homebrew](https://brew.sh/) and than `brew install swig` |
|
17
|
+
| Doxygen (>= 1.9.1, <= 1.9.6) | Doxygen > 1.9.6 has changes that cause problems with the wxWidgets doxygen files.<br>On MacOS: `brew tap mcorino/wxruby3` and than `brew install doxygen@1.9.6` (default brew recipe installs 1.9.7) |
|
18
|
+
|
19
|
+
The wxRuby3 build process requires `git` to clone a copy of the wxWidgets Github repository to extract the interface
|
20
|
+
specifications from.<br>
|
21
|
+
The wxRuby3 build process needs doxygen to generated XML files containing wxWidgets interface specs which are used to
|
22
|
+
generate SWIG interface definitions from which SWIG to generates C++ source code for the wrapper interfaces from
|
23
|
+
which the native extension is compiled.
|
24
|
+
|
7
25
|
## Installation of a wxRuby3 Gem
|
8
26
|
|
9
27
|
The wxRuby3 project provides gems on [RubyGems](https://rubygems.org) which can be installed with the
|
10
28
|
standard `gem install` command line this:
|
11
29
|
|
12
|
-
```
|
30
|
+
```shell
|
13
31
|
gem install wxruby3
|
14
32
|
```
|
15
33
|
|
16
34
|
On Linux systems this will install the source based gem which will automatically build the native wxruby3 extension
|
17
35
|
for the platform on which wxRuby3 is being installed.
|
18
36
|
On Windows systems a prebuilt binary gem is available for the latest stable release(s) of [RubyInstaller](https://rubyinstaller.org)
|
19
|
-
installed rubies that will be installed by default if installing for that platform
|
20
|
-
|
37
|
+
installed rubies that will be installed by default if installing for that platform (including an embedded, latest
|
38
|
+
stable version, wxWidgets installation).<br>
|
39
|
+
Alternatively the source gem can be installed on Windows by installing with explicit platform specification like this:
|
21
40
|
|
22
|
-
```
|
41
|
+
```shell
|
23
42
|
gem install wxruby3 --platform=ruby
|
24
43
|
```
|
25
44
|
|
26
|
-
When installing the source gem the
|
27
|
-
|
28
|
-
- Git version control toolkit
|
29
|
-
- Ruby 2.5 or later (including development package)
|
30
|
-
- GNU g++ 4.8 or later on Linux, RubyInstaller+DevKit on Windows
|
31
|
-
- [SWIG](https://www.swig.org) 3.0.12 or later
|
32
|
-
- [Doxygen](https://www.doxygen.nl/)
|
45
|
+
When installing the source gem the minimal requirements listed above apply.
|
33
46
|
|
34
47
|
Also a wxWidgets installation (version 3.2 or later) is required for which there are multiple options.
|
35
48
|
|
@@ -39,38 +52,54 @@ Also a wxWidgets installation (version 3.2 or later) is required for which there
|
|
39
52
|
The wxRuby build procedure will determine the availability and version of wxWidgets by locating and calling
|
40
53
|
the `wx-config` utility script. In case no (compatible) wxWidgets version is found installation ends with an error.<br>
|
41
54
|
Please note that even with this method a copy of the wxWidgets project will be checked out from GitHUb as the wxRuby3
|
42
|
-
build procedure requires access to the wxWidgets interface specification sources
|
55
|
+
build procedure requires access to the wxWidgets interface specification sources which are not normally part of any of
|
56
|
+
the standard distribution packages.
|
43
57
|
|
44
58
|
|
45
59
|
2. User installed wxWidgets version<br>
|
46
60
|
<br>
|
47
|
-
In case the being
|
61
|
+
In case the system being installed on does not provide (a compatible) wxWidgets version or a specific (possibly updated)
|
48
62
|
wxWidgets version is required the source gem can be installed using a user installed version like this (where the
|
49
63
|
`WXWIN` path should provide the location where the wxWidgets binaries are installed under `<wxwin path>/bin`):<br>
|
50
64
|
|
51
|
-
```
|
65
|
+
```shell
|
52
66
|
gem install wxruby3 -- WXWIN=/path/to/wx/install
|
53
67
|
```
|
54
68
|
|
55
|
-
3. Automatic installed wxWidgets version<br>
|
69
|
+
3. Automatic installed, embedded, wxWidgets version<br>
|
56
70
|
<br>
|
57
|
-
This is the easiest method when the being
|
71
|
+
This is the easiest method when the system being installed on does not provide (a compatible) wxWidgets version (and
|
58
72
|
no specific user defined version is required) and can be used by installing the source gem like this (which will
|
59
|
-
cause automatic checkout and building of the latest wxWidgets release (>= 3.2) from GitHub:
|
60
|
-
|
73
|
+
cause automatic checkout and building of the latest stable wxWidgets release (>= 3.2) from GitHub:
|
61
74
|
|
62
|
-
```
|
75
|
+
```shell
|
63
76
|
gem install wxruby3 -- WITH_WXWIN=1
|
64
77
|
```
|
65
78
|
|
79
|
+
In case of option **2** it is also possible to do the doxygen XML generation as part of the wxWidgets user installation
|
80
|
+
and use that for the gem installation. In that case the user is required to generate the XML interface specs using the
|
81
|
+
`regen` script found in the `docs/doxygen` folder of the wxWidgets installation after which the XML output folder can be
|
82
|
+
provided to the gem installation as follows:
|
83
|
+
|
84
|
+
```shell
|
85
|
+
gem install wxruby3 -- WXWIN=/path/to/wx/install WXXML=/path/to/wx/doxygen/xml
|
86
|
+
```
|
87
|
+
|
88
|
+
Please also not that in case of option two the user is responsible to make sure the wxWidgets shared libraries can be
|
89
|
+
found by the system's dynamic loader at runtime.
|
90
|
+
|
66
91
|
> **NOTE:** Be patient when installing the source gem. Building wxRuby3 takes a while and when wxWidgets is included event more.
|
67
92
|
|
93
|
+
> **NOTE:** Be aware that for prerelease versions of the gem you should add the `--pre` argument to the `gem install` command.
|
94
|
+
|
68
95
|
## Building from source
|
69
96
|
|
70
|
-
Checkout the wxRuby3 sources from [GitHub](https://github.com/mcorino/wxRuby3).
|
97
|
+
Checkout the wxRuby3 sources from [GitHub](https://github.com/mcorino/wxRuby3) or download and unpack a release package.
|
71
98
|
|
72
|
-
|
73
|
-
of the wxRuby3 tree
|
99
|
+
Requirements are the same as for installing the source gem. Gem dependencies are listed in the Gemfile in the root
|
100
|
+
of the wxRuby3 tree and should be installed by executing `bundle install`.<br>
|
101
|
+
To be able to generate HTML documentation the optional `:documentation` group should be included.<br>
|
102
|
+
To be able to run the Rake memory check task the option `:develop` group should be included.
|
74
103
|
|
75
104
|
The wxRuby3 project provides a Rake based build system. Call `rake help` to get an overview of the available commands.
|
76
105
|
As mentioned there the `rake configure` command is required as the very first command. Call `rake configure[--help]` to
|
data/README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
[![Linux wxGTK](https://github.com/mcorino/wxRuby3/actions/workflows/linux.yml/badge.svg)](https://github.com/mcorino/wxRuby3/actions/workflows/linux.yml)
|
2
2
|
[![Windows wxMSW](https://github.com/mcorino/wxRuby3/actions/workflows/msw.yml/badge.svg)](https://github.com/mcorino/wxRuby3/actions/workflows/msw.yml)
|
3
|
+
[![Mac wxOSX](https://github.com/mcorino/wxRuby3/actions/workflows/mac.yml/badge.svg)](https://github.com/mcorino/wxRuby3/actions/workflows/mac.yml)
|
4
|
+
|
3
5
|
[![License](https://img.shields.io/badge/license-MIT-yellowgreen.svg)](LICENSE)
|
4
6
|
[![Gem Version](https://badge.fury.io/rb/wxruby3.svg)](https://badge.fury.io/rb/wxruby3)
|
5
|
-
|
6
7
|
[![Documentation](https://img.shields.io/badge/docs-pages-blue.svg)](https://mcorino.github.io/wxRuby3)
|
8
|
+
[![Chat](https://img.shields.io/gitter/room/mcorino/wxruby)](https://gitter.im/mcorino/wxruby3)
|
7
9
|
|
8
10
|
# README for wxRuby3
|
9
11
|
|
@@ -33,13 +35,13 @@ Wx::App.run do
|
|
33
35
|
end
|
34
36
|
```
|
35
37
|
|
36
|
-
![Hello_World](assets/
|
38
|
+
![Hello_World](assets/hello_world_combi.png "Hello World sample")
|
37
39
|
|
38
40
|
### Hello Button
|
39
41
|
|
40
42
|
Anyone who is familiar with wxWidgets should feel right at home since the API may be Ruby-fied, it is still easily
|
41
43
|
recognizable (but being Ruby-fied allowing for elegant and compact coding). And for those that do not have previous
|
42
|
-
experience do not fear, wxRuby3 comes with detailed [documentation](https://mcorino.github.io/wxRuby3/file.00_starting.html) and lots of examples and
|
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.
|
43
45
|
|
44
46
|
```ruby
|
45
47
|
require 'wx'
|
@@ -56,8 +58,7 @@ end
|
|
56
58
|
Wx::App.run { TheFrame.new('Hello world!').show }
|
57
59
|
```
|
58
60
|
|
59
|
-
![
|
60
|
-
![Hello_Button_Clicked](assets/hello_button_clicked.png "Hello Button sample clicked")
|
61
|
+
![Hello_Button_Clicked](assets/hello_button_clicked_combi.png "Hello Button sample clicked")
|
61
62
|
|
62
63
|
|
63
64
|
## wxRuby3 licence
|
@@ -99,12 +100,39 @@ Currently the following are fully supported:
|
|
99
100
|
|----------------------------------------------------------------------------|-----------------| --- |
|
100
101
|
| Windows 10 (tested)<br>(most likely also Windows 11) | Ruby >= 2.5<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
|
101
102
|
| Linux (tested; any AMD-64 distribution)<br>(most likely also i686 and ARM) | Ruby >= 2.5 | wxWidgets >= 3.2 |
|
103
|
+
| MacOS >= 10.10 using Cocoa (tested on AMD-64) | Ruby >= 2.5 | wxWidgets >= 3.2 |
|
102
104
|
|
103
105
|
Support for other platforms is not being actively developed at present,
|
104
106
|
but patches are welcome. It is likely to be much simpler to get wxRuby
|
105
107
|
working on similar modern systems (eg FreeBSD or Solaris with GTK) than
|
106
108
|
on legacy systems (eg Windows 98, Mac OS 9).
|
107
109
|
|
110
|
+
### How can I install wxRuby3?
|
111
|
+
|
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 version at the time of publishing) which includes an embedded wxWidgets installation (also latest
|
115
|
+
stable version).
|
116
|
+
|
117
|
+
Installing the binary gem version on Windows requires no additional software to be installed except for a supported
|
118
|
+
version of the Ruby interpreter.<br>
|
119
|
+
To install the source-only gem the following software is required:
|
120
|
+
|
121
|
+
| Sofware | Notes |
|
122
|
+
|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
123
|
+
| Ruby | A supported version of the Ruby interpreter needs to be installed. |
|
124
|
+
| C++ compiler<br>(incl. dev tools like `make`) | On linux a recent version of the GNU C++ compiler (with c++-14 support) needs to be installed<br>On Windows the RubyInstaller MSYS2-Devkit needs to be installed<br>On MacOS XCode with commandline tools needs to be installed |
|
125
|
+
| Git version control toolkit | |
|
126
|
+
| SWIG >= 3.0.12 | On MacOS install [Homebrew](https://brew.sh/) and than `brew install swig` |
|
127
|
+
| Doxygen (>= 1.9.1, <= 1.9.6) | Doxygen > 1.9.6 has changes that cause problems with the wxWidgets doxygen files.<br>On MacOS: `brew tap mcorino/wxruby3` and than `brew install doxygen@1.9.6` (default brew recipe installs 1.9.7) |
|
128
|
+
| wxWidgets >= 3.2 (*OPTIONAL*) | On Linux most distributions provide system installable (development) packages for wxWidgets providing a supported version. Alternatively you can fairly easily install your own preferred version manually (see the [wxWidgets](https://wxwidgets.org) project for details).<br>On Windows and MacOS the process is less straightforward (also here see the [wxWidgets](https://wxwidgets.org) project for details).<br>The wxRuby3 source-only gem can also be installed using a private local wxWidgets installation or an embedded installation (most likely preferred on Windows and MacOS). See [INSTALL](INSTALL.md) for more details. |
|
129
|
+
|
130
|
+
In case the prerequisites above are met the (source-only or binary) gem can be installed executing the following command:
|
131
|
+
|
132
|
+
```shell
|
133
|
+
gem install wxruby3
|
134
|
+
```
|
135
|
+
|
108
136
|
### Where can I ask a question, or report a bug?
|
109
137
|
|
110
138
|
Use GitHUb Issues.
|
@@ -180,5 +208,9 @@ maintainable solution.
|
|
180
208
|
|
181
209
|
### I am getting an error trying to install or compile wxRuby3
|
182
210
|
|
183
|
-
Please double-check the [INSTALL](INSTALL.md)
|
211
|
+
Please double-check the instructions above and in the [INSTALL](INSTALL.md) document and search issue archives. If
|
184
212
|
this doesn't help, please post your question using GitHub Issues.
|
213
|
+
|
214
|
+
### Is there another, more declarative way, for writing wxRuby3 desktop GUI applications?
|
215
|
+
|
216
|
+
Yes. [Glimmer DSL for WX](https://github.com/AndyObtiva/glimmer-dsl-wx) enables software engineers to build GUI using wxruby3 following the Ruby way with the least amount of code possible. That is by offering a minimalistic declarative high-level DSL that maps visually to the way software engineers think about the GUI hierarchy in addition to adopting Rails' strategy of Convention over Configuration via smart defaults and automation of wxruby3 low-level 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 how to translate wxruby3 apps to [Glimmer DSL for WX](https://github.com/AndyObtiva/glimmer-dsl-wx) syntax.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/wx/core/evthandler.rb
CHANGED
@@ -22,9 +22,17 @@ class Wx::EvtHandler
|
|
22
22
|
# methods; used internally by disconnect (see EvtHandler.i)
|
23
23
|
EVENT_NAME_TYPE_MAP = {}
|
24
24
|
private_constant :EVENT_NAME_TYPE_MAP
|
25
|
+
# Hash to look up event handler arity from symbol names of evt handler
|
26
|
+
# methods; internal use
|
27
|
+
EVENT_NAME_EVENT_ARITY_MAP = {}
|
28
|
+
private_constant :EVENT_NAME_EVENT_ARITY_MAP
|
25
29
|
|
26
30
|
class << self
|
27
31
|
|
32
|
+
def event_type_arity(name)
|
33
|
+
EVENT_NAME_EVENT_ARITY_MAP[name.to_sym] || 0
|
34
|
+
end
|
35
|
+
|
28
36
|
def get_event_type_class_map
|
29
37
|
EVENT_TYPE_CLASS_MAP
|
30
38
|
end
|
@@ -79,8 +87,8 @@ class Wx::EvtHandler
|
|
79
87
|
|
80
88
|
# Given the Integer constant Wx::EVT_XXX, returns the convenience
|
81
89
|
# handler method name associated with that type of event.
|
82
|
-
def self.event_name_for_type(
|
83
|
-
EVENT_NAME_TYPE_MAP.key(
|
90
|
+
def self.event_name_for_type(evt_id)
|
91
|
+
EVENT_NAME_TYPE_MAP.key(evt_id)
|
84
92
|
end
|
85
93
|
|
86
94
|
# Given an integer value +int_val+, returns the name of the EVT_xxx
|
@@ -121,6 +129,8 @@ class Wx::EvtHandler
|
|
121
129
|
return
|
122
130
|
end
|
123
131
|
|
132
|
+
EVENT_NAME_EVENT_ARITY_MAP[ev_type.name.to_sym] = ev_type.arity
|
133
|
+
|
124
134
|
# set up the evt_xxx method
|
125
135
|
case ev_type.arity
|
126
136
|
when 0 # events without an id
|
data/lib/wx/core/font.rb
CHANGED
@@ -1,22 +1,30 @@
|
|
1
1
|
|
2
2
|
require_relative './font/encoding'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
module Wx
|
5
|
+
|
6
|
+
class Font
|
7
|
+
class << self
|
8
|
+
# Returns the name of the platform's default font encoding
|
9
|
+
def get_default_encoding_name
|
10
|
+
ENCODING_NAMES[ get_default_encoding ]
|
11
|
+
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
# Sets the default encoding to be +enc+, which may be the string
|
14
|
+
# name of an encoding (eg 'UTF8') or an internal WxWidgets flag
|
15
|
+
# (eg Wx::FONTENCODING_UTF8).
|
16
|
+
def set_default_encoding_name(enc)
|
17
|
+
if flag_int = ENCODING_NAMES.index(enc.upcase)
|
18
|
+
set_default_encoding(Wx::FontEncoding.new(flag_int))
|
19
|
+
else
|
20
|
+
raise ArgumentError, "Unknown font encoding name '#{enc}'"
|
21
|
+
end
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
25
|
+
|
26
|
+
# make this simply an alias for the Font class so the #find_or_create_font methods
|
27
|
+
# can be accessed through that name too.
|
28
|
+
TheFontList = Font
|
29
|
+
|
22
30
|
end
|
data/lib/wx/core/helpprovider.rb
CHANGED
@@ -6,9 +6,9 @@ class Wx::HelpProvider
|
|
6
6
|
# SWIG Director; it can't be reaped and re-wrapped later. The
|
7
7
|
# easiest way is to make the currently set one an instance variable
|
8
8
|
# of this class
|
9
|
-
|
9
|
+
wx_set = instance_method :set
|
10
10
|
define_method(:set) do | help_provider |
|
11
|
-
|
11
|
+
wx_set.bind(self).call(help_provider)
|
12
12
|
@__hp__ = help_provider
|
13
13
|
end
|
14
14
|
end
|
data/lib/wx/core/menu.rb
CHANGED
data/lib/wx/core/pen.rb
ADDED
data/lib/wx/core/window.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Copyright 2004-2007 by Kevin Smith
|
2
|
-
#
|
2
|
+
# Copyright 2022 by Martin Corino
|
3
|
+
# released under the MIT(-style) wxruby2/3 license
|
3
4
|
|
4
5
|
# The base class for all things displayed on screen
|
5
6
|
class Wx::Window
|
@@ -69,4 +70,30 @@ class Wx::Window
|
|
69
70
|
self.paint(&block)
|
70
71
|
end
|
71
72
|
end
|
73
|
+
|
74
|
+
# implement non-static variants of these
|
75
|
+
|
76
|
+
def from_dip(*args)
|
77
|
+
Wx::Window.from_dip(*args, self)
|
78
|
+
end
|
79
|
+
def to_dip(*args)
|
80
|
+
Wx::Window.to_dip(*args, self)
|
81
|
+
end
|
82
|
+
|
83
|
+
def from_phys(*args)
|
84
|
+
Wx::Window.from_phys(*args, self)
|
85
|
+
end
|
86
|
+
def to_phys(*args)
|
87
|
+
Wx::Window.to_phys(*args, self)
|
88
|
+
end
|
89
|
+
|
90
|
+
# implement Window update locker
|
91
|
+
def locked(&block)
|
92
|
+
self.freeze
|
93
|
+
begin
|
94
|
+
block.call if block_given?
|
95
|
+
ensure
|
96
|
+
self.thaw
|
97
|
+
end
|
98
|
+
end
|
72
99
|
end
|
data/lib/wx/doc/app.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
class Wx::App
|
3
|
+
|
4
|
+
# Set the menu item id for the About menu item.
|
5
|
+
# Default is {Wx::ID_ABOUT}
|
6
|
+
# @param [Integer] id
|
7
|
+
def set_mac_about_menu_itemid(id) end
|
8
|
+
alias :mac_about_menu_itemid= :set_mac_about_menu_itemid
|
9
|
+
|
10
|
+
# Get the current menu item id for the About menu item.
|
11
|
+
# Default is {Wx::ID_ABOUT}
|
12
|
+
# @return [Integer]
|
13
|
+
def get_mac_about_menu_itemid(id) end
|
14
|
+
alias :mac_about_menu_itemid :get_mac_about_menu_itemid
|
15
|
+
|
16
|
+
# Set the menu item id for the Preferences menu item.
|
17
|
+
# Default is {Wx::ID_PREFERENCES}
|
18
|
+
# @param [Integer] id
|
19
|
+
def set_mac_preferences_menu_itemid(id) end
|
20
|
+
alias :mac_preferences_menu_itemid= :set_mac_preferences_menu_itemid
|
21
|
+
|
22
|
+
# Get the current menu item id for the Preferences menu item.
|
23
|
+
# Default is {Wx::ID_PREFERENCES}
|
24
|
+
# @return [Integer]
|
25
|
+
def get_mac_preferences_menu_itemid(id) end
|
26
|
+
alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid
|
27
|
+
|
28
|
+
# Set the menu item id for the Exit menu item.
|
29
|
+
# Default is {Wx::ID_EXIT}
|
30
|
+
# @param [Integer] id
|
31
|
+
def set_mac_exit_menu_itemid(id) end
|
32
|
+
alias :mac_exit_menu_itemid= :set_mac_exit_menu_itemid
|
33
|
+
|
34
|
+
# Get the current menu item id for the Exit menu item.
|
35
|
+
# Default is {Wx::ID_EXIT}
|
36
|
+
# @return [Integer]
|
37
|
+
def get_mac_exit_menu_itemid(id) end
|
38
|
+
alias :mac_exit_menu_itemid :get_mac_exit_menu_itemid
|
39
|
+
|
40
|
+
end
|
data/lib/wx/doc/brush.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class Brush
|
5
|
+
|
6
|
+
# Finds a brush with the specified attributes in the global list and returns it, else creates a new brush, adds it to the global brush list, and returns it.
|
7
|
+
# @param [Wx::Colour,String,Symbol] colour The Brush colour.
|
8
|
+
# @param [Wx::BrushStyle] style The brush style. See {Wx::BrushStyle} for a list of the styles.
|
9
|
+
# @return [Wx::Brush]
|
10
|
+
def self.find_or_create_brush(colour, style=Wx::BrushStyle::BRUSHSTYLE_SOLID) end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
# In wxRuby this is simply an alias for the Brush class.
|
15
|
+
TheBrushList = Wx::Brush
|
16
|
+
|
17
|
+
end
|
data/lib/wx/doc/font.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
class Wx
|
3
|
+
class Font
|
4
|
+
|
5
|
+
# @overload find_or_create_font(point_size, family, style, weight, underline=false, facename='', encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
|
6
|
+
# Finds a font of the given specification in the global font list, or creates one and adds it to the list.
|
7
|
+
# @param [Integer] point_size Size in points. See {Wx::Font#set_point_size} for more info.
|
8
|
+
# @param [Wx::FontFamily] family The font family: a generic portable way of referring to fonts without specifying a facename.
|
9
|
+
# @param [Wx::FontStyle] style One of {Wx::FontStyle::FONTSTYLE_NORMAL}, {Wx::FontStyle::FONTSTYLE_SLANT} and {Wx::FontStyle::FONTSTYLE_ITALIC}.
|
10
|
+
# @param [Wx::FontWeight] weight Font weight, sometimes also referred to as font boldness. One of the {Wx::FontWeight} enumeration values.
|
11
|
+
# @param [Boolean] underline The value can be true or false.
|
12
|
+
# @param [String] facename An optional string specifying the face name to be used. If it is an empty string, a default face name will be chosen based on the family.
|
13
|
+
# @param [Wx::FontEncoding] encoding An encoding which may be one of the enumeration values of {Wx::FontEncoding}. If the specified encoding isn't available, no font is created (see also Font Encodings).
|
14
|
+
# @return [Wx::Font]
|
15
|
+
# @see Wx::Font#initialize
|
16
|
+
# @overload find_or_create_font(font_info)
|
17
|
+
# Finds a font of the given specification in the global font list, or creates one and adds it to the list.
|
18
|
+
# @param [Wx::FontInfo] font_info
|
19
|
+
# @return [Wx::Font]
|
20
|
+
def self.find_or_create_font(*args) end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
# In wxRuby this is simply an alias for the Font class.
|
25
|
+
TheFontList = Font
|
26
|
+
|
27
|
+
end
|
data/lib/wx/doc/pen.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class Pen
|
5
|
+
|
6
|
+
# Finds a pen with the specified attributes in the global list and returns it, else creates a new pen, adds it to the global pen list, and returns it.
|
7
|
+
# @param [Wx::Colour, String, Symbol] colour Colour of the pen.
|
8
|
+
# @param [Integer] width Width of the pen.
|
9
|
+
# @param [Wx::PenStyle] style Pen style. See {Wx::PenStyle} for a list of styles.
|
10
|
+
# @return [Wx::Pen]
|
11
|
+
def self.find_or_create_pen(colour, width=1, style=Wx::PenStyle::PENSTYLE_SOLID) end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
ThePenList = Wx::Pen
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
class Wx::RadioBox
|
3
|
+
|
4
|
+
# Enables od disables individual buttons.
|
5
|
+
# true if the item has been enabled or disabled or false if nothing was done because it already was in the requested state.
|
6
|
+
# @see Wx::Window#enable
|
7
|
+
# @param item [Integer] The zero-based position of the button to enable or disable.
|
8
|
+
# @param enable [true,false] true to enable, false to disable.
|
9
|
+
# @return [true,false]
|
10
|
+
def enable_item(item, enable=true) end
|
11
|
+
|
12
|
+
# Shows or hides individual buttons.
|
13
|
+
# true if the item has been shown or hidden or false if nothing was done because it already was in the requested state.
|
14
|
+
# @see Wx::Window#show
|
15
|
+
# @param item [Integer] The zero-based position of the button to show or hide.
|
16
|
+
# @param show [true,false] true to show, false to hide.
|
17
|
+
# @return [true,false]
|
18
|
+
def show_item(item, show=true) end
|
19
|
+
|
20
|
+
end
|
data/lib/wx/doc/window.rb
CHANGED
@@ -15,4 +15,31 @@ class Wx::Window
|
|
15
15
|
# @return [Object] result from block
|
16
16
|
def paint_buffered; end
|
17
17
|
|
18
|
+
# Locks the window from updates while executing the given block.
|
19
|
+
# @param [Proc] block
|
20
|
+
def locked(&block); end
|
21
|
+
|
22
|
+
# Find the first child window with the given id recursively in the window hierarchy of this window.
|
23
|
+
#
|
24
|
+
# Window with the given id or nil if not found.
|
25
|
+
# @see Wx::Window.find_window_by_id
|
26
|
+
# @param id [Integer]
|
27
|
+
# @return [Wx::Window]
|
28
|
+
def find_window_by_id(id) end
|
29
|
+
|
30
|
+
# Find the first child window with the given label recursively in the window hierarchy of this window.
|
31
|
+
#
|
32
|
+
# Window with the given label or nil if not found.
|
33
|
+
# @see Wx::Window.find_window_by_label
|
34
|
+
# @param label [String]
|
35
|
+
# @return [Wx::Window]
|
36
|
+
def find_window_by_label(label) end
|
37
|
+
|
38
|
+
# Find the first child window with the given name (as given in a window constructor or {Wx::Window#create} function call) recursively in the window hierarchy of this window.
|
39
|
+
#
|
40
|
+
# Window with the given name or nil if not found.
|
41
|
+
# @param name [String]
|
42
|
+
# @return [Wx::Window]
|
43
|
+
def find_window_by_name(name) end
|
44
|
+
|
18
45
|
end
|