Some (very) old MinGW versions, such as 5.3.0 used on AppVeyor CI for
3.2 builds, don't provide the definition of this constant, so do it
ourselves.
See #23747.
Set a flag in insertText and send wxEVT_KEY_DOWN ourselves from
DoHandleKeyEvent() if it wasn't set to ensure that we generate these
events for the keys ignored by the standard insertText, such as
⌘+⎇+Letter combination.
Closes#23671.
See #23699.
Use the same versions of config.{guess,sub} in the submodules where they
are used (so not in src/{jpeg,png}) as in wx itself to avoid any
confusion due to using different architecture names in the main
configure and subconfigure (e.g. aarch64-apple and arm-apple for M1).
Closes#23739.
Newer standard library headers should only be included when the compiler
is targetting that standard, otherwise some compilers (like MSVC) will
warn that you are using a newer C++ include on an older version.
At least under Wayland, removing focus from the menu consistently
results in "window lost focus even though it didn't have it" debug
messages because wxMenuBar never gets any focus-in signals but does get
focus-out one.
Avoid this by just not connecting handlers for these signals at all, as
we don't need them for wxMenuBar which isn't supposed to generate any
focus events anyhow.
See #23726.
This didn't update the number of selected items, which resulted in other
problems later on, including accessing items with invalid index which
could lead to a crash.
Closes#23729.
Ensure that we only increase the dialog width but never decrease it to
prevent the dialog from jumping annoyingly to different size with each
label change.
The previous attempt to do this in 4101849b4d (Grow
wxGenericProgressDialog automatically if needed, 2017-10-27) didn't work
because it seemingly didn't take into account the fact that wxStaticText
width changes when its label changes and so calling SetLabel() could
make it smaller, meaning that the next update would call Fit() again.
So fix this by preventing the control from changing its size by using
wxST_NO_AUTORESIZE and then only resizing it manually if it really needs
more space.
See #10624, #23727.
The Linux distribution community has somewhat deprecated the lsb_release
utility and has standardized on a new file, os-release, that can be
simply parsed to get the same information. Attempt to read this file in
/etc/os-release, then /usr/lib/os-release, and finally, fall back to
using the lsb_release utility if neither of those files are found.
See: https://www.freedesktop.org/software/systemd/man/os-release.html
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2184391Closes#23712.
This is similar to 79567c83f4 (Fix wxSpinButton redrawing when using
WS_EX_COMPOSITED, 2023-07-08) and does the same thing for the spin part
of the date time picker control.
See #23656.
Closes#18231.
Closes#23705.
This commit reverts cb85871831 (Add MSWShouldUseAutoDarkMode() and use
it for wxSpinButton, 2022-12-07) as, contrary to the expectations of
this commit, other controls didn't use this function and even
wxSpinButton itself doesn't need it any more after the changes of the
parent commit, which were required because automatic support was not
flexible enough.
Previously wxSpinButton using a buddy control had borders which were
much too bright in the dark mode. Now the entire border is perhaps a bit
too dark, but it's still better than before.
This doesn't change anything yet, as the same thing was done by wxWindow
by default thanks to the overridden MSWShouldUseAutoDarkMode(), but this
will be easier to customize in the upcoming commits.
This commit is best viewed ignoring whitespace-only changes.
Explicitly redraw it ourselves instead of relying on DefWndProc() to do
it, as with 15e4f5b (Work around wxListCtrl repainting problems with
WS_EX_COMPOSITED, 2023-06-05) which did the same thing for wxListCtrl,
doing it seems to be enough to make the control draw correctly.
Closes#23656.
This applies the change done in f5dd5eaf19 (Use darker border in wxMSW
dark mode by default, 2023-06-16) for all the other controls to
wxSpinCtrl too, as it still explicitly used wxBORDER_SUNKEN.
The border around the text part of the control is now correct, but it
looks even uglier in the dark mode due to a completely wrong border
being used around the spin button -- but this will be addressed by the
upcoming commits.
If the printer name is specified, avoid fall back to the default printer
via the use of PRINTDLG, as the default printer DEVMODE may be
incompatible with that of the printer we're actually going to use and
could possible result in a crash if their size differs.
Use a temporary printer if necessary to retrieve the correct DEVMODE for
the given printer name.
Closes#23685.
This was already done in wxGTK, do it in wxX11 and wxQt too as not doing
it triggers a (not very useful, but not completely specious) warning
when -Wextra is in effect.
Use "{}" to initialize all struct fields to the default values instead
of "{0}" which only initializes the first of them.
This also fixes a warning given when building with -Wextra.
Create hidden radio button in wxGTK when using wxRB_SINGLE, as
this lets us deactivate the shown button by activating the hidden one.
GTK does not allow deactivating radio buttons by calling them with
gtk_toggle_button_set_active( ..., FALSE), so we need to work around
it like this.
Also update the documentation to mention that this works in wxGTK now.
See #17022.
Closes#23652.
Closes#23677.
We can't perform the check for the invalid number in IsCharOk() because
it's perfectly normal for the number to be temporarily invalid while
it's being entered and, worse, sometimes this can't be avoided at all
and the existing behaviour prevented the user from entering _anything_
into a control limited to the values between 10 and 20.
See #23561.
Closes#12968.
Add a unit test case checking that we don't crash any longer and still
read the image meta data correctly, even if not the image itself.
Also add another check for EOF and possibly invalid "bits" value in
another place where we were not checking for it when reading from the
stream.
Closes#23409.
Co-authored-by: PB <PBfordev@gmail.com>
The change of 675728e1c0 (Fix crash when using wxDataObjectComposite
with bitmap in wxMSW, 2023-06-20) forgot to replace GetBitmap() call
with the local variable -- even if GetBitmap() returns the same thing,
as this local variable is just a reference to the member one which it
returns, it's more clear to use it here directly instead of using this
function and it was already done like this in GetDataHere(), so this is
also more consistent.