Commit graph

75243 commits

Author SHA1 Message Date
Vadim Zeitlin
b6bfdd97c9 Merge branch 'master' into webview-chromium
Update to the latest master.
2023-08-30 02:03:00 +02:00
Vadim Zeitlin
00366cbaae Merge branch 'animation-hidpi'
Add support for specifying multiple animations to allow automatically
showing a higher resolution version when using high DPI, just as it was
already possible with the bitmaps.

See #23817.
2023-08-29 01:53:36 +02:00
Blake-Madden
e4388d4f87 Add accessors for underling wxTextCtrl GTK widgets
Allow retrieving GtkTextBuffer or GtkEditable used for multi- and
single-line controls respectively.

Closes #23829.
2023-08-29 01:52:51 +02:00
Vadim Zeitlin
bb4b667507 Add high DPI throbber GIF to CMake build system too 2023-08-28 02:17:04 +02:00
Darrell Wright
13aa094ea6 Fix crash in "View text" dialog of the webview sample
Set the sizer on the dialog and not the main frame itself.

Closes #23830.
2023-08-28 02:14:00 +02:00
PB
714103d00d Fix typo in clipboard header files
There was a typo in the class name (wxClipboad) in the
Purpose header.

Closes #23827.
2023-08-26 23:51:58 +02:00
Vadim Zeitlin
329d35b922 Fix crash on DPI change for wxStaticBox without a control label
Check that we have a label before repositioning it fix the crash
introduced by d847f3b039 (Fix position of label window in wxStaticBox
after DPI change, 2023-08-05).

See #23740.

Closes #23826.
2023-08-26 23:24:47 +02:00
PB
7a3f6b6847 Fix displaying file size in sockets/client sample
When testing downloading with wxURL and header Content-Length
is not available, display "n/a" as the file size instead of
the value of (unsigned long)-1.

Closes #23825.
2023-08-26 23:20:36 +02:00
Vadim Zeitlin
69c1d19a8d Fix typo in wxKeyEvent documentation for Ctrl-letter events 2023-08-26 17:20:31 +02:00
Vadim Zeitlin
7f5899e139 Improve manifest-related comments in samples resource file
In particular explicitly mention that wxUSE_DPI_AWARE_MANIFEST has no
effect unless wxUSE_RC_MANIFEST is set to 1.

Closes #23816.
2023-08-26 17:20:19 +02:00
PB
70bb1824d3 Fix WXWIN_COMPATIBILITY_3_2 check in MSW clipboard code
WXWIN_COMPATIBILITY_* checks must use #if, not #ifdef.

Closes #23822.
2023-08-26 16:52:15 +02:00
vvs31415
16f24c172b Re-enable some previously disabled MSVC warnings
They don't seem to be given with the current version of wx and MSVC any
more, so don't suppress them any more.

Closes #23798.
2023-08-26 13:21:46 +02:00
Ivan Sorokin
3492bacde5 Fix key codes in key up/down events with non-US keyboard layout
Changes using XKB for getting key codes for the events in wxGTK resulted
in always using the key codes for the US keyboard which was incompatible
and arguably wrong too.

Change the logic to only use XKB when we don't have a valid key code in
the current layout to restore the old behaviour.

Closes #23680.

Closes #23818.
2023-08-26 13:07:27 +02:00
Kumazuma
b8d49138cc Fix EVT_PRESS_AND_TAP() event macro definition
Use correct type for the event handler cast.

Closes #23819.
2023-08-26 12:28:05 +02:00
Vadim Zeitlin
b284ede300 Merge branch 'memstream-peek'
Return 1 from LastRead() after successful wxMemoryInputStream::Peek()
call.

See #23758.
2023-08-26 12:27:28 +02:00
Vadim Zeitlin
7758388e9a Document that wxStream::Peek() affects LastRead() as expected
This is the case for all streams now after the changes of the previous
commit.
2023-08-26 01:51:57 +02:00
Vadim Zeitlin
2dd39d6b8c Stop using wxClientDC in wxGenericAnimationCtrl
Just refresh the window and repaint it from OnPaint().

This was already effectively done under Mac and now this class can be
also used in wxGTK (where it may be preferable to the native one as the
latter one doesn't support high DPI animations yet).
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
a91e974004 Use more readable wxTimer::StartOnce() instead of Start(true)
No real changes, just make it more clear what the code does.
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
0af5a0165a Remove unnecessary wxMemoryDC::SelectObject(wxNullBitmap) calls
This is done in the local variable dtor anyhow, don't bother doing it
explicitly.

No real changes.
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
cb99932114 Add support for specifying high DPI animations in XRC
Deprecate wxXmlResourceHandler::GetAnimation() function which returns
just a single animation and add a new GetAnimations() replacing it.

Use the new function in wxAnimationCtrl XRC handler to pass all the
animations defined in the XRC file to the control.
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
27e80f81b4 Add high DPI support to generic wxAnimationCtrl
Allow specifying multiple animation versions, for different resolutions,
when setting the animation to use via wxAnimationBundle class which is a
much simpler version of wxBitmapBundle used elsewhere.

This is not implemented for the native GTK version yet.

Update the sample, even though the difference in it is not really
noticeable as the "high DPI" throbber is just a scaled up version of the
existing standard DPI animation produced using gifsicle.
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
15f19d5d0f Add wxSize::IsAtLeast() helper
This function is trivial but still useful and it doesn't cost much to
have it.
2023-08-25 20:37:58 +02:00
Vadim Zeitlin
cc5f5f90b0 Show high resolution bitmaps in wxBusyInfo if available
Instead of always scaling the single bitmap passed to it, allow passing
wxBitmapBundle and select the bitmap most appropriate for the current
resolution from it.

Closes #23813.
2023-08-25 20:32:07 +02:00
Vadim Zeitlin
bd4650767f Prevent pasting invalid characters when using wxTextValidator
It shouldn't be possible to put characters that can't be entered into
the associated control directly by pasting them, so intercept paste
events too and filter out any invalid characters.

Closes #10281.

Closes #23812.
2023-08-25 20:31:35 +02:00
Martin Corino
cd8a854dce Don't stop wxWindowDestroyEvent processing in wxAuiManager
The existing code prevented the other handlers from processing this even
for no good reason, so don't do it any more.

Closes #23811.

Closes #23815.
2023-08-25 17:24:16 +02:00
Vadim Zeitlin
d30649c381 Add mailmap entry for Hans Mackowiak
One of Hans's commits somehow used a wrong email.
2023-08-25 17:23:38 +02:00
Vadim Zeitlin
d69ddb8656 Revert all recent wxUSE_DPI_AWARE_MANIFEST-related changes
This reverts 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23) and all the commits which tried to
fix the breakage caused by it.

While the original change had merit, it seems to be too difficult to fix
all our build systems to avoid embedding manifest when defining this in
the code, like samples/sample.rc does, so revert this change for now.

Maybe it can be reintroduced in the future after switching to some other
build system.
2023-08-25 00:03:47 +02:00
Vadim Zeitlin
1d50fa5207 Merge branch 'cmake-manifest' of https://github.com/MaartenBent/wxWidgets
Really fix CMake build after the changes of 5d630caabd (Make it enough
to predefine only wxUSE_DPI_AWARE_MANIFEST, 2023-08-23).

See #23810.
2023-08-24 17:25:50 +02:00
Vadim Zeitlin
a56219532e Don't embed manifest in GUI test MSVS project neither
This is similar to f6255e456b (Don't embed default manifest in minimal
samples MSVC project, 2023-08-24) but for the GUI test, which was also
broken by 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23).
2023-08-24 17:24:07 +02:00
Maarten Bent
38504acac6
Don't ignore CMake files for msw clang build in CI 2023-08-24 16:28:39 +02:00
Maarten Bent
026528f861
Fix CMake build issues after enabling manifest from rc file 2023-08-24 16:26:47 +02:00
PB
10d09ec2b2 Remove outdated parts from build system
Remove support for unsupported MSVS versions earlier than 2015
and Windows versions earlier than 7 from CMake build as they are not
supported any longer.

Also update wxUSE_GRAPHICS_GDIPLUS and wxUSE_GRAPHICS_DIRECT2D comments
in wxMSW setup.h to remove mentions of unsupported Windows XP but do
mention that MinGW-w64 can use Direct2D.

Closes #23787.
2023-08-24 15:15:57 +02:00
PB
811df1e2b0 Update maximum supported compiler versions in main readme
Update maximum supported versions for gcc and clang in the
main readme.

Closes #23792.
2023-08-24 15:05:03 +02:00
Vadim Zeitlin
e6ad7bc077 Fix non-breakable spaces accidentally committed in parent commit
Replace them with normal spaces to prevent CMake from giving an
incomprehensible error.
2023-08-24 13:25:29 +02:00
Maarten Bent
570af08ea1 Fix manifest in MSW CMake build after recent changes
Don't embed the manifests explicitly when wxUSE_DPI_AWARE_MANIFEST is
set any more, as this is done by wx/msw/wx.rc after the changes of
5d630caabd (Make it enough to predefine only wxUSE_DPI_AWARE_MANIFEST,
2023-08-23).
2023-08-24 13:09:13 +02:00
Paul Cornett
496a9a40a1 Avoid division-by-zero in wxImage::Paste()
See #23791
2023-08-23 23:03:43 -07:00
Vadim Zeitlin
f6255e456b Don't embed default manifest in minimal samples MSVC project
This clashes with the wx manifest which is getting included now after
the changes of 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23).
2023-08-24 03:28:12 +02:00
Vadim Zeitlin
45dc55b047 Merge branch 'wxrc-multi-bitmap'
Support multiple bitmaps in <bitmap> elements in wxrc.

See #23795.
2023-08-24 02:51:51 +02:00
Vadim Zeitlin
55c704a1b4 Pin httpbin to the previously working 0.7.0 version
The recently released 0.10.0 doesn't seem to have any actual changes but
has new dependencies which broke the previously working builds.

Closes #23800.
2023-08-24 02:51:16 +02:00
Samuel Thibault
62f75c235d Fix DynamicLibrary::Load() test for less common platforms
alpha and ia64 use libc.so.6.1, GNU/kFreeBSD uses libc.so.0.1, and
GNU/Hurd uses libc.so.0.3, so check for these versions too in addition
to 6 and 7 used under x86 Linux.

Closes #23801.
2023-08-24 02:49:31 +02:00
PB
547d49f68b Fix typo in wxColourDialog documentation
The code example in wxColourDialog documentation used
a wrong type to create wxColourDialog instance.

Closes #23793.

Closes #23794.
2023-08-24 02:42:39 +02:00
PB
af453674b6 Improve wxFileSystem::AddHandler() documentation
The note in the method description incorrectly stated that
"...the handlers are deleted in wxFileSystem's destructor so
that you don't have to care about it." However, unless a
handler is removed by calling wxFileSystem::RemoveHandler()
(or undocumented wxFileSystem::CleanUpHandlers()), it is deleted
only when wxWidgets shuts down in wxFileSystemModule::OnExit().

Update the method documentation that it is correct (and similar to
that of wxImage::AddHandler()).

Closes #23789.
2023-08-24 02:38:51 +02:00
Kvaz1r
d282cc9657 Fix creating wxRadioBox with no items in wxUniv
Don't select the first item if there are no items at all.

Closes #23784.
2023-08-24 02:31:22 +02:00
Carlo Bramini
15d7aaaa50 Fix wxLocale::GetInfo() unit test under Cygwin
Use the French date format expected by Cygwin CRT which differs from the
one used by MSVC.

Closes #23782.
2023-08-24 02:25:25 +02:00
Carlo Bramini
1bc8631b52 Fix DynamicLibrary::Load unit test under Cygwin
While running the test_base on CYGWIN, this message will be printed on the console:

-------------------------------------------------------------------------------
DynamicLibrary::Load
-------------------------------------------------------------------------------
/cygdrive/c/Users/carlo/Documents/GitHub/wxWidgets/tests/misc/dynamiclib.cpp:26
...............................................................................

/cygdrive/c/Users/carlo/Documents/GitHub/wxWidgets/tests/misc/dynamiclib.cpp:80: warning:
  Couldn't find libc.so, skipping DynamicLibrary::Load() test.

/cygdrive/c/Users/carlo/Documents/GitHub/wxWidgets/tests/misc/dynamiclib.cpp:84: warning:
  Possible candidates:
  /lib/libc.a
  /usr/lib/libc.a

CYGWIN uses NEWLIB as C library and it is compiled into cygwin1.dll.
This patch adds the right test case for CYGWIN, for letting the execution of the test.

Closes #23781.
2023-08-24 02:24:16 +02:00
PB
61bae154d3 Improve samples appearance in dark mode
- caret: Use the system color for window background instead of
  hard-coded white.

- image: Use hard-coded black for the text drawing since all other
  drawings on the image canvas use hard-coded colours too. The default
  text colour was barely readable in dark mode.

- joytest: Use wxCYAN_PEN instead of wxBLACK_PEN to ensure the line is
  visible both in light and dark colour system mode.

- ownerdrw: Use such background colour that there is good contrast
  between text and background both in light and dark colour system mode.

- popup: Use such background colour for the pop up so that there is a
  good contrast between text and background both in light and dark
  colour system mode.

Closes #23773.
2023-08-24 02:22:19 +02:00
Vadim Zeitlin
9e8ab658fe Add MSVS 2022 solution file for wxrc too
Add another manually created solution file, after adding the solutions
for MSVS 2017 and 2019 in cfe4a10995 (Add manually created MSVS 201x
solutions files for wxrc, 2019-01-07) to make it possible to build wxrc
with MSVS 2022 easily too.
2023-08-23 23:24:40 +02:00
PB
9536583c0f Improve the combo sample
In the dialog, create the controls put in the static box sizer
with the sizer's static box as the parent instead of the dialog.

Improve appearance of custom drawn items in dark mode.

Closes #23765.
2023-08-23 23:08:52 +02:00
PB
ecd01698e7 Document more MSW dark mode limitations
Add that anything using task dialog does not support dark mode.

Mention that most common dialogs do not support dark mode.

Mention that calling wxMenu::Break() will turn the menu light.

Closes #23769.
2023-08-23 23:08:15 +02:00
Vadim Zeitlin
ab88fecdc5 Add support for multi-resolution bitmaps to wxrc
Handle multiple semicolon-separated paths in <bitmap> elements which are
used to provide several versions of the same bitmap in different
resolutions.

This commit is best viewed ignoring whitespace-only changes.
2023-08-23 18:03:03 +02:00