Commit Graph

69101 Commits

Author SHA1 Message Date
Rob McKay
94e8129f3f Explicitly specify application class in wxiOS
Although @"UIApplication" is supposed to be used by default anyhow,
passing "nil" is reported to result in an assertion failure in
'_UIApplicationGetPrincipalClass' when running under the iOS 13.1
simulator, so pass this string explicitly.

Closes https://github.com/wxWidgets/wxWidgets/pull/2035
2020-09-01 14:57:29 +02:00
Vadim Zeitlin
b9f946fcd3 Merge branch 'check-headers-max-warn'
Check compilation of all wx headers with all gcc warnings enabled.

This should make it impossible to introduce problems that only appear
when -Wpedantic or -Wany-other-not-completely-unreasonable-warning is
enabled when building user code including wx headers again.

See https://github.com/wxWidgets/wxWidgets/pull/2033
2020-08-31 15:10:16 +02:00
Arrigo Marchiori
629c4aac97 Add EXEEXT to the wxrc versioned executable
Fix name of wxrc executable when cross-compiling from Unix.

Note that the Makefile hasn't been rebaked after the changes of
f3bd129568 (Append WX_FLAVOUR to the name of wxrc executable,
2020-08-06), so this commit reflects the changes to wxrc.bkl from both
that commit and this one.

Closes https://github.com/wxWidgets/wxWidgets/pull/2041
2020-08-31 14:59:39 +02:00
Vadim Zeitlin
be2a61519b Merge branch 'grid-selected'
Split the wxGrid RANGE_SELECT event into separate SELECTING and SELECTED
events.

See https://github.com/wxWidgets/wxWidgets/pull/2028
2020-08-31 14:55:56 +02:00
Vadim Zeitlin
d41539ef05 Merge branch 'fix-grid-resizing'
Fix bugs in wxGrid mouse handling and simplify the code.

See https://github.com/wxWidgets/wxWidgets/pull/2018
2020-08-31 14:53:37 +02:00
Vadim Zeitlin
82f7cb6e9b Merge branch 'art-ids-literals'
Revert art ids changes and make them `char*` literals again.

See https://github.com/wxWidgets/wxWidgets/pull/2031
2020-08-31 14:51:52 +02:00
Ian McInerney
7f7a0bfa81 Fix documentation for wxSYS_COLOUR_INACTIVECAPTIONTEXT
Just s/active/inactive/ in the description.

Closes https://github.com/wxWidgets/wxWidgets/pull/2039
2020-08-31 14:49:45 +02:00
Václav Slavík
8efc6fb003 Add wxWindow::WXAdjustFontToOwnPPI()
Avoid calling GeTDPI() in font.WXAdjustToPPI(GetDPI()); invocations in
common code on platforms that don't need any adjustment (i.e. anything
other than MSW).

This fixes wxOSX crashes when GetFont() is called too early during
window creation, but is the right thing to do regardless.

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

Closes #18903.
2020-08-31 14:45:02 +02:00
Vadim Zeitlin
2a17eef2ed Pre-include even more standard headers with MinGW/Cygwin
Avoid -Wredundant-decls when including them later by pre-including them
before enabling this warning.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
8b7ddbd0ac Use wxOVERRIDE for wxStackWalker and wxStackFrame in wxMSW
Thanks gcc for -Wsuggest-override.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
03bc49de2d Include <windows.h> before enabling all the warnings
This avoids tons of -Wredundant-decls and -Wnon-virtual-dtor (given for
all OLE interfaces).
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
6f9390306d Disable -Wsuggest-final-xxx in the headers for now
We don't use "final" in our code, as very few classes in wx code have
virtual functions but are not meant to be derived from in the user code.

Ideal would be to check the existing warnings and maybe apply "final" if
it's relevant and disable it otherwise, as these warnings can be useful
to build the application code with, but for now just disable them in the
test suite.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
3fc5d134a3 Suppress strange -Wunsafe-loop-optimizations in wxString code
The error message

wx/string.h:558:47: error: missed loop optimization, the loop counter may overflow
                    [-Werror=unsafe-loop-optimizations]
       for ( Cache::Element *c = cacheBegin; c != cacheEnd; c++ )
                                             ~~^~~~~~~~~~~

doesn't seem to really make much sense, as it shouldn't overflow here.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
a535d2c64d Suppress -Wnull-dereference in wxString::GetCacheElement()
It doesn't seem to be really possible here.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
24914ec7df Suppress unavoidable -Wformat-literal in wx[F]printf()
Disable gcc format string checks inside these functions.
2020-08-31 01:26:04 +02:00
Vadim Zeitlin
36c5884acb Generalize WX_ATTRIBUTE_PRINTF to WX_ATTRIBUTE_FORMAT
Allow applying gcc "format" attribute to other functions and do apply it
to wxStrftime().

Also suppress -Wformat-nonliteral inside wxStrftime() itself, as it's
now supposed to be checked when calling it.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
7352a2879c Rename Qt-specific GetEventType() to start with "Qt" prefix
This avoids conflicts with another method with the same name defined in
generic wxGenericFileDirButton, which must neither override nor hide
this method of wxButton.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9f63592eba Remove unnecessary wxBitmap copy ctor from wxQt
This ctor is not needed as the inherited wxObject ctor is sufficient and
defining it but not operator=() explicitly results in -Wdeprecated-copy
from gcc 10.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
19bc293086 Remove extraneous semicolon in wx/qt/menuitem.h
Avoid -Wpedantic from gcc.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
3bbefcdd74 Don't trigger warnings in standard headers when building wxQt
Pre-include QFont header in wxQt to avoid warnings for the other headers
included from it.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9c2cf91223 Don't remove const-ness using C-style cast
Avoid another -Wcast-qual from gcc.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9c48b0e8e7 Remove redundant wxSetCursor() declarations
Avoid -Wredundant-decls from gcc by not duplicating the declaration from
wx/gdicmn.h in wx/*/cursor.h.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9206a9de00 Remove trailing semicolon from wxDFB_DECLARE_INTERFACE()
This avoids -Wpedantic warnings when a semicolon is used after it.
2020-08-31 01:25:45 +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
Vadim Zeitlin
ca7fcfe9c3 Add wxGCC_ONLY_WARNING_{SUPPRESS,RESTORE} macros
When the original wxGCC_WARNING_SUPPRESS was added, clang understood all
gcc warnings, so it made sense to also apply it when building with
clang, but recent gcc versions have added warnings not available in
clang any more, so we now need a macro for disabling warning the
warnings for gcc only.

Perhaps we should rename the existing wxGCC_XXX macros to use
wxGCC_OR_CLANG prefix.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
266c3a962f Disable -Winline as we can't ensure all functions are inlined
It doesn't really make sense to enable this for C++ code, with a lot of
implicitly inline functions.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
1861065ef2 Disable -Wformat in system headers
This is given for the use of %zu by gcc 5.4.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
3c628138f5 Suppress bogus -Wnoexcept from gcc9 in wx/graphics.h
Due to what looks like a bug, gcc 9.3.0 gives the following incomplete
error message without it:

include/wx/graphics.h:278:7: error: but
‘wxGraphicsGradientStop::wxGraphicsGradientStop(wxGraphicsGradientStop&&)’
does not throw; perhaps it should be declared ‘noexcept’
[-Werror=noexcept]

(without any other diagnostics).
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
7d74df9a03 Add wxNOEXCEPT to the hash structs operator() declarations
gcc 9 gives -Wnoexcept for these operators and, apparently, not making
them noexcept prevents some optimizations in the standard library
implementation of unordered_foo<>, so do add it.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
831979ead1 Suppress gcc -Wctor-dtor-privacy in wx/strvararg.h
Helper structs declared in this header intentionally define their ctor
as private, avoid gcc complaints about it.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
2f605badf3 Fix g++ 4.8 -Wshadow for parameter/function conflicts
Unlike the later versions, g++ 4.8 produces a -Wshadow when the name of
a parameter is the same of the name of a method, so rename the (private)
parameters to avoid this.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
23334af81b Test headers compilation with maximum warnings options with gcc
As wx headers are included from user applications which may compile with
higher warning level than wx itself, try to check headers compilation
with almost all of gcc warning flags turned on.

This notably should prevent the headers from becoming uncompilable with
-pedantic again in the future.
2020-08-31 01:24:57 +02:00
Václav Slavík
9e68df224f Fix colored markup drawing in Mac wxDataViewCtrl
50ba73c accidentally omitted an if (colText) check, causing calls to
setTextColor:nil - which in turn caused markup text (but curiously, not
plain) rendering to stick with a previously set color even on cells
where the default color should be used.

Restoring the original logic to prevent setTextColor:nil fixes it.
2020-08-26 19:28:32 +02:00
Andreas Falkenhahn
a59901f8f1 Fix bug in CanUndo() returning true after wxTextCtrl creation
For wxMSW text controls with wxTE_RICH2 style, calling SetFont() counts
as an undoable operation, resulting in CanUndo() returning true even if
no "real" changes have been made yet.

Fix this by resetting the undo stack after creating the control using
ITextDocument::Undo().

Unfortunately this interface is not available in MinGW-32, so this fix
can't be used with it.

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

Closes #17524.
2020-08-25 18:10:20 +02:00
Vadim Zeitlin
1ec571fb64 Avoid -Wshadow warnings when using multiple wxCHECK()s
If the same function used any of macros from wxCHECK() family more than
once, wxDummyCheckStruct was redeclared, resulting in -Wshadow warnings
from gcc.

Fix this by using unique names for the dummy macro.
2020-08-25 17:37:25 +02:00
Vadim Zeitlin
054d98b1df Fix -Wpedantic in wxDECLARE_ABSTRACT_CLASS()
Fix a regression introduced in c924ecb10a (Suppress -Wsuggest-override
warnings in user code for gcc too, 2020-07-27) and rearrange the macro
to make sure a semicolon is necessary after it.

Closes #18901.
2020-08-25 17:36:02 +02:00
Vadim Zeitlin
30fc873626 Remove useless hdrstop pragma from allheaders test
It shouldn't be necessary for a test not using PCH at all and Borland
compiler is almost certainly not supported anyhow any longer.
2020-08-25 16:54:23 +02:00
Vadim Zeitlin
29a2b481a5 Fix documented type of wxART_XXX constants
They're (now, and had always been before the recent changes) string
literals, i.e. of type "const char *", rather than "wxString".
2020-08-25 16:49:24 +02:00
Vadim Zeitlin
873e028ffa Document wxASCII_STR() macro
Also improve wxString::FromAscii() documentation slightly.
2020-08-25 16:49:05 +02:00
Vadim Zeitlin
79c98b31a4 Don't use wxASCII_STR() inside wxART_MAKE_XXX_ID macros
This changed the type of the art and client ID values, which broke
compatibility with existing code, notably in wxPython (see
https://github.com/wxWidgets/wxWidgets/pull/1996), and the attempts to
fix this compatibility broke it with all the existing code using
wxART_MAKE_ART_ID() or wxART_MAKE_CLIENT_ID() for their own IDs.

Keep things simple and just define the macros as they were defined
before 4552009805 (Merge branch 'pr1312-no-unsafe-wxstring-conv',
2020-07-20), except for wxART_MAKE_CLIENT_ID_FROM_STR() whose argument
and produced value was already of wxString type, and use wxASCII_STR()
at the place of use of wxART_XXX constants in wx code.

This is obviously not ideal as it will require using wxASCII_STR() in
the application code as well, but seems to be the least evil.
2020-08-24 16:47:37 +02:00
Vadim Zeitlin
30b37b610d Revert "Merge branch 'string-art-ids'"
This reverts commit 8c9ba23eae, reversing
changes made to 5192feb38e.

Upcoming commits will try to work around the issues with art IDs related
to wxNO_IMPLICIT_WXSTRING_ENCODING in a different way.
2020-08-24 16:47:37 +02:00
Vadim Zeitlin
825fd01beb Test XRC headers compilation without implicit wxString conversion
Add wx/xrc/xmlres.h to the list of headers compiled with
wxNO_IMPLICIT_WXSTRING_ENCODING to test that they can be used even when
the implicit conversions from "char*" to wxString are disabled.
2020-08-24 16:47:37 +02:00
Ilya Sinitsyn
0e8ca0c8f9 Fix the cursor mode switching in wxGrid mouse move event handler
Allow switching between row and column resizing modes in mouse move event
handler.
2020-08-24 02:09:01 +02:00
Ilya Sinitsyn
5d3d376766 Remove unused wxGrid function 2020-08-24 02:09:01 +02:00
Ilya Sinitsyn
d6aec06150 Process the wxGrid mouse click depending on the current mode
Simplify the code of wxGrid::DoGridCellLeftDown() and make it more
correct by using m_cursorMode instead of duplicating (not 100%
correctly) the logic used to set it in DoGridMouseMoveEvent().

If the assumption that m_cursorMode is already set by the time
DoGridCellLeftDown() is called turns out to be wrong, e.g. when wxGrid
is used on touch screens, we would need to refactor these functions to
extract the code determining m_cursorMode from the mouse location into a
separate function that would be called from both.

Note that this commit is best viewed with "git diff -w" to see how little
has really changed.
2020-08-24 02:08:54 +02:00
Vadim Zeitlin
c1d3e65ac4 Merge branch 'wine-heap-fix'
Wine heap fix and other global memory-related cleanup.

See https://github.com/wxWidgets/wxWidgets/pull/2030
2020-08-24 00:18:57 +02:00
Vadim Zeitlin
3df9d772a4 Merge branch 'display-ppi-from-scaling-factor'
Determine display DPI from scaling factor instead of trying to compute
it from the physical display dimensions.

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

Closes #18855.
2020-08-24 00:14:27 +02:00
Vadim Zeitlin
1bf76ee594 Add a safety check for the buffer size in wxIDataObject
Avoid size overflow if the offset value is greater than it.
2020-08-22 23:48:58 +02:00
Paul Cornett
3f9884817d Allow wxButton to show explicitly set bitmaps regardless of theme setting with GTK3
See #18874
2020-08-22 11:18:48 -07:00
Vadim Zeitlin
75ad798d8b Use GlobalPtrLock instead of manual GlobalUnlock() calls
Make the code safer and shorter by using RAII wrapper instead of manual
Global{Lock,Unlock}() calls.

No real changes.
2020-08-22 19:45:19 +02:00