Commit graph

75418 commits

Author SHA1 Message Date
Paul Cornett
222883d98f Avoid Clang -Wcomma warnings
For the few cases that are not trivially avoidable,
use a cast to void to silence the warning.
2023-11-23 09:17:21 -08:00
Paul Cornett
4e679c4649 Fix wxDropSource::GiveFeedback() for Wayland
"configure-event" does not occur for window movement with Wayland,
so use event loop activity as a substitute.
See #24051
2023-11-22 15:56:41 -08:00
Paul Cornett
134e15f8f7 Avoid potential negative width in wxChoice::DoGetSizeFromTextSize() 2023-11-22 14:54:36 -08:00
Paul Cornett
ae7c13a031 Fix wxDropSource::GiveFeedback() with GTK >= 3.20
Also fixes showing the drag icon.
Note that feedback still does not work for Wayland.
See #24051
2023-11-22 14:52:26 -08:00
Paul Cornett
14f6f82e46 Fix for incorrect preferred size from empty wxChoice with GTK3
See #23382
2023-11-21 22:42:01 -08:00
Paul Cornett
edd1d758de Fix wxCheckBox::SetValue() when in undetermined state with GTK
State becomes determined when SetValue() is called.
See #24074
2023-11-20 08:50:05 -08:00
Paul Cornett
f587ef7c88 Make wxDisplay::GetDepth() specific to each display with GTK 2023-11-19 17:42:49 -08:00
Paul Cornett
6857dc8e63 Make wxGC offsetting consistent across scales
In order to avoid drawing anomalies with wxGCDC on HiDPI displays, the shift
must be half a logical unit rather than half a device unit, and it needs to be
applied regardless of the scale factor. An exception is made for the zero-width
(one logical pixel) pen, which uses a half logical pixel shift. This reverts
d43b2862c3 (Fix drawing rectangle with width 1 pen using wxGCDC and HiDPI, 2023-04-25)
See #23485
2023-11-19 17:37:22 -08:00
Vadim Zeitlin
dede4b9326 Use "= default" for all trivial default ctors and dtors
Replace user-specified empty constructors and destructors with the
compiler-generated versions, which has a number of advantages for code
generation, in addition to being more clear.

Closes #22965.

Closes #24058.
2023-11-17 01:33:32 +01:00
Stefan Csomor
16cca70f8f Restore correct activation for out-of-bundle Mac executables
This restores old activation logic for Mac applications, while still
preserving the fix for #23893 from #24003.

Closes #24056.

Closes #24062.
2023-11-17 01:24:00 +01:00
Martin Corino
e64118658d Add documentation for wxSizerFlags::HorzBorder()
Closes #24059.
2023-11-17 01:22:53 +01:00
Vadim Zeitlin
aa8c95645b Merge branch 'improve-bug-report'
Try to make bug report instructions even more clear.

See #24055.
2023-11-17 01:22:08 +01:00
Stefan Csomor
991a74caad Set to wx-expected clipping behavior of drawRect
This corrects wxAUI appearance, which was totally broken when using
Sonoma SDK/Xcode 15.

See

https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14#NSView

https://developer.apple.com/forums/thread/737838

Closes #23916.

Closes #24054.
2023-11-17 01:15:59 +01:00
Stefan Csomor
21da0e128d Change wxRendererNative to use NSCell-based methods under Mac
Use wxOSX_USE_NSCELL_RENDERER to allow setting it to 0 to revert to the
old code.

Note that the new version is Objective C++, so the old .cpp file had to
be renamed to have .mm extension.

Closes #24053.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2023-11-17 01:12:49 +01:00
Blake-Madden
1d7f2becd4 Add line spacing support to MSW wxTextCtrl
Also expand and improve wxTextAttr documentation by mentioning where is
each attribute supported.

Closes #24046.
2023-11-17 01:11:14 +01:00
Vadim Zeitlin
7a73044fd2 Merge branch 'tree-search'
Don't find hidden items when using incremental tree search.

See #24041.
2023-11-17 01:08:19 +01:00
Vadim Zeitlin
ba9fe3481d Merge branch 'gtk-dpi-changed'
Generate DPI changed event in wxGTK too.

See #24040.
2023-11-17 01:06:54 +01:00
Vadim Zeitlin
5a184d423b Merge branch 'qt-uiaction-tests' of https://github.com/AliKet/wxWidgets
Enable automatic tests using wxUIActionSimulator under wxQt.

See #24015.
2023-11-17 01:05:56 +01:00
Vadim Zeitlin
ef4fecc186 Merge branches 'tree-state-bmpbundle' and 'imglist-scalefactor'
Refactor wxImageList and convert it to use physical pixels and
add support for high DPI state images wxTreeCtrl using the new
wxImageList.

See #24000, #24033.
2023-11-17 01:03:27 +01:00
Vadim Zeitlin
46feaf2066 Ignore NULL to nullptr change in git blame output
This commit touched a lot of file without really changing anything.
2023-11-17 00:38:33 +01:00
Paul Cornett
56303c6236 Document wxDisplay::GetDepth()
Should have been part of
24b5e256df (Add wxDisplay::GetDepth() and use it for wxDisplayDepth(), 2018-10-06)
2023-11-16 10:06:57 -08:00
Paul Cornett
6210c622f7 Add minimal wxVideoMode support for Wayland
See #24021
2023-11-16 09:47:37 -08:00
Paul Cornett
86a0456bc4 Build fix for wxUSE_CONFIG==0 2023-11-15 20:36:21 -08:00
Paul Cornett
67090e61d2 Improve wxSystemSettings::GetMetric() scrollbar width calculation for GTK3
See #24057
2023-11-15 20:31:24 -08:00
Vadim Zeitlin
12984a0ceb Ask to specify the build system used in build problem template
Also ask for any unusual compiler options.
2023-11-13 01:55:46 +01:00
Vadim Zeitlin
17d7cbe315 Try to make bug report instructions even more clear 2023-11-13 01:48:09 +01:00
Paul Cornett
2d07dd25b4 Improve desktop environment detection
Add code that works for Wayland, and any DE
2023-11-10 11:23:24 -08:00
Vadim Zeitlin
344a5fdb44 Don't expand collapsed tree items when using incremental search
It was unexpected and annoying that using keyboard in wxGenericTreeCtrl
could find the item completely different from the expected one because
it could open a currently collapsed branch and find an item deep under
it instead of the item visible on the screen, so change the code to only
find the visible items when typing their label in the control.
2023-11-08 01:53:49 +01:00
Vadim Zeitlin
8ca1be38e2 Add wxGenericTreeCtrl::DoGetNext(Next_Visible) function
This is similar but not totally identical to the existing
GetNextVisible() as it doesn't require the initial item itself to be
visible (notably, it could be the hidden virtual root).

It is also more efficient than the old GetNextVisible() implementation
calling GetNext() in the loop until finding a visible item, as it avoids
looking inside collapsed items in the first place.
2023-11-08 01:52:00 +01:00
Vadim Zeitlin
88a39aa6f8 Implement wxEVT_DPI_CHANGED generation for wxGTK
Just check if the scale factor has changed when getting a "configure"
event for a TLW as we're guaranteed to get one when the scale factor
does change, according to GTK documentation (and it does seem to work).

Closes #19290.
2023-11-07 20:57:31 +01:00
Vadim Zeitlin
857fa3670e Make checks for m_findBell slightly more readable
Make it clear that we only need to set it to 1 if it had been set to -1
before.

No real changes.
2023-11-07 19:05:10 +01:00
Vadim Zeitlin
163d310369 Use wxTimer::StartOnce() instead of wxTIMER_ONE_SHOT
This is more readable and shorter, so encourage using this form.

No real changes.
2023-11-07 19:01:38 +01:00
Vadim Zeitlin
39079cbf23 Return true from AddCatalog() if message ID matches language
When the original messages language matches the language of the locale
being used, these strings can be used directly and so AddCatalog()
should still return true for them but it didn't do it any more after the
changes of 94b1a17aeb (Add AddAvailableCatalog() and use it in
AddStdCatalog(), 2023-09-30).

See #18227.

Closes #24019.

Closes #24037.
2023-11-07 15:11:26 +01:00
Vadim Zeitlin
6fbb504955 Merge branch 'auibook-drag-fix'
Fix crash when dragging in wxAuiNotebook and make the code more robust.

See #24039.
2023-11-07 15:09:56 +01:00
Vadim Zeitlin
716be1bc27 Merge branch 'msw-build-mingw'
Provide more information for building applications using wxWidgets with
MinGW.

See #24036.
2023-11-07 02:33:36 +01:00
Vadim Zeitlin
1761bc3a88 Update documentation of wxTaskBarIcon limitations
Don't mention thoroughly outdated desktop environments such as Gnome 1
and don't make this X-specific as the situation is not at all better
with Wayland.

Do mention IsAvailable().

See #18081.

Closes #24028.
2023-11-07 02:32:20 +01:00
Vadim Zeitlin
7aef620715 Fix using bitmaps of different dimensions in wxWithImages
Although this is not ideal, it may still happen and sometimes can even
give acceptable results, e.g. using (16, 32) and (24) bitmap bundles
can actuall works nicely enough at x2 scaling if 16px bitmaps are
upscaled by the factor of 3.

To make this work, request the explicit physical bitmap size and
override its scale factor to ensure the resulting bitmap has the correct
logical size.
2023-11-07 00:47:07 +01:00
Vadim Zeitlin
baa56732fc Allow to get the size of all images in wxWithImages
This simplifies wxGenericTreeCtrl code but doesn't change much yet.
2023-11-07 00:26:53 +01:00
Vadim Zeitlin
6080dca576 Add wxWindow::WXNotifyDPIChange() for wxOSX and wxGTK
This refactors the already existing code in wxOSX to make it available
in the common class and allow reusing it in wxGTK.

No changes yet.
2023-11-06 23:51:30 +01:00
Vadim Zeitlin
e679e5d4c2 Replace Mac-only function with wxWindow::MakeDPIFromScaleFactor()
The new function does the same thing as the Mac-specific
OSXMakeDPIFromScaleFactor() that it replaces but is also defined in
wxGTK where it will be used too.
2023-11-06 23:51:28 +01:00
Vadim Zeitlin
2d6817b0a8 Add a function to save a bitmap callable from debugger
This allows to dump a bitmap to a disk file in order to examine it
outside of the debugger when debugging.

Note that at least MSVC and gdb are not smart enough to allow calling
wxBitmap::SaveFile() directly.
2023-11-06 22:08:51 +01:00
Vadim Zeitlin
089bf467a9 Allow passing const wxWindow* to more wxBitmapBundle methods
Take const pointer in GetConsensusSizeFor(), which only uses this
parameter to get the DPI scale factor, and CreateImageList(), using it
only to pass it on to GetConsensusSizeFor().

No real changes.
2023-11-06 22:05:25 +01:00
Vadim Zeitlin
53b4f4ddf2 Use physical size in wxImageList
This seems to be the only way to fix using this class, which is
fundamentally incompatible with high DPI support, with bitmaps of
different logical but identical physical sizes.

By using physical size we ensure that the code chopping up the provided
bitmap in multiple images doesn't do it with the bitmap having the same
physical size but a different logical size from all the other bitmaps.
And, conceptually, logical size of the bitmaps in it really shouldn't
matter to the image list as it doesn't have a scaling factor and so
can't do anything useful with the logical size.

Moreover, we can't add wxImageList::SetScaleFactor() neither because
this class is, by design, supposed to be shareable between different
controls which may use different scale factors, so it doesn't make sense
to speak of the scale factor of the image list itself.

This undoes the changes made in the generic implementation back in
c374eefd34 (Fold wxOSX-specific wxImageList into generic version,
2018-10-30) and also eb52e86553 (Take into account scale factor of
images added to wxImageList, 2021-04-03).

Also update a couple of places where wxImageList is still used to use
physical sizes. Unfortunately some others can't be easily fixed, e.g.
global wxFileIconsTable would have to be completely rewritten.

Finally, add a unit test checking that things work as expected now:
previously the size of 24x24 bitmap in the image list containing
(scaled) 32x32 bitmaps would be 21x21 due to sub-bitmap extraction
kicking in.

Closes #23994.
2023-11-06 21:18:34 +01:00
Vadim Zeitlin
a0f7980295 Add wxAuiTabCtrl::DoEndDragging()
No real changes, just refactor the code to reset all drag-related
variables in a single function instead of doing it manually in several
places.

As this function also resets m_clickTab, which could previosuly remain a
dangling pointer, change the code to get its value before calling it.
2023-11-06 00:11:52 +01:00
Vadim Zeitlin
0fd15e405f Initialize wxAuiTabCtrl members in their declarations
Ensure that all of them are initialized, including m_clickTab, which
didn't seem to be always initialized before.

No real changes (as m_clickTab doesn't seem to have been used before it
was initialized).
2023-11-06 00:05:50 +01:00
Vadim Zeitlin
bd7b333a87 Ensure that we only pass valid indices to wxAuiTabCtrl::GetPage()
Passing an invalid index to this function results in a crash, so ensure
this doesn't happen -- at the very least this would have turned the
crash fixed by the parent commit into "just" an assert failure.
2023-11-06 00:02:57 +01:00
Vadim Zeitlin
f1a3816cd9 Fix crash in wxAuiNotebook after dragging a page
Fix using outdated click position in wxAuiTabCtrl mouse handlers, which
resulted in an invalid wxEVT_AUINOTEBOOK_DRAG_MOTION event being
generated and a crash while handling it.

Ensure that we reset m_clickPt when resetting m_isDragging too so that
we don't decide that we're dragging if the mouse enters the window with
the left button already pressed after a previous drag.

Closes #24027.
2023-11-05 23:50:51 +01:00
Vadim Zeitlin
523979b1f1 Explain that using MSVC-specific wx/setup.h is optional
It made sense to emphasize its use when this was the recommended way to
set up MSVS projects, but now the simplest (and hence recommended) way
to do it is using wxwidgets.props file, so make the manual setup
instructions more generic as they're most likely to be used with
non-MSVC compilers.
2023-11-05 02:26:58 +01:00
Vadim Zeitlin
23abd00d0b Slightly improve the example list of libraries to link with
Fix spelling error and use more forward-looking "34" in their names.
2023-11-05 02:26:58 +01:00
Vadim Zeitlin
ae91254d3e Provide MinGW-specific instructions for building applications
We had instructions for building wxWidgets with MinGW but not for
building the applications using wxWidgets, so add them too now in the
hope that it will be helpful to people who struggle to find the options
to use for building -- or at the very least to the people who have to
answer the questions about this, as they could now just point to these
instructions.
2023-11-05 02:26:58 +01:00