Commit Graph

506 Commits

Author SHA1 Message Date
PB
bf2b837fd2 Update comments in setup_inc.h and various wx/setup.h files
Update the outdated or just plain incorrect comments.

See #22857.

(cherry picked from commit c22f6ba4fc0b49631ea85f2566490d1066f23a65)
2022-11-12 17:47:15 +01:00
Lauri Nurmi
b6803cdfd2 Fix double negatives used with 'neither' in docs and comments
In many cases it should be 'either', and 'nor' should be 'or'
accordingly.

No changes to actual code.

See #22723.

(cherry picked from commit 66916c74a3d44e8bc1b30cf42309e36e5d9e9135)
2022-08-19 16:30:25 +02:00
Vadim Zeitlin
c0dbe808a6 Move SetBitmap() and GetBitmap() to wxMenuItemBase
Ensure that all derived classes have these functions and let them to
avoid defining them if they can just use the default implementation,
which was the case for most ports.

Also move m_bitmap to the base class from the derived ones.

No real changes.
2022-06-16 01:09:43 +01:00
Vadim Zeitlin
7f3baa9abf Rename wxMenuItem::m_bmpChecked to m_bitmap in wxMSW and wxUniv
These two ports were the only ones to use something other than m_bitmap
for wxBitmapBundle storing the item bitmap, rename it for consistency
with the other ports and to allow moving this field into the base class
in the upcoming commit.

No real changes.
2022-06-14 18:27:07 +01:00
Maarten Bent
931370f0ad Add NanoSVG setup options
An option to enable or disable using NanoSVG for rasterizing SVG files.
And an option to indicate an external NanoSVG library is used.
2022-05-05 22:15:49 +02:00
Vadim Zeitlin
5fcea04d71 Take wxBitmapBundle in wxMenuItem::SetBitmap() in all ports
Update the remaining ports to take wxBitmapBundle rather than wxBitmap
as well to make their API consistent with the tier 1 ports -- even if
there is no actual support for choosing the resolution-appropriate
bitmap in them yet.
2022-02-20 18:06:09 +01:00
Tobias Taschner
57ebad4f7d
Allow usage of static loader with wxWebViewEdge
Add a new build option wxUSE_WEBVIEW_EDGE_STATIC.
If it is set to 1 the WebView2 loader is static linked into the binary
and removes the runtime dependency on WebView2Loader.dll.
2022-02-07 22:49:33 +01:00
Vadim Zeitlin
3abec9254f Take wxBitmapBundle in wxStaticBitmap::SetBitmap()
This allows using higher resolution bitmaps when using high DPI
automatically in this control too.
2021-10-26 00:11:57 +02:00
Vadim Zeitlin
b403624f22 Add common implementations of wxStaticBitmap icon methods
Instead of defining them, slightly differently, in all the non-MSW
ports, define them once in wxStaticBitmapBase.

No real changes, this is just a simplification.
2021-10-25 13:40:18 +01:00
Vadim Zeitlin
1fb7b13812 Fix typo in "class" in wxUSE_STOPWATCH comment
Closes https://github.com/wxWidgets/wxWidgets/pull/2556
2021-10-22 01:42:53 +02:00
Vadim Zeitlin
4e5d2d97e2 Allow using wxBitmapBundle for wxButton bitmaps
Take wxBitmapBundle in wxButton::SetBitmapLabel() and related functions
in order to be able to associate several bitmaps to be used in different
resolutions with the button, instead of just a single bitmap.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
af1069374e Merge branch 'bitmap-bundle'
Add wxBitmapBundle and use it in wxToolBar.

See https://github.com/wxWidgets/wxWidgets/pull/2535
2021-10-05 18:58:18 +02:00
Vadim Zeitlin
97f6c85d9b Add first version of wxBitmapBundle and use it in wxToolBar
This first version provides only a generic implementation of
wxBitmapBundle using a collection of bitmaps and only supports using it
in wxToolBar in wxMSW and wxGTK.

More methods of creating wxBitmapBundle will be provided later and more
functions taking wxBitmap will be changed to take wxBitmapBundle later
too and, of course, all the other ports will be updated to use the new
API too.
2021-10-05 15:49:43 +01:00
Blake Madden
668a2186cd Fix comment typos in sources
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/2541
2021-10-03 17:07:44 +02:00
Vadim Zeitlin
d9ea30cf84 Always set wxUSE_SPELLCHECK to 1 by default for simplicity
It does no real harm to set it to 1 and this avoids the need for the
platform checks in setup.h files, simplifying things (although it does
require checking for GTK 3 in the code compiled for both GTK 2 and 3, as
gtkspell library can only be used with GTK 3).
2021-08-23 14:16:16 +02:00
iwbnwif
472aec2d7e Add support for using native spell checking in wxTextCtrl
Add wxTextCtrl::EnableSpellCheck() and implement it for wxMSW and
wxGTK3.

Closes #17544.
2021-08-23 14:15:38 +02:00
Vadim Zeitlin
5d0b3c1129 Merge branch 'univ_textctrl_fixtest' of https://github.com/Kvaz1r/wxWidgets
Fix multiple problems in wxUniv wxTextCtrl, allowing it to pass more
unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/2447
2021-08-17 23:47:03 +02:00
Kvaz1r
e3acc50fbc Improve wxTE_PROCESS_ENTER handling in wxUniv 2021-08-07 10:42:22 +03:00
Kvaz1r
5d1a936f73 Revert "Handle WM_GETDLGCODE in wxTextCtrl for wxUniv too"
This reverts commit af8b662868.
2021-08-07 09:40:26 +03:00
Arrigo Marchiori
30915c6163 Make wxrc independent from GUI support
The wxrc program does not depend on the GUI libraries, but only on
the base and XML libraries, so make it possible to build it in non-GUI
builds too.

Closes https://github.com/wxWidgets/wxWidgets/pull/2419
2021-08-06 21:51:11 +02:00
Kvaz1r
af8b662868 Handle WM_GETDLGCODE in wxTextCtrl for wxUniv too 2021-08-02 10:05:37 +03:00
Vadim Zeitlin
27d0e7804c Replace DoGetBorderSize() with GetWindowBorderSize()
We accidentally ended up with two functions doing the same thing, since
DoGetBorderSize() was added in 743b426605 (Added DoGetClientBestSize()
and use it for a couple of controls in wxMSW., 2009-06-22), as we
already had GetWindowBorderSize() added even earlier in 333d70525c
(added wxWindow::GetWindowBorderSize(), 2006-11-25), so remove the
redundant non-public function and use GetWindowBorderSize() everywhere.

This does change the behaviour of GetWindowBorderSize() in wxMSW, wxGTK
and wxUniv, as it now does what DoGetBorderSize() used to do, but this
should be an improvement, as DoGetBorderSize() implementation was more
precise.
2021-07-24 21:18:45 +02:00
Kvaz1r
0a241d2dfc Don't send events for non-item 2021-07-13 11:38:39 +03:00
Kvaz1r
2209ec29f7 Add handling LEFT_UP 2021-06-27 21:50:09 +03:00
Kvaz1r
05875a76e9 Fix handling mouse capture 2021-06-26 17:11:41 +03:00
Tim Stahlhut
e80ab67b54 Fix wxUniv/MSW build by defining MSW-specific wxUSE_XXX options
Add definitions of the missing MSW-specific options to wx/univ/setup.h
to avoid errors in wx/msw/chkconf.h when building wxUniv.

Closes https://github.com/wxWidgets/wxWidgets/pull/2355
2021-05-01 14:28:13 +02:00
Vadim Zeitlin
bf5090bcf3 Enable Winsock 2 and IPv6 build options by default
In addition to linking with Winsock 2, also use winsock2.h.

This allows to turn on IPv6 support on by default under MSW, so turn it
on under Unix too for consistency.

Predefine _WINSOCK_DEPRECATED_NO_WARNINGS to avoid warnings about
deprecated (but still available and very unlikely to be ever removed)
Winsock 1 functions that we still use.
2021-04-24 18:06:43 +01:00
Vadim Zeitlin
d1810b0dce Remove setup0.h files
Simplify things by putting setup.h files themselves under version
control and getting rid of setup0.h ones.

The initial motivation for using separate setup0.h files was to allow
having local changes to setup.h, but with Git there is a simple way to
do it by using "git update-index --skip-worktree include/wx/msw/setup.h"
for example, so we don't really need setup0.h any more and dropping them
makes things simpler.
2021-01-31 19:02:56 +01:00
Vadim Zeitlin
181be127a5 Simplify wxUSE_WEBREQUEST_XXX logic
Remove automatic definition of wxUSE_WEBREQUEST depending on whether
wxUSE_WEBREQUEST_XXX are defined and follow the same approach as with
wxUSE_GRAPHICS_XXX, i.e. define wxUSE_WEBREQUEST_XXX as wxUSE_WEBREQUEST
by default instead.

Move wxUSE_WEBREQUEST_WINHTTP to wxMSW-specific file, it doesn't need to
be in common one (unfortunately this can't be done for the Mac-specific
wxUSE_WEBREQUEST_URLSESSION yet, because macOS-specific settings are not
injected into setup.h.in currently).

Also fix test for winhttp.h availability: it seems to be present in all
MinGW64 distributions, but not in MinGW32, so test for this and not for
gcc version.

Finally remove the now unnecessary test for macOS 10.9, as we only
support 10.10+ anyhow by now.
2020-12-13 16:34:47 +01:00
Vadim Zeitlin
5c3db1574e Fix typo and slightly improve wxUSE_WEBREQUEST_CURL comment 2020-12-13 00:10:28 +01:00
Vadim Zeitlin
6bdab7b3c8 Merge branch 'master' into web-request
Merge with the latest master in preparation for merging into master.

Rebake to resolve conflicts in generated files.
2020-12-12 18:12:25 +01:00
Vadim Zeitlin
712c2d4004 Add possibility to create "Close" bitmap button from XRC
This requires refactoring NewCloseButton() in order to extract
CreateCloseButton() from it, as XRC relies on being able to use two-step
creation which was previously impossible for this kind of buttons.

CreateCloseButton() is rather unusual, as it has to be declared in the
derived, platform-specific class, in order to be able to call its
Create(), but is defined only once in common, platform-independent,
code. However the only alternative seems to be to have a static
function, e.g. InitCloseButton(), which wouldn't be very pretty neither.

Closes https://github.com/wxWidgets/wxWidgets/pull/2118
2020-11-19 15:44:54 +01:00
Vadim Zeitlin
bcb016613e Make wxRadioButtonBase a plain class, not template
Use a dirty hack to accommodate wxUniv by deriving wxRadioButtonBase
from wxCheckBox, rather than wxControl, there. This is not pretty, but
should be addressed by refactoring wxUniv code and in the meanwhile all
the other ports don't have to bother with using a template class
unnecessarily.
2020-09-21 18:01:37 +02:00
Vadim Zeitlin
3d72c009be Add wxRadioButtonBase::{Set,Get}Value()
Now that we do have wxRadioButtonBase class, declare wxRadioButton API
methods as pure virtual in it, to force the derived classes to implement
them.

Also remove the outdated comment saying that there is no base class for
wxRadioButtons in different ports, this is not true any longer.
2020-09-21 16:13:55 +02:00
Stefan Csomor
92ea83f00b First implementation 2020-09-17 22:35:22 +02:00
Scott Talbert
7cd12a2bd6 Add EGL-based backend for wxGLCanvas
Among other things, this enables wxGLCanvas to be used natively on
Wayland.

Closes https://github.com/wxWidgets/wxWidgets/pull/2038

Closes #17702.
2020-09-01 15:03:30 +02:00
Vadim Zeitlin
dca6f310bb Replace C-style cast with const_cast<> in wxUniv
Don't use C casts to remove const-ness (avoids gcc -Wcast-qual).
2020-08-31 01:25:45 +02:00
Arrigo Marchiori
c86bcf962d Use wxASCII_STR() on string literals
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +02:00
Stefan Csomor
f80ac025ba added wxUSE_MENUBAR
for platforms like iOS where menus are available but menubars are not we need a finter level of control
2020-06-28 22:59:00 +02:00
Vadim Zeitlin
d7f19ee610 Fix spelling in comments and documentation using codespell
Apply the utility from https://github.com/codespell-project/codespell/
to fix spelling issues in the headers under both include and interface
directories and add a file with a couple of exceptions.

The exact command line used was:

    $ codespell -w -I misc/scripts/codespell.ignore -i 3 in*
2020-06-27 22:56:22 +02:00
Vadim Zeitlin
767c07c040 Merge branch 'webview-edge'
Add support for (optionally) using Edge-based wxWebView.

See https://github.com/wxWidgets/wxWidgets/pull/1700
2020-01-22 03:38:00 +01:00
Tobias Taschner
21cc8a4e49
Update setup.h files 2020-01-15 15:58:30 +01:00
Tobias Taschner
1afeaa324d
Added new build option wxUSE_WEBVIEW_EDGE 2020-01-10 21:42:18 +01:00
Vadim Zeitlin
52ae67ef86 Replace dynamic casts with virtual wxWindow::WXGetTextEntry()
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.

This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1696
2020-01-09 23:25:49 +01:00
Vadim Zeitlin
89be9ac316 Fix comment for wxUSE_NATIVE_DATAVIEWCTRL in setup.h
The values of the option in the comment were inversed when it was added
in 028afa194a, fix this now.
2020-01-03 18:05:02 +01:00
Vadim Zeitlin
028afa194a Add wxUSE_NATIVE_DATAVIEWCTRL build option
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.

This can, unfortunately, be useful to work around various but multiple
native control limitations.
2019-12-15 16:23:47 +01:00
Vadim Zeitlin
cdc588e4eb Don't resize the parent from wxToolBar::SetSize() in wxUniv
This could result in infinite recursion in wxX11, as the test for the
new size being different from the old one which was supposed to stop the
recursion, failed there in case the new size was 0: as wxX11 can't use 0
size for the window, the actual size was always different and so we kept
sending size events to the parent, which kept resizing the toolbar etc.

It could be argued that there is a bug in wxX11 and that GetSize() must
return the same value as was passed to SetSize(), even if it was 0, and
this might even be correct, in theory, but it doesn't seem worth to do
it just to accommodate this weird use case, especially because resizing
the parent from the child shouldn't be necessary in the first place and
none of wxToolBar implementations in the other ports does it.

So just remove this code completely.

Closes #18554.
2019-11-06 15:06:36 +01:00
Vadim Zeitlin
d7a640933d Remove wxUSE_WCHAR_T, it must always be 1 anyhow
This is not really an option as building requires it to be 1, so don't
make it one in setup.h/configure/cmake and just hardcode it as 1 for
compatibility.

Closes #18558.
2019-10-31 02:16:19 +01:00
Vadim Zeitlin
fc711f869f Remove obsolete wxUSE_IOSTREAMH option
This is always 0 for any still supported compiler, so remove the option
and configure checks for it.

Still define it as 0 for compatibility, just in case it's used outside
of the library.
2019-10-21 20:46:21 +02:00
Vadim Zeitlin
b53e9e2006 Rename wxStaticText::Do[SG]etLabel() to WX[SG]etVisibleLabel()
The names of these methods were confusing because they implied that they
were the actual implementations of the public [SG]etLabel(), while this
wasn't at all the case.

Give them then ames describing what they really do and also update the
comments to hopefully be more clear.

No real changes.
2019-06-19 18:15:57 +02:00