Commit Graph

70663 Commits

Author SHA1 Message Date
Vadim Zeitlin
c8c55be4ab Merge branch 'cmake-wxconfig' of https://github.com/MaartenBent/wxWidgets
Fix wx-config generation in CMake build.

See https://github.com/wxWidgets/wxWidgets/pull/2353

Closes #19164.
2021-05-01 14:10:21 +02:00
Vadim Zeitlin
2f86a2e82d Make helper functions used by wxImage::ApplyToAllPixels() static
Also put WeightValue inside an anonymous namespace.

No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/2310
2021-05-01 14:05:14 +02:00
Tomay
0e39566b3a Add wxImage Change{Saturation,Brightness,HSV,Lightness}()
Add more functions for manipulating wxImage colours.

Show using them in the same and add new unit tests for them.

This is a squashed commit of branch 'tomay3000/image-lightness'.

Closes https://github.com/wxWidgets/wxWidgets/pull/2310
2021-05-01 14:03:04 +02:00
Paul Cornett
3217a4e8a2 Fix best size for windows which are hidden when TLW is shown with GTK3
GTK3's style cache is not updated for hidden windows until after they are shown
See #16088
2021-04-30 12:15:33 -07:00
Stefan Csomor
228f5becab
adding bridging info to our own definitions (#2354)
attempt to solve #19159
2021-04-30 18:10:21 +02:00
Vadim Zeitlin
236e77c263 Don't use variable length arrays in wxFileName::ResolveLink()
Use wxVector<> instead of relying on compiler support for VLAs which is
not standard and shouldn't be required.

This fixes compilation using OpenVMS compiler after the changes of
53bd1391f4 (Add a new wxFileName function to resolve symlinks to
absolute paths, 2021-04-01).
2021-04-30 13:43:26 +02:00
Maarten Bent
e000f0d1a8 CMake: add '-l' prefix to all library dependencies 2021-04-29 21:48:29 +02:00
Maarten Bent
dd274289bd CMake: don't define WXUSINGDLL in wx-config for static library 2021-04-29 21:48:29 +02:00
Vadim Zeitlin
1e4f0a370f Merge branch 'drop-vc7'
Remove MSVS 2003 support.

See https://github.com/wxWidgets/wxWidgets/pull/2351

Closes #18821.
2021-04-27 14:10:06 +02:00
Vadim Zeitlin
1c8af332cf Only set wxLocale as active once it has been fully initialized
Previously wxLocale object was set as the global local as soon as it was
created, even when the default ctor was used, i.e. the locale wasn't
really changed at all. This was always wrong, but only started to result
in visible problems since the changes of c6d6ec9295 (Merge branch
'msw-fix-decimal-point' of https://github.com/vslavik/wxWidgets,
2021-04-18) as we now could use the existing but not yet active locale
when checking for the decimal separator mismatch, resulting in spurious
asserts.

Fix this by postponing the call to wxSetLocale() and the rest of what
was previously done in the ctor until Init() is called (which is done by
all non default ctors).

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

Closes #19154.
2021-04-27 14:09:41 +02:00
Vadim Zeitlin
17e0f23cd0 Merge branch 'listctrl-fixes'
Various generic wxListCtrl fixes and improvements.

Closes https://github.com/wxWidgets/wxWidgets/pull/2340
2021-04-27 14:08:38 +02:00
Ian McInerney
f556a34086 Remove the mentions of the native OSX wxListCtrl control
This control was removed during the Carbon code removal in commit
5ba67c67e4, so the system option
does nothing now (and was only mentioned in the documentation
and the sample).
2021-04-27 14:07:46 +02:00
Ian McInerney
48b1175f61 Update the documentation for wxListCtrl column ordering 2021-04-27 14:07:46 +02:00
Ian McInerney
797bc2c087 Introduce ABI shims for wxListCtrl column ordering functions
This way it is easier to add the functions later on without
breaking ABI.
2021-04-27 14:07:46 +02:00
Ian McInerney
e0ef3830c1 Fix centering of images in wxListCtrl items when selected
Closes #11331.
2021-04-27 14:07:36 +02:00
Vadim Zeitlin
1671a21e7c Fix crash when scrolling wxGrid in which scrolling is disabled
If "pixels per line" is set to 0, indicating that scrolling is disabled,
just don't scroll in the corresponding direction instead of dividing by
zero.

Closes https://github.com/wxWidgets/wxWidgets/pull/2323
2021-04-27 13:58:49 +02:00
Vadim Zeitlin
99f2d0ee2b Update the minimum required MSVS version to 2005 2021-04-26 16:28:55 +02:00
Vadim Zeitlin
8b854d2f92 Remove MSVC 7 project files and support for generating them
This compiler is not supported any longer.
2021-04-26 16:24:02 +02:00
Vadim Zeitlin
41268e014d Remove MSVS 2003, a.k.a. MSVC 7, support from the code
It was probably not supported since quite some time anyhow, because wx
own code uses CallAfter() which wouldn't compile with it, but now we can
can get rid of wxHAS_CALL_AFTER checks too.
2021-04-26 15:18:39 +01:00
Vadim Zeitlin
84bcc109ad Merge branch 'cxx20-warning-fixes'
Build fixes for gcc 11 and clang 12, including in C++ 20 mode.

See https://github.com/wxWidgets/wxWidgets/pull/2347
2021-04-26 16:10:33 +02:00
Vadim Zeitlin
86d1a25624 Merge branch 'winsock-2'
Use WinSock 2 rather than 1.1 by default and also enable IPv6 support,
requiring WinSock 2, by default now that it can be done.

See https://github.com/wxWidgets/wxWidgets/pull/2335

Closes #15562.
2021-04-26 15:07:13 +01:00
Vadim Zeitlin
eef5fa245b Update wxSpinCtrlDouble::SetValue() documentation too
This should have been done together with the other related updates in
35fa1f93bc (Reset wxSpinCtrl value to GetMin() if text string is
invalid, 2021-04-23), but was forgotten there.

See #19140.
2021-04-26 15:06:04 +01:00
Vadim Zeitlin
95c98a0b5f Work around -Wuggest-override for event table macros from gcc 11
Disabling -Wsuggest-override inside macros is broken in gcc, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578, and has started
affecting wxWARNING_SUPPRESS_MISSING_OVERRIDE since gcc 11, i.e. this
macro doesn't have any effect any more and the warning is still given.

Avoid it by actually specifying "override" for gcc 11 (as doing it for
all compilers would result in -Winconsistent-missing-override from
clang) and check that we don't get this warning in the allheaders test.

Also don't use wxDECLARE_ABSTRACT_CLASS() inside wxObject itself, now
that it uses "override", which is not appropriate for the base class
version. This is arguably more clear and should have been done like this
since the beginning anyhow.
2021-04-26 11:55:33 +02:00
Vadim Zeitlin
ccbf0b2f9a Define wxDataFormat comparison operator overload taking it itself
We still can't avoid defining the overload taking NativeFormat due to an
ambiguity that we would have otherwise between converting from
NativeFormat to wxDataFormat or vice versa when comparing them (it would
have been better to avoid implicit conversions in all directions, of
course, but this is how it was done back in e1ee679c2e (wxDataObejct and
related changes (won't compile right now), 1999-10-21) and it's too late
to change it now), but we can at least define an overload taking
wxDataFormat itself and not wxDataFormatId to make things slightly more
logical and avoid -Wambiguous-reversed-operator clang 12 warnings.
2021-04-26 11:44:40 +02:00
Vadim Zeitlin
c85267184e Simplify wxDataFormat comparison and avoid clang warning
Comparing wxDataFormat directly with wxDF_XXX is supposed to work too
and doing it like this avoids -Wambiguous-reversed-operator from clang
12.
2021-04-26 11:44:40 +02:00
Vadim Zeitlin
ffc3168f6f Make wxFontBase::operator==() symmetric by taking wxFontBase
Taking wxFont here resulted in a potential ambiguity when comparing
wxFont objects, at least according to clang 12 in C++20 mode.

Avoid this by just taking wxFontBase here, as now the operator is fully
symmetric, rather than exactly matching only (wxFontBase, wxFont) and
matching (wxFont, wxFont) either directly or with reversed arguments
order.
2021-04-26 11:44:40 +02:00
Vadim Zeitlin
51cb0e53b1 Use wxMEMBER_DELETE instead of "Disabled" comment
No real changes, but this is more clear and should result in better
error messages.
2021-04-25 18:59:20 +02:00
Vadim Zeitlin
7f246330de Remove wrong template arguments from wxArgNormalized ctors
Ctor of a template class specialization shouldn't actually repeat the
specialized template arguments, as it was done in 65cbf40b7e (Add
wxNO_UNSAFE_WXSTRING_CONV2 macro, 2019-10-21), so remove them because
this doesn't compile with g++ 11, even though it (wrongly?) did with the
previous gcc versions.
2021-04-25 18:59:20 +02:00
Vadim Zeitlin
3d278ee75f Avoid warnings about operations on different enums in C++20 mode
Arithmetic operations on the elements of different enums are deprecated
in C++20 and the latest compiler versions warn about them.

While individual warnings could be fixed in wxWidgets itself (although
it would be quite an effort to do it for all ~500 of them), it wouldn't
help with the same warnings in the applications using wx, so prefer to
do it by explicitly defining the operations on the enums that can be
combined with each other by using wxALLOW_COMBINING_ENUMS() macro,
except for a single warning in wxTar code where it's easier to just not
use an anum at all.
2021-04-25 18:59:20 +02:00
Vadim Zeitlin
5ab5172930 Avoid warnings about mixing different enums with C++20
C++20 deprecates arithmetic operations with the elements of different
enums and at least clang 10 and MSVS 2019 already warn about this when
compiling in C++20 mode, so avoid such operations at least in the public
headers to avoid warnings in the applications using wxWidgets and C++20.
2021-04-24 19:06:49 +01: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
PB
31b983bad1 Make menu sample build when using precompiled headers
Headers wx/filehistory.h and wx/filename.h were included only
when WX_PRECOMP was not defined.

However, these two files are not included in wx/wxprec.h,
so they must be always included directly.

Closes https://github.com/wxWidgets/wxWidgets/pull/2344
2021-04-24 13:34:54 +02:00
Vadim Zeitlin
343d24ec32 Merge branch 'spinctrl-value'
Consistently return minimum value from wxSpinCtrl with invalid text
value.

See https://github.com/wxWidgets/wxWidgets/pull/2345
2021-04-24 11:20:31 +02:00
Manuel Garcia
4b41daab13 Replace su with sudo in docs/gtk/install.md
Closes https://github.com/wxWidgets/wxWidgets/pull/2343
2021-04-24 00:41:22 +02:00
Vadim Zeitlin
db22d12a47 Merge branch 'osx-dataview-native-key'
Implement wxEVT_CHAR generation for wxDataViewCtrl under Mac.

Closes https://github.com/wxWidgets/wxWidgets/pull/2324
2021-04-24 00:40:15 +02:00
Vadim Zeitlin
16ba1daebf Use wxOVERRIDE in wx/osx/cocoa/dataview.h
No real changes, just add wxOVERRIDE.
2021-04-24 00:38:29 +02:00
Vadim Zeitlin
e46b6d7758 Also remove useless wxDataViewCtrl::OnMouse() from Mac version
This empty event handler doesn't do anything useful.
2021-04-24 00:32:14 +02:00
Vadim Zeitlin
ccdfd28b48 Remove empty wxDataViewCtrl::OnChar() added in the parent commit
This is not really useful to have, so just remove it.
2021-04-24 00:31:17 +02:00
Stefan Csomor
26d6f82a81 Implement EVT_CHAR generation for wxDataViewCtrl under Mac
This requires manually sending the original key event back to the native
control because NSOutlineView doesn't implement the NSTextInputClient
protocol and so doesn't allow handling the keys in the usual way.
2021-04-24 00:30:30 +02:00
Stefan Csomor
18c45321f4 Return bool from wxWidgetCocoaImpl::doCommandBySelector()
This allows to determine whether the event was handled by wx code and
perform further processing by feeding things back to native code if not.
2021-04-24 00:27:26 +02:00
Vadim Zeitlin
fb88a3f3eb Don't use last valid value in wxGTK wxSpinCtrl with text override
This partially undoes the recent changes to wxGTK wxSpinCtrl and reverts
to the previous behaviour, which was actually compatible with wxMSW, and
returns the minimum value when the text of the control is set to an
invalid string.
2021-04-23 23:43:49 +02:00
Vadim Zeitlin
06f368be54 Use wxON_BLOCK_EXIT_SET() in wxMSW wxSpinCtrl code
Ensure that m_blockEvent flag is always reset on the scope exit.

No real changes.
2021-04-23 22:37:15 +01:00
Vadim Zeitlin
8fc2d44004 Don't generate events from wxMSW wxSpinCtrl::SetValue(wxString)
The function was documented to not generate the events, but actually
did generate wxEVT_TEXT ones, even if it didn't generate wxEVT_SPINCTRL.

This was inconsistent with wxGTK and generic wxSpinCtrlDouble used under
MSW, so change this to avoid the unwanted events.
2021-04-23 22:30:59 +01:00
Vadim Zeitlin
35fa1f93bc Reset wxSpinCtrl value to GetMin() if text string is invalid
Previously, wxSpinCtrl (using native control) and wxSpinCtrlDouble
(using the generic implementation) behaved differently in this case,
with the former changing its value but the latter keeping the last valid
value instead.

Make them behave the same by resetting the value in both cases and
document this behaviour.
2021-04-23 22:27:28 +01:00
Vadim Zeitlin
2973d75f25 Explain in more details how to build applications using wx
We didn't document using wxwin.m4 at all anywhere, so do it at least
minimally now (we still need a separate page documenting its full
functionality) and also show a simple makefile using wx-config.

Closes https://github.com/wxWidgets/wxWidgets/pull/2338
2021-04-23 21:48:11 +02:00
Vadim Zeitlin
c67e689bb5 Fix left over control in wxSpinCtrlDouble unit tests
Fix the bug introduced in the recent 34ab87ce4d (Get rid of CppUnit
boilerplate in wxSpinCtrlDouble unit test, 2021-04-19) which resulted in
failures in the subsequent unit tests and ensure that the spin control
is destroyed at the end of the test.
2021-04-23 21:45:35 +02:00
Vadim Zeitlin
3fc404372f Temporarily disable failing wxSpinCtrl unit test
wxSpinCtrl::GetValue() behaviour after calling SetValue("") is currently
inconsistent between wxMSW and wxGTK, or even between wxSpinCtrl and
wxSpinCtrlDouble in wxMSW.

Disable the recently added test checking it for now.
2021-04-23 17:28:34 +02:00
Vadim Zeitlin
c89a8f973c Merge branch 'im/stdheaders' of https://github.com/imciner2/wxWidgets
Don't enable warnings in the system headers during all headers test.

See https://github.com/wxWidgets/wxWidgets/pull/2342
2021-04-23 00:04:21 +02:00
PB
b7b4e1a530 Document that wxMatchWild() is always case-sensitive
Closes https://github.com/wxWidgets/wxWidgets/pull/2337
2021-04-22 23:57:02 +02:00
Vadim Zeitlin
87fddbdbdb Merge branch 'spinctrl-gettextvalue'
Add wxSpinCtrl::GetTextValue() and allow clearing the text value in
wxGTK version for compatibility with MSW.

See https://github.com/wxWidgets/wxWidgets/pull/2334
2021-04-22 23:55:30 +02:00