Commit graph

75263 commits

Author SHA1 Message Date
ali kettab
7ec7fe6dea Make wxTextEntry::DoSetValue() reusable under wxQt
This is a preparation for wxComboBox and wxBitmapComboBox to reuse the code
from the base class by just forwarding to wxTextEntry.
2023-10-14 17:58:53 +01:00
ali kettab
14ac76ed36 Make propagation test pass under wxQt
By waiting for the window to be ready before generating wxPaintEvent
2023-10-14 17:58:53 +01:00
ali kettab
d413402658 Fix wxWindow::Update() under wxQt
Calling this function should immediately repaints the invalidated area of the window
which is the documented and expected behaviour.
2023-10-14 17:58:53 +01:00
ali kettab
098161c4de Make sure a generic window (e.g. wxPanel) is created with a valid size
Such windows will not be shown and are ignored by Qt if added directly as children
to another window not managed by any sizer.
2023-10-14 17:58:53 +01:00
ali kettab
b231522fef Enable automatic tests for wxQt running on GitHub
Also build without wxUIActionSimulator support for now as it is currently
broken under wxQt and causes the tests to instantly crash if enabled.
2023-10-10 10:51:26 +01:00
ali kettab
e919ec6ccd Remove newly added functions from wxQt
QtSet{Min,Max}Size() were added for use by Set{Min,Max}Size() and
DoSetSizeHints() overrides. and since we have canceled overriding
Set{Min,Max}Size() in previous commit, there is no need to keep them
around without good reason.
2023-10-10 10:51:26 +01:00
ali kettab
ee2dba802c Don't override Set{Min,Max}Size() in wxWindowQt
This partially reverts commit 3c68696 (Make wxTopLevelWindow::SetSizeHints()
work in wxQt) because it breaks some wxSizer tests. and more importantly, it
breaks the documented behaviour of SetMinSize() which says:

Notice that calling this method doesn't prevent the program from making the
window explicitly smaller than the specified size by calling SetSize(), it just
ensures that it won't become smaller than this size during the automatic layout.
2023-10-10 10:51:26 +01:00
Blake-Madden
4235a018be Document that wxGetSingleChoice() geometry parameters are ignored
Also make it clear that wxCHOICE_{HEIGHT,WIDTH} constants are not really
used for anything.

Closes #23949.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2023-10-07 18:58:58 +02:00
Vadim Zeitlin
543fd3fabc Document that wxLogInterposerTemp shouldn't be used
Mark it as deprecated in the documentation without deprecating it
formally in the code, as it seems to be used in some existing code and
there is no urgency to remove it, but using it in new code still doesn't
make any sense.

Closes #23945.
2023-10-06 18:48:49 +02:00
Vadim Zeitlin
8d036af816 Fix not refreshing generic wxListCtrl after deleting last item
The check for the line being deleted being in the visible range
prevented us from refreshing anything at all if the line which was just
deleted was the last line of the control.
2023-10-06 18:17:15 +02:00
Maarten Bent
b9b0724de1 CMake: fix RegularExpression::compile errors
When the wxWidgets sources are in a path containing '++', CMake would
show errors on the command line:

[cmake] RegularExpression::compile(): Nested *?+.
[cmake] RegularExpression::compile(): Error in compile

This happens because the full path was interpreted as a regular
expression when creating the source_groups. Without wxSOURCE_DIR the
regular expressions still match and create correct source groups, so
remove it.

Closes #22738.

Closes #23943.
2023-10-06 01:06:06 +02:00
Vadim Zeitlin
80e8dc3692 Merge branch 'msw-add-def-catalog'
Fix AddStdCatalog() under MSW and add functions without msg ID fallback.

See #23930.
2023-10-06 01:03:25 +02:00
charvey2718
ffc99bd487 Fix bug with "pass through" mouse events from MSW wxFileDialog
Remove any remaining mouse messages from the input queue after showing
the file dialog because they somehow remain after it is destroyed and
could be processed by the application once wxFileDialog::ShowModal()
returns, resulting in phantom events being processed by the controls
that just happen to be under the button of the file dialog that was
clicked to close it.

Closes #10924, #23944.
2023-10-06 01:01:12 +02:00
ali kettab
4a22466ed7 Minor fix to the recently added wxBitmap::QtBlendMaskWithAlpha()
Testing for the alpha channel support was a mistake because it is
completely common to initially have a bitmap without an alpha channel (
in which case HasAlpha() returns false ) and Qt correctly converts it to
an appropriate format when the mask is set.

Should have been part of 1e43b37 (Added QtBlendMaskWithAlpha() to
wxBitmap under wxQt).

Closes #23937.
2023-10-04 18:35:47 +02:00
Vadim Zeitlin
5c0cc72cb8 Fix wxComboCtrl popup behaviour under some Wayland compositors
We need to set the window type hint to COMBO in order to use a popup
window for it under Wayland and while not doing it seems to still work
with GNOME/mutter, it is required with the other compositors such as KDE
Plasma or Sway and doesn't seem to do any harm under GNOME, so do it
always and hope that it doesn't result in any problems with not
combobox-like popups.

This basically undoes 62d934aab8 (Don't set HINT_COMBO as wxPopupWindow
is used for different windows as well, 2008-10-07).

See #23931.

Closes #23908.

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2023-10-04 18:34:40 +02:00
Vadim Zeitlin
b053c943e1 Merge branch 'msw-refresh-tree-plus'
Fix problems with refreshing "+" button for wxTreeCtrl items in wxMSW.

See #23734.
2023-10-04 18:33:21 +02:00
Paul Cornett
2b2071254b Avoid a Gdk-WARNING when showing a wxPopupWindow with Wayland
Use the newer gdk_seat_grab() for GTK 3.20+ to avoid
"Window x is already mapped at the time of grabbing..."
2023-10-04 08:13:58 -07:00
Vadim Zeitlin
95d8671bea Merge branch 'gtk-busy-info'
Fix wxBusyInfo layout under GTK.

See #23936.
2023-10-04 02:44:57 +02:00
Vadim Zeitlin
91f619f4b8 Merge branch 'msw-print-abort-crash'
Ensure we don't crash in wxMSW print abort procedure.

See #23932.
2023-10-04 02:43:46 +02:00
Vadim Zeitlin
71001385c6 Fix wxBusyInfo layout when using wxGTK
Use a dirty hack to ensure the window is created (roughly) as tall as it
needs to be instead of being created too small and truncating the text
in it.
2023-10-03 16:31:47 +02:00
Vadim Zeitlin
6f9f4c6dbe Call wxYield() while showing wxBusyInfo in the dialogs sample
Otherwise it can't be seen at all with wxGTK.
2023-10-03 16:28:55 +02:00
Vadim Zeitlin
3d07de66b1 Add a wait to wxGrid UI unit tests too
Wait for a bit before checking for the expected event as a single
wxYield() call might apparently not be enough under load, as this test
sporadically fails in AppVeyor CI builds even though it passes locally.
2023-10-03 16:05:31 +02:00
Ryo Nakano
068bac2599
Update Japanese translation 2023-10-03 22:57:50 +09:00
Vadim Zeitlin
9a728192c4 Ensure we don't crash when checking for cancelling print job
Don't dereference sm_abortWindow without checking that it is non-null in
wxAbortProc(): even though it's not supposed to happen, it still somehow
does, apparently, so just log a debug message instead of crashing in
this case.

Closes #23927.
2023-10-02 20:30:31 +02:00
Vadim Zeitlin
0a2fd4398e Try to ensure that the print abort dialog lives long enough
Close wxPrintAbortDialog after deleting wxPrinterDC in an attempt to
ensure that it can be used for as long as it might be needed.
2023-10-02 20:22:46 +02:00
Vadim Zeitlin
2ed7b801b3 Use smart pointer for wxPrinterDC in wxMSW printing code
No real changes, just avoid deleting the DC manually and let
std::unique_ptr<> do it automatically instead.
2023-10-02 20:08:07 +02:00
Vadim Zeitlin
9bfd72e7f7 Merge branch 'gtk-diag-suppress'
Fixes for suppressing bogus GTK diagnostics.

See #23923.
2023-10-02 19:34:40 +02:00
Vadim Zeitlin
554af01462 Merge branch 'pref-editor-fixes'
Fixes for wxPreferencesEditor size in wxGTK/Wayland.

See #23924.
2023-10-02 19:33:49 +02:00
Vadim Zeitlin
0741b09a92 Merge branch 'msw-uitests'
Attempt to fix wxMSW UI tests under AppVeyor and other improvements.

See #23926.
2023-10-02 19:33:12 +02:00
PB
4efbbce82e Modernize wxGenericDirCtrl appearance on MSW
Change wxTreeCtrl style for a control used by wxGenericDirCtrl so that
wxGenericDirCtrl looks more like the folder view in File Explorer (but
still don't show expanders for root-level items).

Also update wxGenericDirCtrl screenshot in the docs.

See also 6caaf58 (Use more modern appearance for wxMSW wxTreeCtrl by
default, 2023-09-30).

Closes #23922.
2023-10-02 19:32:02 +02:00
Vadim Zeitlin
a4d2e36cec Merge branch 'msw-fnmatch-all'
Fix using *.* and similar patterns in wxDir under MSW: they're supposed
to match all files and not only files with extensions.

See #23910.
2023-10-02 19:29:31 +02:00
Vadim Zeitlin
64476dd3e7 Deprecate wxLocale::AddCatalog() overload taking msgIdCharset
This parameter is never used any more, so it should be simply removed
from the application code using this function.
2023-10-02 19:21:48 +02:00
Vadim Zeitlin
94b1a17aeb Add AddAvailableCatalog() and use it in AddStdCatalog()
The new function only returns true if the catalog could be really
loaded and not if it is considered not to be needed because the message
ID language (which is typically "en-US") happens to be present in the
preferred UI languages list (which seems to always include "en-US" in at
least Western European MSW).

This allows to distinguish, albeit in a rather awkward (but
backwards-compatible) way between having a translation for the given
language and not needed such translation.

It is still not clear if it is really correct to return "en-US" from the
list of preferred languages even if the user has never intentionally
configured the OS to indicate that English is acceptable, but at least
now we can work around this issue and use AddAvailableCatalog() in
AddStdCatalog() to make sure we only skip loading unversioned wxstd.mo
if the versioned wxstd-x.y.mo file is really found instead of never
doing it, as was the case until now (see #23886).

Also add GetBestAvailableTranslation() helper which seems more useful
than the existing GetBestTranslation() one and is similarly related to
it.

See #18227.
2023-10-02 19:21:48 +02:00
Vadim Zeitlin
fa5964c100 Use WaitFor() and new YieldForAWhile() helpers in the tests
Reuse the existing function (and another new one, which is even simpler)
instead of duplicating its code in many places in the tests.

No real changes.
2023-10-02 15:10:36 +02:00
Vadim Zeitlin
dc6085a808 Use WaitFor() in WaitForPaint::YieldUntilPainted()
No real changes, just refactor the existing code to call the new
function instead of duplicating it.
2023-10-01 21:32:09 +02:00
Vadim Zeitlin
1237322404 Add WaitFor() helper and use it in Button::Click unit test
This test also sporadically happens under AppVeyor, check if it happens
because we need to wait for some time before the event is processed.
2023-10-01 21:30:00 +02:00
Vadim Zeitlin
55e074f5bc Rename tests/waitforpaint.h into just waitfor.h
No changes yet, just prepare for adding more "waiting" helpers.
2023-10-01 21:25:46 +02:00
Vadim Zeitlin
3f2b7f6bdb Try changing BitmapToggleButtonTestCase to avoid wxMSW failures
This test sporadically fails under AppVeyor, perhaps due to a hard-coded
sleep in it which may somehow misbehave there -- try changing it not to
rely on this sleep.

This has a nice side effect of making the test run faster, too.
2023-10-01 21:14:00 +02:00
Vadim Zeitlin
532ee2067b Fix initial size of wxPreferencesEditor in wxGTK under Wayland
Setting full size of the dialog before showing it doesn't work, but
setting its client size does.

It could be better to change wxWindow::Fit() itself to do this, but this
might have other effects, while this change should be pretty safe, i.e.
not break anything for the other platforms while fixing a big usability
problem with wxGTK/Wayland: as this dialog is not resizeable, making it
too small initially, as happened before, meant that parts of it couldn't
be used at all.
2023-10-01 18:05:05 +02:00
Vadim Zeitlin
b75ffc2d84 Stop using wxSharedPtr in wxPreferencesEditor code
We can just use std::unique_ptr<> now as it can be stored in the vector
in C++11, unlike before.

Also use range-for loop instead of dealing with iterators.
2023-10-01 18:05:05 +02:00
Vadim Zeitlin
4ffad5074f Add WXSUPPRESS_GTK_DIAGNOSTICS environment variable
This allows to suppress some or all GTK diagnostics even for the
programs not calling GTKSuppressDiagnostics() nor even
GTKAllowDiagnosticsControl() themselves.
2023-10-01 17:36:54 +02:00
Vadim Zeitlin
95bd6d4cfa Suppress bogus GTK errors from wxNotebook in preferences sample
Call GTKAllowDiagnosticsControl() to let the code in wxNotebook
suppressing them have an effect.
2023-10-01 17:13:01 +02:00
Vadim Zeitlin
6a41d8a486 Relax code style check for NULL
This is fine tuned to allow the string in the last commit to pass this
check, but still generally makes sense too.
2023-10-01 17:05:28 +02:00
Vadim Zeitlin
2a87515660 Fix filtering out of bogus GTK critical errors in wxNotebook
Restore the correct message which was erroneously modified by the
changes of 4f4c5fcfdf (Use nullptr instead of NULL in the code and
documentation, 2022-10-16).
2023-10-01 16:57:08 +02:00
Vadim Zeitlin
0efd803f30 Make GTKSuppressDiagnostics() work again
This got broken by the addition of GTKAllowDiagnosticsControl() in
8af645ed22 (Fix crash when using wxNotebook with glib 2.73 or later,
2022-08-29) as not calling it resulted not only in preventing wx code
from installing its own log function implicitly, but also prevented
explicit calls to GTKSuppressDiagnostics() from working neither.

Fix this by calling GTKAllowDiagnosticsControl() automatically from
GTKSuppressDiagnostics() itself.
2023-10-01 16:49:13 +02:00
Paul Cornett
9b9ec141fb Enable using a dark theme when Gnome "dark style" is set
The dark style setting does not cause a dark theme to be used
automatically, so request it explicitly.

Co-authored-by: Colin Kinloch
2023-09-30 16:42:58 -07:00
Vadim Zeitlin
5406a8f0c2 Don't use newer PathMatchSpecEx() unnecessarily
Use older and so hopefully compatible with all MinGW versions
PathMatchSpec() instead as we don't use any of the newer function flags
and it seems to behave identically with the default flag.
2023-09-30 23:22:16 +02:00
Vadim Zeitlin
a190274600 Reformat checks in wxWindow::QtSet{Min,Max}Size()
This should have been part of bbf6b3336d (Fix a recently introduced
crash in wxAUI in wxQt, 2023-09-30).
2023-09-30 23:15:15 +02:00
Vadim Zeitlin
e8faf2f56c Merge branch 'wxlistctrl-fixes'
Improve consistency of checkboxes in wxListCtrl between virtual and
report mode, and between the generic and MSW implementation, see #23869.

Also disable WS_EX_COMPOSITED for virtual wxListCtrl because it
generates an endless stream of cache events, see #23878.

See #23890.
2023-09-30 23:13:51 +02:00
ali kettab
bbf6b3336d Fix a recently introduced crash in wxAUI in wxQt
wxAUI has a special window "wxTabFrame" for which GetHandle() returns nullptr.
This is a problem because this commit 3c68696 (Make wxTopLevelWindow::SetSizeHints()
work in wxQt) doesn't account for the rare situation in which a wxWindow is actually
created without the underlying handle, resulting in a crash when we try to call
Set{Min,Max}Size() for this type of windows.

Closes #23920.
2023-09-30 23:12:20 +02:00