Commit Graph

72662 Commits

Author SHA1 Message Date
PB
7d73617b33 Add Windows 11 to supported platforms listed in README.md 2022-04-18 22:19:57 +02:00
Artur Wieczorek
b06b950574 Document changes in wxImageFileProperty
Remove references to the non-public member variables
from documentation.
2022-04-18 22:17:31 +02:00
Vadim Zeitlin
87a0472485 Fix size of the font returned from wxFontDialog in wxMSW
Ensure that the font has exactly the point size entered in the dialog,
rather than having a fractional point size close, but not identical, to
it, as happened before due to first rounding the result of converting
the point size to pixels and then _not_ rounding the result of the
reverse conversion.

This resulted in wxFont::GetPointSize() returning the correct value, but
not GetFractionalPointSize(). Now the latter returns the same, correctly
rounded, value too.
2022-04-18 19:03:03 +01:00
Vadim Zeitlin
91f1be23dd Fix initial point size in MSW wxFontDialog in high DPI
The native dialog doesn't take the actual DPI into account, so convert
our font sizes that do use the DPI to the standard one before using it
and convert font height back to the value corresponding to the actual
DPI once a font is selected in it.

Closes #22313.
2022-04-18 19:02:38 +01:00
Stefan Csomor
7fc2024f0e support required compilation failure for comboboxtest on platforms with wxUSE_COMBOBOX==0 2022-04-18 19:29:45 +02:00
Stefan Csomor
e5827d0ae9 using proper bash defaults
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
2022-04-18 17:37:03 +02:00
Vadim Zeitlin
02434dcc1f Workaround a crash with MSYS2 gcc 9.1 again
The changes of 2144ca38d2 (Get rid of CppUnit boilerplate in
DynamicLibraryTestCase, 2022-04-17) accidentally undid the workaround
from 054cb35b39 (Workaround for a crash with gcc 9.1 from MSYS2 MinGW
32bit, 2019-08-03), so work around the same problem again by avoiding
using CHECK() with function pointers.
2022-04-18 14:36:52 +02:00
Vadim Zeitlin
61e24f6be0 Give more information if wxFont unit tests fail
Use INFO() to provide extra information instead of the ugly
WX_ASSERT_MESSAGE().
2022-04-18 14:29:53 +02:00
Scott Talbert
19d3e2d902 Fix wxIcon::GetLogicalSize documentation 2022-04-17 23:41:46 -04:00
Scott Talbert
7a98e93bb4 Fix wxListCtrl::RemoveSortIndicator documentation 2022-04-17 22:27:29 -04:00
Stefan Csomor
6afd2e8f87 Revert "making sure CI builds don’t contaminated checked out directory on self-hosted runner"
This reverts commit 88bd6d0135. we’re trying to use this approach: https://docs.github.com/en/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
2022-04-17 23:33:50 +02:00
Stefan Csomor
88bd6d0135 making sure CI builds don’t contaminated checked out directory on self-hosted runner
self-hosted runners are stateful - surprise - so we have to isolate things better
2022-04-17 20:47:54 +02:00
Vadim Zeitlin
b66d4488e1 Merge branch 'fn-long-path'
Fix wxPATH_NORM_LONG with UNC paths and slightly optimize long path
normalization.

See #22307.
2022-04-17 18:51:09 +02:00
Vadim Zeitlin
6998eaf154 Merge branches 'no-unused-err' and 'dynlib-test-fix'
Fix CI builds under macOS 12 with clang 13.
2022-04-17 18:49:52 +02:00
Vadim Zeitlin
26e35e0170 Use port free even under macOS 12 port for running httpbin
The default httpbin listening port 5000 is used by Monterrey (macOS 12)
Control Center for its own needs, so use another port to avoid conflicts
with it and the resulting failures when running wxWebRequest unit tests
under this macOS version.
2022-04-17 18:48:12 +02:00
Vadim Zeitlin
2144ca38d2 Get rid of CppUnit boilerplate in DynamicLibraryTestCase
Use CATCH macros directly, this is simpler and more clear.

Also use narrow strings instead of wide ones and get rid of wxT() too.

No real changes.

This commit is best viewed ignoring whitespace-only changes.
2022-04-17 18:44:51 +02:00
Vadim Zeitlin
f3b4ee3b5f Skip dynamic library file existence check under Darwin
Under Monterrey (macOS 10.12) we can actually load the file using
wxDynamicLibrary even though it does _not_ exist on the disk, so don't
skip the test just because of this.
2022-04-17 18:38:08 +02:00
Vadim Zeitlin
c6b3b4a39c Make the warning in DynamicLibraryTestCase actually visible
Using wxLogWarning() doesn't work as logs are suppressed by default, but
using CATCH WARN() macro does work.
2022-04-17 18:35:34 +02:00
Vadim Zeitlin
6a48431ca1 Add missing wxLogWarning() argument to wxDynamicLibrary test
The argument corresponding to the "%s" format specifier was missing,
which resulted in a crash if the dynamic library tested didn't actually
exist.
2022-04-17 18:30:42 +02:00
utelle
8ab635b451 Improve wxLocale backwards compatibility and enhance wxUILocale
Restore the old behaviour of wxLocale, which is supposed to use the
default locale and not the preferred language, which may not be the same
(see #22281).

Also apply the following fixes and improvements to wxUILocale:

- Add new GetSystemLocale() method.
- Change the MSW implementation to use the default locale instead of the
  preferred UI language for Windows versions below Windows 10.
- Change the Unix implementation to respect LANGUAGE environment
  variable and use it for determining the preferred UI languages.
- Use wxUILocale in wxTranslations to determine the preferred UI
  languages.
- Use wxUILocale during initialization of internat sample.

Closes #22281.

Closes #22318.
2022-04-17 18:04:21 +02:00
Maarten Bent
4a3098aebb Optimize MSW wxNotebook background painting
MSWDefWindowProc(WM_PAINT, ...) in OnPaint causes performance issues on
large screens so only use it when an actual custom background colour is
set.

Closes #22308.

Closes #22320.
2022-04-17 17:59:24 +02:00
Vadim Zeitlin
7d31e055c4 Don't touch non-wx libraries in "make install" under Mac
Only run install_name_tool on our own libraries as part of "make
install" instead of doing it on all libraries in the installation
directory: this was at best useless and at worst harmful, as some
combinations of install_name_tool and macOS versions don't work well
together and result in corrupting the already installed libraries.
2022-04-17 17:59:01 +02:00
Vadim Zeitlin
f68993111c Change DPI awareness only for ChooseFont() duration
Extract ChooseFont() in a small helper function to ensure that the DPI
awareness is restored as soon as it returns.

No real changes yet.
2022-04-17 16:55:38 +01:00
Vadim Zeitlin
67da8bc7e0 Fix warning about unused "err" from clang 13 in release build
Don't just wxASSERT(err == 0), as this expands to nothing in the release
builds. Use wxCHECK() instead so that we at least return an error even
in the release builds too.
2022-04-17 16:31:03 +02:00
Vadim Zeitlin
37a9a33150 Use wxScopedArray instead of new[] in wxOSX display code
Avoid manual memory management.

This was already fixed once in 563f41c686 (Fix memory leak on error
return in wxOSX wxDisplay code., 2014-02-21) but incompletely and then
another instance of new/delete[] was reintroduced in d5180d3604 (add a
GetFromWindow implementation to wxDisplayFactory, 2020-08-07). Get rid
of all of them now and use wxScopedArray<> instead (we could also use
wxVector<> or even std::vector<> too).

No real changes.
2022-04-17 16:30:58 +02:00
Vadim Zeitlin
fac4822ab3 Make wxAuiNotebook::FindPage() work correctly
Make this function virtual in the base class so that it could be
overridden to do the right thing in wxAuiNotebook, instead of just
always returning NULL as before and add a unit test checking that it
works.

Explain that wxBookCtrlBase::m_pages may not be used in the derived
classes, but that in this case they must override all the methods using
it.

Finally, "soft-deprecate" wxAuiNotebook::GetPageIndex(), which is
identical to FindPage() now.

This fixes infinite recursion when handling wxEVT_HELP in wxAuiNotebook
in wxUniv too, see #22309.

Closes #15932.
2022-04-16 23:01:57 +01:00
Vadim Zeitlin
8afbf79d02 Take const pointer in wxAuiTabContainer::GetIdxFromWindow()
Allow passing const pointers to this function, as it doesn't need to
modify them at all.
2022-04-16 22:52:30 +01:00
Vadim Zeitlin
59463eced4 Simplify check for wxEVT_HELP origin in wxBookCtrl for main ports
Restrict the extra workaround for wxUniversal wxNotebook added back in
ec09e18d35 (more fixes to OnHelp() to avoid infinite recursion when
handling help events, 2006-06-14) to wxUniversal, to keep the code
simpler and more robust in the main ports.

Notably, this is sufficient to fix infinite recursion when pressing F1
in a wxTextCtrl used as a wxAuiNotebook page in non-wxUniv builds.

See #22309.
2022-04-16 22:36:13 +01:00
Vadim Zeitlin
9be821c71a Create a full page text, rather than a button, in notebook sample
This is much more realistic and looks less weirdly.

Also add the text directly as a page, without wrapping it in a panel,
just to show that this is possible and works too.

No real changes.
2022-04-16 20:01:23 +01:00
Vadim Zeitlin
caac3a4f19 Load SetThreadDpiAwarenessContext() function pointer only once
A small optimization to avoid resolving this function dynamically every
time it is needed and just do it once, on first use.
2022-04-16 17:49:09 +01:00
Vadim Zeitlin
9b25ed038a Add an accelerator for the font dialog in the dialogs sample
No real changes, just make it faster to bring up the font dialog for
testing.
2022-04-16 16:40:49 +01:00
Vadim Zeitlin
73dc9086f5 Don't fail the entire CI run just because of cache saving error
Update ccache-action to a not yet released version including the fix for
failing the entire CI job if saving the cache failed -- this shouldn't
happen at all, but in practice it does happen from time to time, and
it's better to succeed, rather than fail in this case.
2022-04-16 16:07:20 +02:00
kkocdko
02741a6c92 CMake: Fix build with wxBUILD_MONOLITHIC
Add wxUSE_WEBVIEW test before using wx_webview_copy_webview2_loader.

Closes #22315, #22316.
2022-04-16 15:38:44 +02:00
Maarten Bent
4fa3b8c276 CMake: Fix the minimum supported version
Change the minimum version to 3.0. Version 2.8.12 has never worked,
because it does not support the VERSION parameter in project().

Replace GREATER_EQUAL comparisons, these are only supported since 3.7.

Move PCH related code to a separate file, and include it after
options.cmake and init.cmake. Because only then the wxBUILD_PRECOMP
variable is fully initialized.

Closes #22312.
2022-04-16 15:35:49 +02:00
PB
92deb92e29 Use doubled backslashes in examples in wxFileName documentation
Fix syntax of C strings in the examples.

Closes #22311.
2022-04-16 15:34:08 +02:00
Vadim Zeitlin
a47382f95d Revert accidental changes to the samples
This reverts parts of 533958be10 (recreating Xcode project files with
new script, 2022-04-16) that seem to have been committed accidentally
and are now preventing CI builds from passing.
2022-04-16 15:33:05 +02:00
Stefan Csomor
88f5a14d34 Removing outdated AppleScript, updating docs 2022-04-16 14:48:58 +02:00
Stefan Csomor
533958be10 recreating Xcode project files with new script 2022-04-16 14:27:24 +02:00
Maarten Bent
5d40285226 Add GetDPIScaleFactor documentation for wxDC and wxGraphicsContext 2022-04-16 01:11:34 +02:00
Maarten Bent
48fe7725c4 Make the polygon page in the drawing sample DPI aware
Use wxDC::GetDPIScaleFactor to scale the coordinates.

Initialize wxGCDC with a wxWindow, so it can infer the scale from the window.
2022-04-16 01:11:34 +02:00
Maarten Bent
ee2b02614e Add GetDPIScaleFactor to wxDC and wxGraphicsContext
It can be used to scale coordinates and sizes to make them DPI aware.

In the common headers, use wxDisplay::GetStdPPIValue() as default DPI value,
so the correct values are used on Windows (96) and macOS (72).

In wxMemoryDC use m_contentScaleFactor as the DPIScaleFactor, see e4c2298e5e
(Use window scale factor for all MSW wxDCs associated with windows, 2022-04-04).
2022-04-16 01:11:33 +02:00
Artur Wieczorek
d72a3f7cec Create wxBitmap compatible with wxDC for all ports
Ctor creating wxBitmap compatible with wxDC is now implemented in all
ports.
2022-04-15 10:12:41 +02:00
Vadim Zeitlin
d6c3344c6f Don't try finding the long form of non-existent paths
This is at best useless and at worst harmful, as shown by the bug fixed
in the previous commit, so just don't do it if GetLongPathName() has
already determined that the path doesn't exist.
2022-04-15 00:32:35 +01:00
Vadim Zeitlin
35d08e6a87 Don't corrupt UNC paths when normalizing with wxPATH_NORM_LONG
After the fixes to UNC paths handling, Normalize(wxPATH_NORM_LONG)
started adding an extra colon after the UNC paths.

Fix this by using wxGetVolumeString() instead of constructing this thing
manually and add a unit test checking for this.

Closes #22275.
2022-04-15 00:32:35 +01:00
Vadim Zeitlin
e50c7b2e2f Add GetDOSPath() helper to wxFileName unit test
No real changes.
2022-04-15 00:13:07 +01:00
DINAKAR T.D
95cb963d33 Update Tamil translations for wx 3.1.6 2022-04-14 23:57:45 +02:00
Maarten Bent
9a255463f9 Fix wrong wxMenuItem::GetBitmap() return type documentation
This function returns wxBitmap by object, not by (const) reference since
wxBitmapBundle-related changes.

Also change signature of the other methods taking wxBitmapBundle instead
of wxBitmap now.

And some other minor improvements.

Closes #22306.
2022-04-14 23:22:41 +02:00
Vadim Zeitlin
105e81a4b0 Merge branch 'cmake-gtk2' of github.com:MaartenBent/wxWidgets
Fix some CMake and build warnings with GTK2.

See #22305.
2022-04-14 23:19:54 +02:00
Vadim Zeitlin
54bdc6bbd2 Merge branch 'configure-snprintf'
Don't use AC_CHECK_FUNCS(snprintf) which doesn't work with the latest
MinGW API headers (see https://sourceforge.net/p/mingw-w64/bugs/935/)
and some other minor cleanup.

See #22302.
2022-04-14 23:18:16 +02:00
Maarten Bent
5bea1dc18a Fix static build using extended RTTI
Fix declaration of 'o' hides previous local declaration warnings.

Change two wxCONSTRUCTOR_5 definitions using wxBitmapBundle instead of
wxBitmap (this does not give build errors).

wxGenericCalendarCtrl is missing all XTI implementations, so just use
RTTI. And fix building the xti sample.

Note the shared build still fails due to WXDLLIMPEXP related issues.

Closes #22300.

Closes #22301.
2022-04-14 23:17:05 +02:00