Commit Graph

68678 Commits

Author SHA1 Message Date
PB
83a2a1e505 Refactor the natural string compare and sort algorithm
Add a new string fragment type for whitespace and punctuation which needs
to be assessed separately from letters and symbols.

Use wxUint64 instead of long for storing the value for numeric fragment.

Use collate instead of compare for non-numeric fragments.

Change names for the public comparison functions: wxWidgets provided function
is now named wxCmpGenericNatural() and for common public use is wxCmpNatural()
which calls a native function in wxMSW and wxCmpGenericNatural() elsewhere.

Try harder in wxCmpNaturalGeneric() if wxRegEx is unavailable: do not
just make a simple string comparison, but perform a case-insensitive
collation.

Make some other changes to simplify and possibly speed up the code.
2020-07-07 23:10:18 +02:00
Hugo Elias
371c4b1366 Add functions for sorting strings in natural sort order
Use StrCmpLogicalW() under MSW and generic implementation under the
other platforms.

See https://github.com/wxWidgets/wxWidgets/pull/780
2020-07-07 23:10:11 +02:00
Vadim Zeitlin
a2e4e6ebcf Merge branch 'readme-macos-update'
Update platforms supported by wxOSX in the README.

See https://github.com/wxWidgets/wxWidgets/pull/1937
2020-07-07 22:59:17 +02:00
Vadim Zeitlin
7aa0d9465c Mention support for macOS on ARM in the README too
Instead of putting 32/64, which is not even correct any more, as latest
macOS versions don't support 32 bit builds anyhow.
2020-07-07 22:58:27 +02:00
Hertatijanto Hartono
a5e8316dc8 Update README.md to define macOS 10.10 as the lowest version supported
Show that macOS 10.10 is lowest version supported by wxWidgets
2020-07-08 01:12:12 +07:00
Vadim Zeitlin
eeb69ba185 Fix wxGLCanvas build in wxQt when using MSVC
Use "#pragma message" instead of "#warning" with this compiler to fix
the build after the recent changes of 589e043358 (Add an explicit
warning about missing OpenGL support in wxQt, 2020-07-06).
2020-07-07 15:31:26 +02:00
Scott Talbert
270c8bec3d Fix wxMediaCtrl::Seek() on macOS for sub-second resolution
On macOS, wxMediaCtrl::Seek() currently only works to the nearest second.
For example, Seek(5033) will actually seek to an offset of 5000.  This is
because the timescale was being set to 1, meaning 1 possible timeslice per
second.  The fix is to set the timescale to 60000, which means that there are
60000 timeslices per second.  This is probably overkill since the API for seek
is an integer in milliseconds, but should be fine.

References:
https://stackoverflow.com/questions/22666190/using-seconds-in-avplayer-seektotime
http://warrenmoore.net/understanding-cmtime

Closes https://github.com/wxWidgets/wxWidgets/pull/1936
2020-07-07 15:07:54 +02:00
Vadim Zeitlin
a3f61f973d Merge branches 'travis-warning-errors' and 'travis-cleanup'
Fail CI builds if any warnings (other than those given by an explicit
preprocessor #warning directive) are encountered.

Also cleanup Travis config a bit.

See https://github.com/wxWidgets/wxWidgets/pull/1933,
    https://github.com/wxWidgets/wxWidgets/pull/1935
2020-07-07 12:45:58 +02:00
Vadim Zeitlin
9fde10f53e Use #!/bin/bash for Travis build script which requires bash
It uses arithmetic expansion and, now, arrays, neither of which exists
in POSIX sh.
2020-07-07 12:43:12 +02:00
Vadim Zeitlin
30582f4be4 Disable OpenGL support in wxQt build
It's not implemented anyhow and results in warnings about
GK_GLEXT_VERSION redefinition due to include both the standard
GL/glext.h and Qt QtGui/qopenglext.h (which seems to be a slightly
different version of the same file).

This probably should be fixed by not including GL/gl.h at all, but for
now just disable it.
2020-07-07 12:42:40 +02:00
Vadim Zeitlin
403884e1d8 Fix quoting of CXXFLAGS passed to make
Use arrays to simplify passing CXXFLAGS and LDFLAGS, both of them may
contain spaces, separately on make command line.

Simpler solution of just using individual variable doesn't work because
of bash/POSIX word splitting behaviour (zsh should be blamed for
spoiling me with its much more reasonable behaviour and allowing me
to forget about this insanity in the first place). In principle, we
could work around this by temporarily resetting IFS, but using arrays is
arguably more clear and this script already uses bashisms, in spite of
its shebang line.
2020-07-07 12:40:22 +02:00
Paul Cornett
687267b9db Fix the default background color reported for toplevel windows with GTK3
See #18811
2020-07-06 23:13:33 -07:00
Vadim Zeitlin
589e043358 Add an explicit warning about missing OpenGL support in wxQt
This is better than a bunch of warnings about unused parameters due to
many wxGLCanvas methods being just empty stubs.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
80ba460b1f Suppress unused parameter warning in wxX11
It seems better to keep it for consistency, as all the other functions
take both Drawable and GC, but it isn't being used in this particular
function.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
b1f5203a08 Add an explicit #warning for missing dashes support in wxX11 wxDC
This is better than warnings about unused dash-related variables.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
6119a7c630 Suppress warnings about deprecated pango_xft_get_context()
We can still use it as long as it exists, there is no benefit whatsoever
in using the new functions as the old one does exactly the same thing
anyhow.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
eaee5416cf Remove unused PangoContext variable from X11 code
It's has been there since basically always, but seems to never have been
used, so remove it to avoid warnings.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
1cdfdcc3a8 Allow warnings in iOS build, there are too many of them
Mostly there are warnings about unused parameters because of
unimplemented functionality, but we don't have a simple way to disable
just those, so just don't use -Werror with this build at all.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
a4c1e542aa Use makefile flags when building the samples too
This will notably detect all warnings in them.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
85ad131adb Fix not handling #warning as errors for clang
clang uses "#warnings" warning category instead of "cpp" as gcc does and
complains about unknown "cpp" warning option if we use it with it.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
437b8eebec Pass -Werror on make command line
Setting CXXFLAGS=-Werror in the environment wasn't enough, it was still
overridden by the empty CXXFLAGS in the makefile.

Ideal would be to get rid of the empty flags there, but for now override
them on make command line explicitly.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
c4152869f5 Split wxMAKEFILE_FLAGS in separate CXX/LDFLAGS variables
This will allow appending extra CXXFLAGS to use with make in the
upcoming commit.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
f259f4152b Merge branch 'safer-sizers'
Improvements to the safety of wxSizer API.

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

Closes #18611.
2020-07-06 17:54:46 +02:00
Vadim Zeitlin
cfaec20ae3 Specify default Travis CI build platform explicitly
This doesn't really change anything right now, as Ubuntu Xenial is used
by default anyhow, but removes the last message from the validator at
https://config.travis-ci.com/explore so still worth having.
2020-07-06 17:50:39 +02:00
Vadim Zeitlin
4cb949d9b5 Use "jobs" synonym for the old "matrix" keyword for Travis CI
Get rid of another validator notice.
2020-07-06 17:45:58 +02:00
Vadim Zeitlin
76e16ad372 Remove deprecated "sudo" key from Travis CI configuration
This doesn't seem to do anything any more.
2020-07-06 17:45:34 +02:00
Vadim Zeitlin
cb9e1f4ac0 Only notify about Travis build status for the main repository
It's annoying to receive notifications about build status in the forks.
2020-07-06 17:45:03 +02:00
Stefan Csomor
792e4dcced
macOS wxTextEntry::GetTextPeer fix for wxGenericComboCtrl (#1931)
* overriding GetTextPeer in generic combo control

* undo 81e3760e4a

* inlining GetTextPeer()

* moving out of line to reduce header include
2020-07-06 17:06:09 +02:00
Vadim Zeitlin
b91d3e35cf Only use -Werror for building, not configuring
Use of -Werror results in failures of configure tests that should
normally succeed, e.g. testing for va_copy() when cross-compiling for
iOS, so don't do it and just enable -Werror for building our own code.
2020-07-06 13:13:35 +02:00
Vadim Zeitlin
42108c64f6 Avoid warnings about literals-to-char* conversions in wxMotif
Suppress -Wwrite-strings warnings.
2020-07-06 13:06:57 +02:00
Vadim Zeitlin
655b343246 Avoid unused variable warning in wxRibbon with wxUSE_TOOLTIPS==0 2020-07-06 13:06:03 +02:00
Vadim Zeitlin
3004e594b9 Replace deprecated wxDEFAULT with wxFONTFAMILY_DEFAULT in wxMotif
Just avoid a -Wdeprecated-declarations warning.
2020-07-06 13:04:18 +02:00
Vadim Zeitlin
7c268092bd Avoid an unused variable warning in wxUIActionSimulatorX11
This happens in wxMotif build, where this class probably doesn't work
anyhow, so just suppress it.
2020-07-06 13:03:09 +02:00
Vadim Zeitlin
698c356050 Fix -Wwrite-strings warning in non-Pango wxFontEnumerator code
Don't convert wxString::c_str() to decltype(wxT("*")), which is
non-const "wchar_t *". Just pass wxString to Printf() directly instead,
this is simpler and more efficient anyhow.
2020-07-06 12:58:16 +02:00
Vadim Zeitlin
e7bb37436a Warn if wxCairoContext(wxPrinterDC) ctor is not implemented
Use an explicit #warning to explain the problem. This is more
informative and avoids errors when building with -Werror (but also
-Wno-error=cpp).
2020-07-06 12:54:15 +02:00
Vadim Zeitlin
20e385e7bb Do not make explicit #warnings fatal in Travis CI builds
Don't give errors for the intentional warnings from #warning directives.
2020-07-06 12:52:01 +02:00
Vadim Zeitlin
31a1779a86 Keep building libraries/samples/tests in Travis CI tests
This is useful to see all the warnings at once instead of having to run
many builds to see them all.
2020-07-06 12:45:57 +02:00
Vadim Zeitlin
b48515d5cc squash! Treat warnings as errors in Travis CI builds
Add wxALLOW_WARNINGS which can be set to prevent this from happening for
the ports where we don't want to avoids warnings anyhow because they
indicate real problems in the code, such as wxDFB.
2020-07-06 12:44:25 +02:00
Vadim Zeitlin
3fc15101be Fix unhelpful unused parameter warning in wxX11 wxFontEnumerator
This warning can't really be avoided in this case, unless we decided not
to return any fonts at all if we can't test whether they're monospaced
or not, but this would probably be even less useful.
2020-07-06 12:40:03 +02:00
Vadim Zeitlin
1b9f57621d Add a forgotten wxOVERRIDE in the grid sample
Fix -Winconsistent-missing-override when building this sample.
2020-07-06 12:34:42 +02:00
Vadim Zeitlin
de6b4e4095 Use LocaleSetter class in wxTextCtrl test case
Replace manual calls to setlocale() with the existing helper class.

This makes the code slightly simpler and avoids -Wnoexcept-type warnings
due to using setlocale as template argument as a welcome side effect.
2020-07-06 12:32:38 +02:00
Vadim Zeitlin
d2e03dec77 Treat warnings as errors in Travis CI builds
This will allow detecting any new warnings immediately.
2020-07-06 00:30:41 +02:00
Stefan Csomor
9be2c3717d Improve native keyDown handling in wxOSX
Provide API for dealing with m_lastKeyDownEvent instead of using it
directly and extend it to avoid sending duplicate events for keys which
are mapped to multiple selectors, such as Ctrl-O with the default key
bindings.

Closes https://github.com/wxWidgets/wxWidgets/pull/1928
2020-07-06 00:13:18 +02:00
catalinr
de56f99c5a Bind user options to recreate static page in widgets sample
Make the various options on this page actually work.

Closes https://github.com/wxWidgets/wxWidgets/pull/1930
2020-07-06 00:11:33 +02:00
Vadim Zeitlin
d09ed641f2 Merge branch 'osx-10_10-min-10_11-SDK' of csomor/wxWidgets
Increase minimum required macOS SDK version to 10.11 and minimum support
macOS deployment version to 10.10.

See https://github.com/wxWidgets/wxWidgets/pull/1929
2020-07-06 00:08:44 +02:00
Vadim Zeitlin
b85d4fc758 Don't check macOS symbols when building for iOS in configure
We should probably check __IPHONE_OS_VERSION_MIN_REQUIRED and maybe
MAX_ALLOWED too, but for now just don't give an error in wxiOS builds.
2020-07-05 23:46:34 +02:00
Vadim Zeitlin
d3812ab091 Remove explicit C++11 options from Xcode 7.3 Travis CI build
They're not needed any longer as C++11 is used by default in wxOSX
builds if nothing else is specified.
2020-07-05 23:41:12 +02:00
Vadim Zeitlin
65d890f33e Document important requirements of wxSizerItem::AssignWindow()
Failure to call SetContainingSizer() on the window passed to it can have
catastrophic consequences, so make sure to document the need to do it.
2020-07-05 23:28:28 +02:00
Vadim Zeitlin
957183ef47 Associate the window with the sizer in wxSizer::Replace()
If wxSizerItem passed to Replace() contains a window, the window must be
associated with the sizer to ensure that it is uncoupled from it when it
is destroyed.

Add a simple test which resulted in a use-after-free before but passes
now.
2020-07-05 23:19:36 +02:00
Vadim Zeitlin
2f49325d4c Simplify check for whether wxSizerItem window is null
No real changes, just write the check more compactly and without
redundant IsWindow() check.
2020-07-05 23:18:43 +02:00