Commit Graph

70883 Commits

Author SHA1 Message Date
Vadim Zeitlin
702c221901 Deprecate wxPATH_NORM_ALL and Normalize() with default flags
Using wxFileName::Normalize() with default flags could be surprising and
result in bugs in the code, as shown by our own wrong use of it in
wxFileSystemWatcher corrected in the previous commit.

Deprecate using it without any flags and recommend using MakeAbsolute()
instead.

Also improve the related parts of the documentation.
2021-07-11 14:51:31 +01:00
Vadim Zeitlin
2cd7025d7b Replace more uses of wxFileName::Normalize() with MakeAbsolute()
Unlike the parent commit, this one does change the behaviour by not
applying some normalizations any more, but these changes are correct,
i.e. we really don't need to call Normalize(), which expands environment
variables in the file names by default, here and just want to make the
file paths absolute.

In particular, this fixes the problem of mangling file names containing
dollar signs in wxFileSystemWatcher.

Closes #19214.
2021-07-11 14:51:31 +01:00
Vadim Zeitlin
6d2af9e7a1 Use wxFileName::MakeAbsolute() instead of Normalize()
Make the code more clear by being more explicit about what it does.

No real changes and no changes in behaviour at all.
2021-07-11 14:51:31 +01:00
Vadim Zeitlin
1f2413c461 Improve wxPATH_NORM_LONG documentation
Notably mention that this flag is obsolete.
2021-07-11 14:51:31 +01:00
Vadim Zeitlin
7a1530e20a Merge branch 'std-deprecated-attr'
Add wxDEPRECATED_ATTR expanding to the standard C++14 [[deprecated]]
attribute.
2021-07-11 15:50:27 +02:00
Vadim Zeitlin
f6da66debc Disable use of [[deprecated]] with gcc 5
This gcc version claims support for this attribute, but actually doesn't
support it and returns unclear errors when it is used, e.g.

	$ echo '[[deprecated]] int x;' | g++-5 -fsyntax-only -x c++ -
	<stdin>:1:1: error: expected unqualified-id before ‘[’ token

so disable its use with gcc < 6.
2021-07-11 15:02:41 +02:00
Vadim Zeitlin
7a8f2dffbd Use standard [[deprecated]] attribute if available
Add yet another wxDEPRECATED_XXX macro, this one simply expanding to
C++14 [[deprecated]] attribute if it's available and nothing otherwise.

It's a bit ridiculous to have so many different macros for deprecating
things, but the new one is useful because the standard attribute can be
used to deprecated enum elements, which is impossible with MSVC-specific
__declspec(deprecated).
2021-07-11 14:47:47 +02:00
Kvaz1r
4f7f7a9ce1 Don't send event when adding first page to wxNotebook in wxUniv
Make behaviour consistent with the other ports and fix failure in
wxNotebook::AddPageEvents unit test with wxUniv.

Closes https://github.com/wxWidgets/wxWidgets/pull/2426
2021-07-11 12:56:20 +02:00
Vadim Zeitlin
c0c183ac17 Merge branch 'ci-install-setuptools'
Fixes for CI after apparent changes to GitHub Actions Ubuntu 16.04
images.
2021-07-11 00:06:50 +02:00
Vadim Zeitlin
49d799fcd3 Merge branch 'renderer-fix'
Miscellaneous wxRenderer-related fixes, notably fixing regressions
introduced by 0112a2dd1b (Merge branch 'renderer', 2021-07-06).

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

Closes https://github.com/wxWidgets/wxWidgets/pull/2420
2021-07-10 23:59:09 +02:00
Vadim Zeitlin
3a587cee19 Use DPI-independent positions and sizes in render sample
Don't hardcode physical pixel values, use GetCharWidth() or FromDIP() to
make the sample appear correctly in high DPI too.
2021-07-10 22:57:18 +01:00
Vadim Zeitlin
c95a04310d Use more appropriate size for DrawChoice() in the render sample
The drawn combobox was so huge that it looked wrong, use a more
reasonable size for it.
2021-07-10 22:53:46 +01:00
Vadim Zeitlin
f1eeeb02af Rename variable in render sample to a more generic name
This will be used for things other than the header button too, so don't
use "Hdr" in its name.

No real changes, this is just a refactoring.
2021-07-10 22:53:01 +01:00
Vadim Zeitlin
0f91a4bb1f Get setuptools in httpbin installation script too if necessary
This module is not always available, e.g. it's missing in GitHub Actions
Ubuntu 16.04 image currently.
2021-07-10 23:45:27 +02:00
Vadim Zeitlin
525fb911d6 Remove special case for macOS in httpbin installation script
This is not necessary any longer since the changes of 1b76ff4887
(Disable wxWebRequest tests on CI platforms without Python 3,
2021-05-16) as we require Python 3 for httpbin anyhow.
2021-07-10 23:42:58 +02:00
Maarten Bent
75d508b6e6 Fix regression in sizes of buttons with bitmaps in wxMSW
After changes in 53eff92ea7 (Call AdjustForBitmapMargins() only once in
wxAnyButton, 2021-04-24) only the margin was accounted for, not the
image size.

Closes https://github.com/wxWidgets/wxWidgets/pull/2421
2021-07-10 23:35:10 +02:00
Vadim Zeitlin
cd8fea8056 Fix infinite recursion when resizing a TLW in wxUniv/MSW
Don't use wxClientDC in WM_NCCALCSIZE handler as creating it results in
another WM_NCCALCSIZE in wxUniv due to the call to DoSetClippingRegion()
in its wxClientDCImpl::InitDC().

Using simple WindowHDC is also a small performance gain and is all that
we need as we just need some HDC for this window and should have
probably been done like this even back in a047aff270 (Added
wxBORDER_THEME..., 2007-08-07) in which handling WM_NCCALCSIZE was
added.

Closes #19221.
2021-07-10 13:03:46 +01:00
Maarten Bent
170631ff93 Renderer theme with EXPLORER::LISTVIEW is not always available
It works in the render sample, but not in the dataview sample.
Fallback to using LISTVIEW if EXPLORER::LISTVIEW results in an invalid hTheme.
2021-07-08 20:46:52 +02:00
Maarten Bent
75c4735016 Fix using wxDCTextBgModeChanger
Correctly initialize the old background mode.
2021-07-08 20:46:36 +02:00
Vadim Zeitlin
07e80803da Merge branch 'grid-resize-fixes'
Fix spurious asserts about invalid drag row/column index in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/2413
2021-07-06 14:28:53 +02:00
Vadim Zeitlin
0685086a7b Merge branch 'univmenucapture19208' of https://github.com/Kvaz1r/wxWidgets
Fix handling mouse capture in wxUniv menus.

Avoid crashing on losing it unexpectedly.

See https://github.com/wxWidgets/wxWidgets/pull/2407
2021-07-06 14:23:36 +02:00
Vadim Zeitlin
e663d9af2b Stop using shared-ld wrapper script under Mac
We don't need to cater for gcc < 3.1 any longer and can just use
-single_module option unconditionally.

This is simpler and avoids spurious errors about "unknown option" when
using -fsanitize=xxx in LDFLAGS from the script.
2021-07-06 14:14:17 +02:00
Marc Jessome
a052557af3 Add wxKeyEvent::IsAutoRepeat()
The new method is currently supported in Qt, Cocoa, MSW ports (i.e. all
major ones except for wxGTK).

Keyboard example updated with a "Repeat" column.

Closes https://github.com/wxWidgets/wxWidgets/pull/2414
2021-07-06 12:58:05 +01:00
redtide
a37629b035 Update sample icon to use new logo image in more resolutions
Include resolutions up to 512x512 to improve appearance on high DPI
displays.

Closes https://github.com/wxWidgets/wxWidgets/pull/2417
2021-07-06 12:53:39 +01:00
Vadim Zeitlin
0112a2dd1b Merge branch 'renderer'
Preserve wxDC attributes (pen, brush, colours) in wxRenderer functions.

Also fix Explorer listview theme name in wxMSW renderer.

See https://github.com/wxWidgets/wxWidgets/pull/2412
2021-07-06 12:50:35 +01:00
Vadim Zeitlin
3f3ea4d266 Add a comment documenting wxRenderer drawing functions behaviour
Now that all ports behave consistently and preserve wxDC attributes,
document this behaviour.
2021-07-06 13:49:14 +02:00
Vadim Zeitlin
4bab6fe64f Preserve wxDC attributes in wxMac wxRenderer too
This is similar to the grand-parent commit which did the same thing for
MSW and generic renderer implementations.
2021-07-06 13:48:40 +02:00
Artur Wieczorek
7da2f989a0 Use wxPoint2DDouble in wxGCDC::DrawSpline
Code can be simplified by using wxPoint2DDouble in the calculations.
2021-07-04 22:02:20 +02:00
Artur Wieczorek
fb21a9096e Iterate over wxPointList with STL syntax in wxGCDC::DoDrawSpline
STL syntax is more readable than notation with legacy API.
2021-07-04 20:47:46 +02:00
Artur Wieczorek
07f54869cf Iterate over wxPointList with STL syntax in wxMSWDC::DoDrawSpline
STL syntax is more readable than notation with legacy API.
2021-07-04 20:43:02 +02:00
Artur Wieczorek
bdfdf82bcd Iterate over wxPointList with STL syntax in wxPostScriptDC::DoDrawSpline
STL syntax is more readable than notation with legacy API
2021-07-04 20:39:11 +02:00
Artur Wieczorek
1e2dbcbc24 Use wxPoint2DDouble in wxPostScriptDC::DrawSpline
We can simplify the code by using wxPoint2DDouble in the calculations.
2021-07-04 20:35:19 +02:00
Artur Wieczorek
9b542a965e Simplify drawing spline in wxPostScriptDC
We can produce simpler and more readable PostScript code by doing
the calculations of Bézier curve parameters in the code instead
of delegating this task to the PostScript processor.
2021-07-04 20:12:45 +02:00
Artur Wieczorek
819b11ff89 Iterate over wxPointList with STL syntax in wxDC::DoDrawSpline
STL syntax is more readable than notation with legacy API.
2021-07-04 20:06:44 +02:00
Artur Wieczorek
4423f6d256 Use wxStack instead of simulating a stack with array
We have a dedicated wxStack class so there is no need
to simulate a stack with array.
2021-07-04 19:35:48 +02:00
Artur Wieczorek
cc5bfc0fb1 Implement DrawSpline in wxSVGFileDC
Drawing Bézier curves is supported natively in SVG so these curves
should be used instead of generic wxDC implementation based on
polygonal approximation.
2021-07-04 19:22:02 +02:00
Vadim Zeitlin
02c90d126c Merge branch 'file-tests'
Clean up file tests and re-enable most of them in the CI workflow using
Wine.

See https://github.com/wxWidgets/wxWidgets/pull/2416
2021-07-04 18:23:03 +02:00
Vadim Zeitlin
9eea249924 Set locale to C.UTF-8 when running tests under Wine
Using UTF-8 encoding seems to be required for the Unicode file names to
work with Wine.
2021-07-04 17:44:39 +02:00
Kvaz1r
2f71702e4e Don't refresh unshown menu item 2021-07-04 18:34:39 +03:00
Vadim Zeitlin
425151d6ba Re-enable most of wxFileName tests under Wine
Exclude just the single test which fails when using Wine, but not all
the rest of them.

This is again similar to the grand-parent commit for the file functions
tests.
2021-07-04 15:09:06 +01:00
Vadim Zeitlin
f31a745909 Remove unnecessary c_str() from wx var arg functions arguments
Using c_str() for arguments to wxString::Printf(), Format() and
wxLogXXX() is useless since wx 2.9 days, so simply remove them.

No real changes, this is just a (long due) cleanup.
2021-07-04 15:08:13 +01:00
Vadim Zeitlin
071771474e Remove CppUnit boilerplate from wxFileName test
This is similar to the grand parent commit for the file functions.

No real changes.
2021-07-04 15:03:12 +01:00
Vadim Zeitlin
dde4413f36 Re-enable most of file functions tests under Wine
Exclude just the single test which fails for mysterious reason when
using Wine, but not all the rest of them.
2021-07-04 15:03:12 +01:00
Vadim Zeitlin
bab92b4805 Remove CppUnit boilerplate from the file functions test
This cuts down the number of lines and allows to execute, or exclude,
individual tests easily.
2021-07-04 15:03:08 +01:00
Vadim Zeitlin
3e1687c36b Use WX_ASSERT_FAILS_WITH_ASSERT in file functions test case
Make the code shorter and more clear by using an existing macro checking
that the expected assert happens instead of writing it out.
2021-07-04 13:56:24 +01:00
Vadim Zeitlin
723265f9ef Merge branch 'ci-msw-cross'
Add workflow for cross-building wxMSW on GitHub Actions.
2021-07-03 17:58:41 +02:00
Vadim Zeitlin
7d9d4c9e50 Rename GitHub Unix CI workflow
No real changes, just use a less generic name now that we have wxMSW
cross-building CI workflow too.
2021-07-03 17:57:43 +02:00
Vadim Zeitlin
5cac8a6918 Enforce valid drag column/row index in DoGridDragResize()
Add an assert to this function checking that the index is valid before
using it with wxGridOperations::GetLineStartPos(), and actually avoid
calling the function when this is not the case to avoid assertion
failures when wxEVT_GRID_CELL_LEFT_CLICK is handled in user code.

Also add comments clarifying the preconditions for calling various
drag-related functions.

Closes #19218.
2021-07-03 16:31:15 +01:00
Vadim Zeitlin
e28b2d91fc Revert commits trying to fix wxWebRequest tests under Wine
This reverts commits 7d796c6aa6 (Install python3 and pip for httpbin,
2021-06-27) and 3808e6a28d (Install winbind package required for using
wxWebRequest with Wine, 2021-06-28) as we skip wxWebRequest tests anyhow
under Wine because they don't work with its WinHTTP implementation, so
running httpbin is not necessary any longer and so neither is installing
Python.

These commits are still preserved in history and this commit itself
could be reverted later if Wine WinHTTP becomes functional enough to run
wxWebRequest tests successfully.
2021-07-03 17:21:07 +02:00
Vadim Zeitlin
2ac5510551 Skip running currently failing tests under Wine
Ideally these failures ought to be debugged and fixed, but this is not
really critical as the tests pass under native MSW systems, so it seems
like the failures are due to problems in Wine rather than with the tests
themselves, so for now simply skip the failing tests to let the entire
build pass.
2021-07-03 17:21:07 +02:00