Commit Graph

70753 Commits

Author SHA1 Message Date
Vadim Zeitlin
e551549015 Don't define unused variable in !wxHAS_NATIVE_READLINK case
Also make it const because it can be.

No real changes.
2021-04-07 01:43:56 +02:00
Vadim Zeitlin
1035ae27a7 Make wxSplit(wxJoin()) idempotent for string ending with escape
Previously, splitting a string obtained by joining together array
with (any but last) elements ending in the escape character (normally
the backslash), didn't recover the original array because the separator
character following it in the resulting string was considered to be
escaped by wxSplit().

Fix this by escaping the trailing escape character itself.

Add a test confirming that this works as expected now, document this
behaviour and also slightly simplify wxSPlit() logic.

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

Closes #19131.
2021-04-07 01:38:43 +02:00
Vadim Zeitlin
6810fafa31 Merge branch 'fix-grid-demo'
Fix colour of starts in the grid sample.

See https://github.com/wxWidgets/wxWidgets/pull/2019
2021-04-07 01:37:32 +02:00
Ilya Sinitsyn
8b6d01c798 Fix grid demo stars drawing to use correct colours and font
Just add a call to SetTextColoursAndFont() now that it is present in
this renderer base class (see the parent commit) to ensure that the
correct, i.e. corresponding to the column attribute, colour is used for
the stars.
2021-04-06 22:51:12 +02:00
Vadim Zeitlin
317ad65079 Move SetTextColoursAndFont() to wxGridCellRenderer
Move this function from wxGridCellStringRenderer to its base class to
allow using it even in the classes not drawing any strings.

Also document it.
2021-04-06 22:51:08 +02:00
Vadim Zeitlin
a957d29f8c Mention wxDIR_HIDDEN in GetAllFiles() documentation
It may not be obvious that hidden files are not returned without it.
2021-04-06 22:19:03 +02:00
Tobias Taschner
0ff1bdec09 Add wxFullScreenEvent for macOS
Send a wxFullScreenEvent when the user enters or exits full screen on
macOS. EnableFullScreenView() has to be used to enable the native
full screen API.

Closes https://github.com/wxWidgets/wxWidgets/pull/2284
2021-04-06 19:01:25 +02:00
Vadim Zeitlin
a495b1fd23 Use wxUniCharRef rather than "auto&&" to iterate over wxString
As explained in 0a5be41f8a (Avoid using uninitialized static wxString in
wxOSX code, 2021-04-04), the usual "auto&" can't be used to iterate over
wxString and modify its contents because of proxy-like nature of
wxUniCharRef returned by wxString iterators.

But using "auto&&" as that commit did wasn't especially clear (even with
the explanations in the commit message) and gave -Wrange-loop-analysis
when using clang.

So replace it with "wxUniCharRef", which should be both more clear (it
is a value, which is still a bit confusing, but its name hopefully
indicates that it's also some kind of a reference) and warning-free.
2021-04-06 18:52:56 +02:00
Vadim Zeitlin
e5011b46ae Recognize clang correctly in macOS Travis CI builds
It is called g++, but is actually always clang, so don't even bother
checking "g++ --version" output.
2021-04-06 18:49:29 +02:00
Vadim Zeitlin
8bc2ff71e2 Recognize g++ as value of TRAVIS_COMPILER
In macOS builds TRAVIS_COMPILER is set to g++ and not gcc, which
resulted in not handling it correctly and giving a bogus warning.
2021-04-06 18:45:52 +02:00
Maarten Bent
d1e493d37d Add GitHub CI badge to README.md
Update the other badges.

Closes https://github.com/wxWidgets/wxWidgets/pull/2309
2021-04-06 11:41:46 +02:00
Maarten Bent
c968e49b13 CMake: Remove iOS workaround
Not needed anymore since the fix in 60c620c28c.

Closes https://github.com/wxWidgets/wxWidgets/pull/2308
2021-04-06 11:41:06 +02:00
Paul Cornett
e961ca8617 Fix 0-width pen scaling on wxOSX
Scaling got inverted in previous commit
52cc838b12 (Implement 0-width pen consistently in wxGraphicsContext, 2021-04-05)
2021-04-05 14:41:50 -07:00
Paul Cornett
52cc838b12 Implement 0-width pen consistently in wxGraphicsContext
Emulate a 1-pixel pen width as closely as possible.

This reverts:
334cf1cc91 (Take HiDPI scale into account for wxGCDC 0-width pen, 2021-04-03)
0d80050057 (Make wxGCDC behavior with 0-width wxPen consistent with MSW wxDC, 2021-03-02)

See #19077, #19115
2021-04-05 09:56:28 -07:00
Václav Slavík
a2e4cb6cec Fix wxSplitterWindow painting on macOS 11
Fix regression in wxSplitterWindow rendering introduced in
287ee5e4c7 - the splitter wouldn't
correctly render its background under some (but not all) circumstances
on macOS 11.

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

Fixes #19106
2021-04-05 18:41:00 +02:00
Vadim Zeitlin
7063813b59 Hardcode versions of all httpbin dependencies under Trusty
Python package hosting seems to randomly decide which version of the
package to return to pip running under Trusty: in addition to werkzeug
(see last commit), the version of flask has spontaneously changed from
1.0 to 1.2 in the latest build too.

Just hardcode the versions of all dependencies in the last successful
build and hope they keep working for longer than a day.
2021-04-05 17:56:09 +02:00
Vadim Zeitlin
c7c60877e4 Fix another dependency problem with httpbin and Python 3.4
Crazily, pip installs seem to be non-deterministic as installing httpbin
in https://travis-ci.org/github/wxWidgets/wxWidgets/jobs/765946720
pulled in werkzeug 0.16.1 which works with Python 3.4, but doing it
again tries to use werkzeug 1.x which isn't.

Fix the version explicitly to work around this.
2021-04-05 17:21:53 +02:00
Vadim Zeitlin
449e6251e2 Merge branch 'httpbin-python3'
Another fix for httpbin installation in CI builds.

Closes https://github.com/wxWidgets/wxWidgets/pull/2307
2021-04-05 16:37:27 +02:00
Vadim Zeitlin
f024551395 Use Python 3 for httpbin installation under Ubuntu Trusty
Trying to use Python 2 under Trusty is hopeless, as pythonhosted.org has
already started dropping support for non-SNI clients and will drop it
completely soon, see https://status.python.org/incidents/hzmjhqsdjqgb
and https://github.com/pypa/pypi-support/issues/978, and SNI is not
available in the system Python 2 version (2.7.6, which is less than
2.7.9 in which it was added).

Note that we still can't use Python 3 everywhere as long as we have
macOS 11 builds as it's not available there.
2021-04-05 16:36:56 +02:00
Vadim Zeitlin
82d2f1d647 Ignore changes to a script not used under AppVeyor
This file is only used by GitHub and Travis CI, so don't rebuild
AppVeyor needlessly.
2021-04-05 16:34:40 +02:00
Vadim Zeitlin
a77f390ae3 Fix wxFileHistory memory leak in the sample
We need to delete the object we allocate.
2021-04-05 16:32:34 +02:00
Vadim Zeitlin
979c1bccc9 Make DoRefreshLabels() code more obviously correct
Use switch over enum instead of a series of chained ifs.

This has the same effect, but can be read and understood more easily.

No real changes.
2021-04-05 16:30:51 +02:00
Vadim Zeitlin
d46ba0b435 Very minor code cleanup in AddFileToHistory()
Declare "i" inside the loop and make a variable that could be const
actually const.

No real changes.
2021-04-05 16:21:19 +02:00
Vadim Zeitlin
f8f0b8b50c Remove public wxFileHistory::RefreshLabels()
Replace it with a private DoRefreshLabels() and call it ourselves from
SetMenuPathStyle() to make the class simpler (and less error-prone, as
it's now impossible to forget to call RefreshLabels() any more) to use.
2021-04-05 16:20:02 +02:00
Vadim Zeitlin
c89921d26d Rename wxFileHistoryMenuPathStyle values too
Use common wxFH_PATH_ prefix for consistency and try to make the values
more clear.
2021-04-05 16:15:49 +02:00
Vadim Zeitlin
036e35bf28 Rename wxFileHistoryMenuLabelStyle to wxFileHistoryMenuPathStyle
It seems useful to have the word "Path" in the name of this enum to
indicate that it applies to the paths shown in the menu labels.

Also rename the methods using this enum.
2021-04-05 16:09:34 +02:00
Artur Wieczorek
dc43d15cf7 Add tests of storing HiDPI images in generic wxImageList (wxOSX, wxGTK3) 2021-04-05 12:18:05 +02:00
Artur Wieczorek
94ed0463d0 Check if index is in the range prior to erasing the image from wxImageList
This is to avoid memory errors in wxVector.
2021-04-04 21:09:40 +02:00
Artur Wieczorek
b6f4e5cf59 Don't use image index to get the size of the image in generic wxImageList
The index parameter should be ignored as all images in the list have
the same size (see docs). Native wxMSW implementation also works this
 way.
2021-04-04 21:08:32 +02:00
Artur Wieczorek
f1c3ff4037 Don't allow adding image to invalid wxImageList (generic)
Native wxMSW implementation doesn't allow to do this.
2021-04-04 21:07:15 +02:00
Artur Wieczorek
4b7ca0b33d Add assertions to check if generic wxImageList is valid
This is for compatibility with native wxMSW implementation.
2021-04-04 21:06:18 +02:00
Artur Wieczorek
032c443c42 Report failure while creating generic wxImageList with invalid image size
Native wxMSW implementation reports failure if dimensions <= 0.
2021-04-04 21:05:06 +02:00
Artur Wieczorek
51ff4ec08b Dont allow to remove from wxImageList an images with index out of range
Since ImageList_Remove() accepts -1 index as a magic number to remove all
images, we need to explicitly prevent using indices < 0 in the call.
Because wxImageList::RemoveAll() uses the trick with -1 index
to call wxImageList::Remove(-1) we also need to refactor this mehod and
call ImageList_Remove() API directly instead.
2021-04-04 21:01:43 +02:00
Artur Wieczorek
882f0a4631 Don't return a valid image from wxImageList if its index is out of range 2021-04-04 21:00:05 +02:00
Artur Wieczorek
d6443e65ee Don't store negative dimensions for images in wxImageList 2021-04-04 20:59:00 +02:00
Artur Wieczorek
2ed7355d5c Add wxImageList tests with negative scenarios (invalid sizes, indices) 2021-04-04 20:53:02 +02:00
Andreas Falkenhahn
c9221fd538 Fix sizing of temporarily last columns in macOS wxDataViewCtrl
Update the column width if it used to be the last one but isn't last one
any longer.

Closes #14939.
2021-04-04 17:48:25 +02:00
Andreas Falkenhahn
36ea7ff4d6 Autosize the right columns in macOS wxDataViewCtrl
This is related to 7555d1b245 (Fix expansion of the last column in macOS
wxDataViewCtrl, 2021-01-26) which somehow didn't apply the patch fully,
so finish applying it now.

Closes #14939.
2021-04-04 17:32:41 +02:00
tamasmeszaros
60c620c28c Fix libraries names when cross compiling on Linux using CMake
This allows using wxWidgets libraries from CMake when cross-compiling
too.

Closes https://github.com/wxWidgets/wxWidgets/pull/2291
2021-04-04 17:06:45 +02:00
Vadim Zeitlin
802c81fff7 Merge branch 'mac-search-menu-check'
Fix check items state in wxSearchCtrl menu under macOS.

See https://github.com/wxWidgets/wxWidgets/pull/2304
2021-04-04 17:04:18 +02:00
Vadim Zeitlin
c41357ed22 Skip another test using /proc and /sys when using LXC
This should have been part of the previous commit.
2021-04-04 15:35:46 +02:00
Vadim Zeitlin
051fa788ad Skip all tests using /proc and /sys in LXC containers
These tests fail in S/390 Travis CI build, so just don't run them at all
there, as we already did for a couple of tests using /proc that also
failed in other LXC-based builds.
2021-04-04 15:07:29 +02:00
Vadim Zeitlin
0a5be41f8a Avoid using uninitialized static wxString in wxOSX code
Global "sCR" and "sLF" string objects could have been not yet
initialized when wxMacConvertNewlines{13To10,10To13}() were called as
these functions can be (implicitly) used when initializing other static
objects.

Fix the problem by avoiding the use of these objects, as well of
wxString::Replace(), entirely and just iterating over the string
directly using a simple, and more efficient, for loop.

Note the use of "auto&&": a more usual "auto&" can't be used with
temporary wxUniCharRef created by dereferencing wxString iterators.
Using just "auto" would have actually worked too, but modifying a value
via a copy would seem surprising, so use "auto&&" as a hopefully
slightly more clear alternative.

Closes #19110.
2021-04-04 15:06:06 +02:00
Vadim Zeitlin
9c1c4817db Remove unused senderWindow argument of wxMenu::HandleCommandXXX()
This parameter isn't used anywhere, so just remove it to simplify the
code.
2021-04-04 14:29:34 +02:00
Vadim Zeitlin
0f1d1d2ae9 Update wxSearchCtrl popup menu state after showing it
Fix the state of the check/radio items in the menu by updating the
template used by macOS to create the actual menu after showing it and
possibly changing the items state.

This is not ideal because changing the state from the program, e.g.
using wxMenuItem::Check(), still doesn't work correctly, i.e. isn't
reflected in the menu when it's shown, but better than nothing until a
better solution (which ideally would update the menu just before showing
it, but it's not clear how exactly can we do it, knowing that we don't
get wxEVT_MENU_OPEN for this menu neither) can be found.
2021-04-04 14:21:27 +02:00
Vadim Zeitlin
5f482e15ab Merge branch 'osx-set-color-without-font'
Set colour without changing font in wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/2278
2021-04-04 14:19:39 +02:00
Vadim Zeitlin
31bcf15209 Merge branch 'launch-httpbin'
Fix multiple problems with using "pip install httpbin".

Closes https://github.com/wxWidgets/wxWidgets/pull/2303
2021-04-04 14:18:22 +02:00
Ian McInerney
6c9f9af7fc Minor updates to the wxSizer docs
Don't mention inexistent "recursive" parameter of GetItem() overload not
taking it.

Closes https://github.com/wxWidgets/wxWidgets/pull/2302
2021-04-04 14:17:41 +02:00
Vadim Zeitlin
0bc1dbf218 Use user mode for pip upgrade
This is default for some platforms, but not everywhere, so use it
explicitly.

This should fix the error in Travis CI S/390 build.
2021-04-04 14:16:30 +02:00
Vadim Zeitlin
7112582f18 Show events from wxSearchCtrl menu in the widgets sample
Verify that we get the expected events from the menu items.
2021-04-04 13:48:37 +02:00