Commit graph

43343 commits

Author SHA1 Message Date
Vadim Zeitlin
5318637839 Merge branch 'fix_SVG_premultiply' of https://github.com/teliseo/wxWidgets
Fix wxBitmapBundle::FromSVG(), which renders incorrectly on GTK and add
wxHAS_PREMULTIPLIED_ALPHA to make the code dealing with alpha more clear
and correct.

See #24097.
2023-11-30 02:35:20 +01:00
Lauri Nurmi
2b0ee48ef7 Fix double negatives used with 'neither'
Replace most 'neither' words introduced after 66916c74a3 (Fix double
negatives used with 'neither' in docs and comments, 2022-08-15) with
'either'.

All changes are to comments only.

Closes #24090.
2023-11-30 02:31:42 +01:00
Ian McInerney
97cba7c0ca Restore ToCDouble compatibility with leading spaces/+ and hex
The previous ToCDouble() function accepted leading spaces, a starting +
sign, and hex strings. std::from_chars() does not accept spaces or +,
and requires a special flag to convert hex strings, so handle this
manually to preserve the old behaviour of this function.

This is similar to the changes done for ToCULong() in #24022.

Closes #24089.
2023-11-30 02:29:58 +01:00
Randalphwa
b5fea3cbf6 Fix crash in wxLogGui when wxUSE_LOG_DIALOG==0
This fixes a crash when DoShowMultipleLogMessages() is called with
wxUSE_LOG_DIALOG set to 0. The code after the #else statement gets the
size of the wxArrayString but then instead of accessing that array, it
tried to access the m_aMessages array which is empty, resulting in a
crash in the C runtime. This commit simply gets the strings from the
correct array.

Closes #24087.
2023-11-30 02:24:30 +01:00
Blake-Madden
2c1cdf9c02 Fix typos and repeated words in comments and documentation
Closes #24085.
2023-11-30 02:21:34 +01:00
Stefan Csomor
bcbc31e97f Fix clipping of scrolled windows under macOS Sonoma
We need to use a native clip view for things to behave correctly under
this OS version, otherwise scrollbars can be overdrawn by the window
contents.

Closes #24067.

Closes #24073.
2023-11-30 02:16:04 +01:00
Vadim Zeitlin
8ca312b17c Use RAII helper for cleanup in wxTIFFHandler::SaveFile()
No real changes, just put cleanup code in a single place.
2023-11-30 02:08:49 +01:00
Vadim Zeitlin
70710a7656 Remove unnecessary cast of TIFFClose() return value
It doesn't have any, so explicitly casting it to "void" is useless and
misleading.
2023-11-30 01:59:48 +01:00
BrianDelalex
614135da5b Improve error checking when saving images in TIFF format
Use TIFFFlush() in wxTIFFHandler::SaveFile() in order to check for
success when saving TIFF images, as TIFFClose() doesn't have any error
code to do it.

Closes #23214.

Closes #24072.
2023-11-30 01:58:08 +01:00
Blake-Madden
49ddc51007 Add bullet number and style support to MSW wxTextCtrl
Make bullet style-related functions in wxTextAttr work for the native
(rich) text controls too.

Closes #24069.
2023-11-30 01:53:50 +01:00
Paul Cornett
8cd33455fe Fix generic wxDataViewCtrl drag hint size with GTK
Some WMs initially report incorrect frame extents for the hint window,
then correct it to 0x0 later. This interacts badly with the deferred
show mechanism, causing the hint window height to be much too small.
Issues with TLW decoration sizes can be avoided by setting the client
size rather than the overall size.
2023-11-27 23:27:43 -08:00
Paul Cornett
d2140993de Fix generic wxDataViewCtrl drag hint transparency with GTK
wxGTK requires SetTransparent() be called before Show().
See #24084
2023-11-27 23:08:22 -08:00
Paul Cornett
175237119b Fix wxCheckBox undetermined state showing as checked with some themes
Simplify the code some and ensure that "inconsistent" and "active"
are not set at the same time.
See #24074
2023-11-27 12:51:41 -08:00
Tim Eliseo
fce4941404 Add wxHAS_PREMULTIPLIED_ALPHA to abstract if wxBitmap pixels are premultiplied.
All previous relevant platform-specific tests have been changed to use this
symbol. Also, samples/image now premultiplies conditionally, correcting a
visual anomaly on wxGTK.
2023-11-26 13:23:52 -08:00
Tim Eliseo
17c34d41ba Don't premultiply pixels from wxBitmapBundle::FromSVG() on wxGTK.
See #24064.
2023-11-26 13:23:52 -08:00
Paul Cornett
8ea22b5e92 Avoid crash with GTK3 if console program is using a GUI wxApp class
See #24081
2023-11-23 15:12:08 -08:00
Paul Cornett
978fa7ed06 Avoid a few fallthrough warnings 2023-11-23 09:42:59 -08:00
Paul Cornett
4030f3b90c Remove extraneous semicolons 2023-11-23 09:25:03 -08:00
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
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
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
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
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
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