Commit graph

75293 commits

Author SHA1 Message Date
Vadim Zeitlin
c601bf4279 Merge branch 'qt-fixes'
Fix bugs preventing GUI tests from working with wxQt and provide native
implementations of wx{Date,Time}Ctrl in this port.

See #23925.
2023-10-22 01:18:50 +02:00
Vadim Zeitlin
e478aa74b1 Use "= default" for default ctors of just added classes
Also remove a couple of unneeded lines.
2023-10-22 01:18:26 +02:00
Vadim Zeitlin
5885eea5ea Fix refreshing wxGenericListCtrl with multiple selection
Changing the selection could behave wrongly and result in an assert
failure as the selection anchor could have become invalid, due to the
change of the number of items in the control.

Fix this by invalidating it when this happens.
2023-10-22 01:06:38 +02:00
Vadim Zeitlin
99febcf9c1 Wait for events in Grid::LabelClick and RangeSelect tests too
Not sure if it really helps, but try to wait for the events in these
tests as well if only for consistency with what was done in 3d07de66b1
(Add a wait to wxGrid UI unit tests too, 2023-10-03).
2023-10-22 01:06:38 +02:00
Paul Cornett
4cabfa111a Avoid crash with GTK3 if console program is linked to GUI library
A console program should not really be linked with the GUI library, but it used
to work, and it's unavoidable with the monolithic build, so fix the regression.
See #23981
2023-10-21 09:20:45 -07:00
ali kettab
032fc66cea Now wxTimePickerCtrl is a native control under wxQt 2023-10-15 13:35:24 +01:00
ali kettab
e20d8ba2cc Now wxDatePickerCtrl is a native control under wxQt 2023-10-15 13:35:24 +01:00
ali kettab
4faf201a08 Use the generic implementation of wxPalette under wxQt
Until now, wxPalette under wxQt was just a dummy implementation
Let's turn to the generic one which works perfectly under wxQt too.
2023-10-15 00:10:02 +01:00
ali kettab
ec1763d3a9 Don't return invalid pixel size from GetPixelSize() under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
2f6052e337 Fix wxImageList test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
0d47ca2463 Fix regular expression used in wxQtAction::Normalize()
Added in commit a605ee3 (Don't pass hyphenated shortcuts to Qt) which
mistakenly replaces the last minus sign (-) of an accelerator with plus
sign (+).
2023-10-15 00:10:02 +01:00
ali kettab
3f48d1290b Fix GetFilename[s] returning extensionless filename[s] under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
1f606cd925 Skip test which work locally, but not when run on GitHub CI under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
15937ccb3d Fix inserting new items into sorted wxListBox under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
5803cdefd1 Fix inserting new items into wxListBox under wxQt
Use the right type when inserting new items into the list box. This ensures that
the wxEVT_CHECKLISTBOX event is emitted for these new items. And in fact, it should
be part of this commit 16da1a1 when wxQtListWidgetItem was introduced.
2023-10-15 00:10:02 +01:00
ali kettab
09c22b080e Fix listboxtest test failing under wxQt
Qt uses QString::localeAwareCompare() for comparison and this is what their
documentation says: "On other Unix-like systems without ICU, the comparison
falls back to the system library's strcoll()". Under MSW, Qt uses CompareStringEx()
IOW, Qt always compares strings by locale-specific sorting criteria and BTW
this is what wxGTK was like before this commit 625ed74 (Make sorting of wxListBox,
wxChoice and wxComboBox identical to the MSW sorting)
2023-10-15 00:10:02 +01:00
ali kettab
2d665338e9 Avoid Qt warnings about inactive painter
Qt spits out annoying warnings about inactive painter (QPainter::font:
Painter not active) when using wxDC::GetChar{Width,Height}(). Simply mute
them by using the default application font explicitly.
2023-10-15 00:10:02 +01:00
ali kettab
155b24daea Fix gridtest test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
942b3bccf4 Fix windowtest test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
ae0d707166 Fix wxListCtrl test failing under wxQt
The wxListCtrl would assert with this message: '../src/qt/listctrl.cpp(452):
assert "col < columnCount()" failed in SetItem(): Invalid col'

Because under wxQt: no columns means no items, and no items means
no selection can be made at all.
2023-10-15 00:10:02 +01:00
ali kettab
f7e7c037c2 Fix wxTextCtrl::GetBestSize test case failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
d0bf5fdb8f Use cursor type guaranteed to be supported on all platforms.
The wxCURSOR_CHAR cursor type is not supported under wxQt and using it
causes the test to fail there.
2023-10-15 00:10:02 +01:00
ali kettab
7e360dcf1e Fix testing wxSpinCtrl[Double] unsupported features under wxQt
Backwards ranges are not supported under wxQt and setting empty string
in the control automatically displays minVal.
2023-10-15 00:10:02 +01:00
Paul Cornett
7fbe3698c5 Fix memory leak in wxBitmap with GTK3
Introduced in f7247086c2 (Fix storing wxBitmap data in GdkPixbuf, 2019-09-18)
2023-10-14 11:21:38 -07:00
ali kettab
ff4995ec01 Enable formerly skipped tests under wxQt 2023-10-14 17:58:53 +01:00
ali kettab
fb5484fbf7 Fix wxTextCtrl::SetValue() under wxQt
It shouldn't change the insertion point if the value doesn't really change
However, the event should still be emitted in this case as documented.
2023-10-14 17:58:53 +01:00
ali kettab
216e9e14cc wxComboBox now forwards to wxTextEntry when setting its value under wxQt
Clean up no longer used code.
2023-10-14 17:58:53 +01:00
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
Andrew Bell
368a13a1a2 Fixing MSW crash with empty wxListCtrl in dark mode
Changes of 9710592cc4 (Erase unwanted list view separators in dark mode
under Windows 11, 2023-06-05) wrongly kept the check for "itemCount",
verifying that the control is not empty, only in the "needToDraw" case,
but it is needed in the "needToErase" case as well because it also uses
the bottom item index which is invalid if there are no items.

Fix this by always checking that the control is non-empty before doing
anything else.

Closes #23960.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2023-10-13 02:22:11 +02:00
Paul Cornett
642f226eb6 Build fix for wxUSE_DATETIME==0 2023-10-12 16:15:16 -07: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
PB
b87a7ab9e7 Remove wxNODISCARD from wxBasicString::Get() declaration
Using both wxDEPRECATED_MSG and wxNODISCARD for some reason breaks
compilation with clang (when using C++17 or newer standard).

Since wxBasicString::Get() is deprecated, one warning should be enough
so just remove wxNODISCARD from the method declaration.

Closes #23952.
2023-10-09 09:00:33 +02: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