Commit graph

43077 commits

Author SHA1 Message Date
Paul Cornett
496a9a40a1 Avoid division-by-zero in wxImage::Paste()
See #23791
2023-08-23 23:03:43 -07: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
Lauri Nurmi
3e4946fc31 Minor documentation syntax and orthography fixes
Closes #23759.
2023-08-22 19:20:33 +02:00
Scott Talbert
3ae3a4e1f5
Support using Numpad Enter for ending wxListCtrl editing (#23762)
Fixes #23761.
2023-08-12 16:04:26 -07:00
Paul Cornett
55d0b594ff Avoid division-by-zero when vertical scrollbar is disabled
See #23763
2023-08-12 15:54:39 -07:00
Maarten Bent
d847f3b039
Fix position of label window in wxStaticBox after DPI change
Fixes #23740
2023-08-05 21:54:01 +02:00
Vadim Zeitlin
a42d9181d6 Define LOCALE_RETURN_GENITIVE_NAMES for old MinGW support
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.
2023-08-02 04:08:05 +02:00
Vadim Zeitlin
e8fdb66741 Merge branch 'improve-configure'
Modernize configure.

See #23730.
2023-07-28 13:25:52 +02:00
Stefan Csomor
30fbb94053 Send key down events ourselves if macOS didn't do it
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.
2023-07-28 13:24:51 +02:00
Vadim Zeitlin
e38bc95548 Synchronize config.* files in submodules with top-level repository
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.
2023-07-27 17:14:48 +02:00
Vadim Zeitlin
f03ea82be8 Merge branch 'im/stringview' of https://github.com/imciner2/wxWidgets
Add std::string_view constructors to wxString.

Also improve C++17 standard headers detection for MSVS.

See #23711.
2023-07-24 18:16:39 +02:00
Ian McInerney
b8d3b37c9e Add new macro for standard library header inclusion
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.
2023-07-24 16:54:14 +01:00
Vadim Zeitlin
414140113c Merge remote-tracking branch 'github/egl-wayland-perf-fix'
Fix wxGLCanvas performance when using Wayland.

See #23554.
2023-07-24 17:41:35 +02:00
Vadim Zeitlin
66cb7089f8 Add logging to wxGTK wxTopLevelWindow size-related functions
This can be helpful when debugging size-related problems and doesn't do
any harm as long as the corresponding tracing category is disabled.
2023-07-24 14:04:56 +02:00
Vadim Zeitlin
08c3d09e51 Avoid debug warnings when defocusing menu bar in wxGTK
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.
2023-07-24 14:04:36 +02:00
Vadim Zeitlin
d6dd0ebb6e Fix deleting selected item in wxGenericListCtrl
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.
2023-07-24 14:03:34 +02:00
Vadim Zeitlin
a921f558d9 Remove configure.in to configure.ac
This is the extension expected by all non-ancient autoconf versions.
2023-07-24 00:11:26 +02:00
Vadim Zeitlin
97546a6f0c Really fix wxProcessDialog size when the message length changes
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.
2023-07-22 22:58:55 +02:00
Aulddays
a3b0a839d6 Fix wxXRC LoadBitmapFromFS() when wxUSE_FILESYSTEM==0
Use correct parameter name "path" instead of "name".

Closes #23724.
2023-07-21 20:25:34 +02:00
Scott Talbert
aef7df6c9f Read Linux distribution info from os-release file
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=2184391

Closes #23712.
2023-07-20 15:24:35 +02:00
Vadim Zeitlin
ed7f5a671c Fix wxDateTimePickerCtrl arrows redrawing with WS_EX_COMPOSITED
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.
2023-07-20 15:20:51 +02:00
Stefan Csomor
52a11a3a9d Remove obsolete wxOSX_USE_EXPERIMENTAL_FONTDIALOG build setting
Always turn native font dialog on and remove the never used old version.

Closes #23695.
2023-07-20 14:42:39 +02:00
Vadim Zeitlin
1dafca9e1d Remove "automatic" dark mode support
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.
2023-07-08 23:00:43 +01:00
Vadim Zeitlin
595e2f9326 Tweak wxSpinCtrl appearance in dark mode
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.
2023-07-08 23:00:43 +01:00
Vadim Zeitlin
68666d929d Invert wxSpinButton in dark mode in its own OnPaint()
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.
2023-07-08 23:00:10 +01:00
Vadim Zeitlin
79567c83f4 Fix wxSpinButton redrawing when using WS_EX_COMPOSITED
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.
2023-07-08 23:00:10 +01:00
Vadim Zeitlin
0130a066df Make section comments in wxSpinButton more accurate
No changes whatsoever, just improve the comments to correspond to the
actual functions under them.
2023-07-08 20:15:38 +01:00
Vadim Zeitlin
83f5b6f3c6 Remove unnecessary wxSpinButton::MSWCommand()
This function did nothing, which was already exactly what the base class
version did too.
2023-07-08 20:13:44 +01:00
Vadim Zeitlin
dc7f934fb3 Don't use wxBORDER_SUNKEN for wxSpinCtrl in dark mode
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.
2023-07-08 19:52:57 +01:00
Vadim Zeitlin
37118da5f9 Don't give spin button used in wxSpinCtrl any border
This doesn't actually seem to change its appearance, but using border
for it doesn't make sense, so don't do it -- and explain it, to avoid
confusion.
2023-07-08 18:44:36 +01:00
Martin Corino
a5c0a81798 Make UIActionSimulator work under macOS by adding extra delay
This isn't very elegant but seems to be the only way to make this class
work under macOS at all.

Closes #23692.
2023-07-08 17:09:06 +02:00
Martin Corino
548086b20c Derive wxFontDialog from wxFontDialogBase in wxOSX too
This notably ensures that wxFontDialog has const GetFontData() accessor
in this port too, as was already the case in the other ones.

Closes #23691.
2023-07-08 17:06:50 +02:00
Vadim Zeitlin
d1ee86df3c Merge branch 'gcc-wextra'
Enable -Wextra for the Unix CI builds after fixing all the existing
warnings.

See #23662.
2023-07-08 00:36:47 +02:00
Stefan Ziegler
e35257d2b6 Fix possible crash in wxWindowsPrintNativeData initialization
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.
2023-07-08 00:30:04 +02:00
Vadim Zeitlin
0f73473ae6 Update Scintilla submodules to avoid warnings with -Wextra
No real changes, just suppress some warnings (that we don't really care
about as we won't be fixing warnings in 3rd party code anyhow).
2023-07-04 01:25:03 +02:00
Vadim Zeitlin
41b61aad59 Initialize base class in copy ctor in the other ports too
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.
2023-07-04 01:24:43 +02:00
Vadim Zeitlin
3b0aecf254 Disable missing initializers warnings in wxGTK webview code
Just suppress the warnings, this is better than specifying useless
initializers.
2023-07-03 21:25:48 +02:00
Vadim Zeitlin
6881109a22 Avoid always true comparison in wxThread::SetPriority()
Don't compare unsigned priority value with wxPRIORITY_MIN which is 0,
this is useless and results in -Wtype-limits enabled by -Wextra.
2023-07-03 20:55:18 +02:00
Vadim Zeitlin
c2de3b1a5e Rewrite generic wxPaletteRefData to use vector
Don't bother with manual memory allocation of palette entries, just
store them in a vector.

No real changes.
2023-07-03 20:55:18 +02:00
Vadim Zeitlin
4ff436ecc1 Fix xkb_rule_names struct initializer
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.
2023-07-03 20:51:09 +02:00
Reza Karimi
a9d2a14090 Invalidate wxOwnerDrawnComboBox best size after adding new items
The previously computed best size may become invalid after inserting new
items, so forget it.

Closes #23681.
2023-07-03 20:18:17 +02:00
Stefan Hansson
b84b45161a Implement wxRB_SINGLE support in wxGTK
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.
2023-07-03 20:14:32 +02:00
Vadim Zeitlin
c3bc4c16c5 Merge branch 'fix_no_intl_no_radiobtn' of https://github.com/matyalatte/wxWidgets
Fix compilation errors when wxUSE_INTL or wxUSE_RADIOBTN is off.

See #23663.
2023-07-03 20:05:49 +02:00
Vadim Zeitlin
39045e1ce5 Ignore keys with modifiers in wxNumValidatorBase
This allows to use accelerators, such as Alt-X, when the focus is on a
key control using numeric validator in wxGTK.
2023-07-02 22:43:15 +02:00
Vadim Zeitlin
67f634dfc4 Don't normalize the value of empty text control on focus loss
This is unexpected, as just TAB-bing in and out of the control changes
its value since the recent changes to wxNumValidator.
2023-07-02 22:40:42 +02:00
Vadim Zeitlin
dccddcdd59 Fix wrong use of WXUNUSED() in the last commit
See #12968.
2023-07-02 18:35:31 +01:00
Vadim Zeitlin
c269932c4e Relax checks on character entry in numeric validators
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.
2023-07-02 18:27:22 +01:00
Vadim Zeitlin
c2e5749443 Fix crash when reading truncated GIF image
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>
2023-07-02 18:06:03 +01:00
matyalatte
77e825f89e fix compilation errors when wxUSE_INTL is off 2023-06-30 23:31:52 +09:00
Vadim Zeitlin
3bd5063886 Slightly clarify the code in wxBitmapDataObject::GetDataSize()
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.
2023-06-30 00:30:53 +01:00