Commit Graph
123 Commits
Author SHA1 Message Date
Richard cb2cbef660 Fix grid autowrap row autosizing
Set the autowrap renderer DC font from the cell attribute before measuring
line heights, so small-font cells do not inherit another DC font when rows
are autosized.

Use the full spanned row or column extent when asking renderers for their
autosize measurement, and cover autowrap font and spanned-row sizing.

Fixes #14072.

Closes #27136.
2026-10-01 16:22:59 +02:00
Vadim Zeitlin f7702e6dde Ignore another wxGrid test case failure with Qt 5
This is similar to 443c024e07 (Ignore failures in wxGrid column resizing
test with wxQt5, 2026-08-17) and is done for the same reasons of
expediency.

See #25779.
2026-09-11 18:44:46 +02:00
Vadim Zeitlin c8003a0a06 Use make_unique<>() instead of "new" in the tests
No real changes, just avoid explicit "new" calls.
2026-09-04 15:24:34 +02:00
Scott Talbert 224a8d396a Don't rely on Update() being synchronous for GTK3 paint-dependent tests
wxWindow::Update() is an intentional no-op under GTK3 with a native
Wayland backend, so Refresh()+Update() doesn't guarantee the paint has
already happened by the time it returns there. Wait for the actual
paint event using WaitForPaint instead, fixing
EventPropagation::ScrollWindowWith(out)Handler and
Grid::SetTable_ClearAttrCache.
2026-08-31 20:01:37 -04:00
Scott Talbert 57d2358170 Add missing EnableUITests() guard to tests using wxUIActionSimulator
Button::{Click,Disabled}, RadioButton::Click, SpinCtrl::{Arrows,Increment,
SetValueInsideEventHandler,Wrap}, SpinCtrlDouble::{Arrows,Increment,
Wrap}, ValNum::Interactive, wxStyledTextCtrl::{AutoComp,Calltip},
Grid::{CellClick,ReorderedColumnsCellClick,CellSelect} and several
wxTreeCtrl tests used wxUIActionSimulator without checking
EnableUITests() first, unlike every other simulated-input test. This
meant they weren't skipped when UI tests are disabled (e.g. now by
default under a native Wayland GTK3 client) and just failed instead.
2026-08-31 19:30:10 -04:00
Richard ae3a613462 Test that moving wxGrid cursor over hidden lines works correctly
Add regression coverage for cursor movement across zero-height rows and
zero-width columns. The grid cursor should skip hidden lines when moving
in either direction and remain on a shown row or column.

See #9586.

Closes #26904.
2026-08-26 16:38:48 +02:00
Richard 9bff69abc9 Fix wxGrid::MakeCellVisible() with variable row heights
Use the current unscrolled origin and the actual target-cell bottom when
scrolling down, instead of rebuilding a position from preceding row
heights. Add a grid regression test with mixed row heights.

Fixes #4371.

Closes #26897.
2026-08-26 14:28:01 +02:00
Vadim Zeitlin 443c024e07 Ignore failures in wxGrid column resizing test with wxQt5
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
This happens regularly and is just annoying, so unless somebody decides
to fix this, ignore the failures with just a warning to allow the test
suite to succeed.

See #25779.
2026-08-17 14:47:04 +02:00
Vadim Zeitlin fccc35275a Define wxHAS_QT5 in wxGrid test once and reuse it
Currently it's only used once, so this doesn't change anything, but
another similar check will be added in the next commit, where this will
pay off.
2026-08-17 14:38:57 +02:00
Vadim Zeitlin 062f2e2e1c Merge branch 'develop' of github.com:LegalizeAdulthood/wxWidgets
Make the test suite more robust under Windows.

See #26668.
2026-08-14 19:44:31 +02:00
Richard 77c4110762 tests/controls: Fix GUI test assumptions exposed on MSW
Focus the native edit child when testing wxComboBox Enter handling on MSW,
where wxEVT_TEXT_ENTER is generated from the edit control's character message.
Also split Return simulation into key down/yield/key up so the native message
sequence is observed.

Make the other control tests less dependent on platform-specific details:
check visibility of the actual selected grid endpoint instead of a
DPI-sensitive nearby cell, and allow wxDataViewCtrl to report more than one
key-down event.
2026-08-13 21:42:14 -06:00
Richard b3e0e4cde1 Refresh wxGrid editor on resize
Reposition the active cell editor after wxGrid resizes its child
windows, keeping the editor inside the visible grid window and
refreshing the old editor area.

Add a GUI regression test that shrinks the grid while editing and
checks that the editor remains visible in the grid window.

Fixes #2678.

Closes #26724.
2026-08-10 16:54:20 +02:00
Richard fbc474f4ed Track active wxGrid editor while editing
Remember the editor instance used for the shown edit control and use it
for visibility checks, painting, hiding, and saving. This keeps the edit
control lifetime independent of later attribute changes, so replacing a
cell or column editor while editing does not make wxGrid hide or save
through the wrong editor.

Add a regression covering replacement of a column bool editor while its
cell is being edited.

Fixes #21986.

Closes #26670.
2026-07-20 20:12:44 +02:00
Paul Cornett 53e050bfc5 Remove unused functions/templates 2026-07-16 20:44:58 -07:00
Paul Cornett be1274d517 Avoid some -Wcomma warnings 2026-06-15 22:20:39 -07:00
Vadim Zeitlin 1efc0895a5 Ignore recurrent wxQt test failure in Grid::ResizeScrolledHeader
This test keeps failing, mostly (but not only) with Qt 6.10, so disable
it until this can be investigated.
2025-11-21 17:38:46 +01:00
Vadim Zeitlin 84e8be1263 Don't bother with wxGrid tests using native header under non-MSW
wxMSW is the only port in which the header is really native and its
behaviour may/does differ from the generic one and so these tests are
valuable there, but not with the other ports.
2025-11-21 17:35:38 +01:00
Vadim Zeitlin 2b6475846d Fix wxGrid tests compilation with wxQt
Include the header defining QT_VERSION before using it.

This should have been part of ea4c83dc7f (Ignore failure of wxGrid
column width test with wxQt5, 2025-08-30).
2025-08-30 18:02:15 +02:00
Vadim Zeitlin ea4c83dc7f Ignore failure of wxGrid column width test with wxQt5
This keeps happening in the CI runs, so ignore the failure for now to
prevent it from breaking all the unrelated PRs.
2025-08-30 15:00:27 +02:00
Vadim Zeitlin 823d3e537a Don't change invalid current wxGrid cell in SetTable()
Changing the table shouldn't make the cell (0, 0) current if we hadn't
had any current cell before, this was unintentional side effect of
e570d85164 (Ensure current cell remains valid when wxGrid table changes,
2023-09-15) which resulted in an unwanted wxEVT_GRID_SELECT_CELL event
when creating the grid.

Fix this by only calling UpdateCurrentCellOnRedim() if we have a valid
current cell to update.

See #23751.

Closes #25498.
2025-07-12 16:55:56 +02:00
AliKet acd7d708db wxQt: Fix a crash in Github Actions when using wxQt 2025-03-12 09:11:04 +01:00
Lauri Nurmi ee978a1f6f Use unused variables like they were likely meant to be used
No actual changes to the test, a slight change of tone with one colour
scheme in the propgrid sample.
2024-10-10 20:20:02 +03:00
ali kettab 2b23d52eb7 Update Grid::SelectionRange of GridTestCase
Test whether selecting two adjacent blocks results in only one block containing
both blocks. This should be the case since this commit caad24cf83 (Added
wxGridSelection::MergeAdjacent{Blocks,Rects}() helper functions)
2024-06-13 19:55:19 +01:00
Blake-Madden 631efedd61 Add wxGridCellCoords::IsFullySpecified()
Provides parity with wxPoint and an alternative to comparing against
wxGridNoCellCoords.

Closes #24468.
2024-04-14 00:01:04 +02:00
Vadim Zeitlin 261490d5e2 Ignore failures in tests handling mouse clicks under AppVeyor
For some completely mysterious reason we don't get the expected mouse
click events when running under AppVeyor, something might be covering
the window and stealing the clicks for itself there.

As there doesn't seem to be anything to do about it, just skip the test
in this case.

Closes #24082.
2024-01-03 20:21:59 +01:00
Vadim Zeitlin 268b2b98e0 Use WaitForEventAt() in Grid::ReorderedColumnsCellClick test too
This test also sporadically fails on AppVeyor.
2024-01-01 22:04:41 +01:00
Vadim Zeitlin 5f62f30231 Use WaitForEventAt() in Grid::CellSelect test too
Try making this test more robust as well as it also sporadically fails
on AppVeyor.

Also simplify it a bit, checking for each of the expected events in turn
instead of checking for their total number at the end.
2023-12-27 02:49:53 +01:00
Vadim Zeitlin 61edcbc5a6 Use WaitForEventAt() in Grid::CellClick test too
This test doesn't use the native header but somehow still fails on
AppVeyor and locally a very failure can be reproduced if the mouse is
moved while the test runs, so check for this here too.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin 216b5a4b23 Also use WaitForEventAt() in Grid::SortClick test case
Abandon this test too if the mouse moves for whatever reason.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin 8218e31418 Abandon tests waiting for mouse events if mouse moved
If the mouse pointer moves, for whatever unexplained reason, the click
is not going to happen, so don't wait for it.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin ab0a44a63a Give information about which section of grid tests fails
This is useful to see when the failure occurs exactly as the same checks
are performed in 3 different cases.
2023-12-25 15:18:05 +01:00
ali kettab 47bc3a8b96 Try to fix unit tests systematically failing under AppVeyor
Raise the window to ensure that it gets the expected mouse events.

See #24082.

Closes #24109.
2023-11-30 16:32:48 +01:00
ali kettab 53c2b7d65b Fix failures in wxGrid tests under wxQt 2023-10-31 22:53:59 +01:00
ali kettab b5dad92007 Make sure the window is active after SetFocus() under wxQt
Calling wxYield() after SetFocus() ensures that the window is active
and the tests will pass. Otherwise, they would fail.
2023-10-31 22:42:27 +01:00
ali kettab 3a71aeed5e Enable some more tests under wxQt 2023-10-31 22:28:34 +01:00
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 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
ali kettab 155b24daea Fix gridtest test failing under wxQt 2023-10-15 00:10:02 +01: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
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
Brian Nixon 381c39a051 Clear grid attribute cache when loading new table
Clear the cached attributes when replacing the table they were used
with.

Add unit test checking that the attributes are not used any longer.

Closes #23607.
2023-06-05 15:22:49 +02:00
Vadim Zeitlin a3331c87d0 Stop using Catch::toString()
This function doesn't exist in Catch2 any longer, so prepare for the
upgrade by stopping to use it and converting things to string more
explicitly.

No real changes yet.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin 4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00
PB 88d526660f Replace wxOVERRIDE and wxNOEXCEPT with override and noexcept
Don't use deprecated macros in wxWidgets itself.
2022-10-15 18:10:45 +02:00
Vadim Zeitlin 6bbfdb157e Check that C++11 is available and remove tests for it
Don't bother checking for various C++11 features that are available in
all C++11 compilers.

Also assume that std::exception_ptr is available in all still supported
MinGW versions and remove checks for it too (see #16634).

Further simplifications remain possible, this is just the first step.
2022-10-11 00:02:29 +02:00
ali kettab e48c5d0fa7 Disable test not working under GitHub CI using ASan 2022-09-21 11:16:15 +01:00
ali kettab 1853d46c02 Don't disable automated tests which work under GTK 3
Those tests are supposed to be skipped under GTK 2 only
2022-09-15 11:29:24 +01:00
ali kettab 15cf59a418 Skip test known to fail under GTK2 in automatic mode
Grid::RangeSelect, Grid::Size, Grid::ResizeScrolledHeader and Grid::ColumnMinWidth
are known to fail under GTK2 in automatic mode for unknown reason
2022-09-13 19:14:00 +01:00
ali kettab 6fbc7ea6ca Fix testing range-selection
The previous commit reveals a bug in the grid test where the
wxEVT_GRID_RANGE_SELECTED detected is not really comming from
range selection action, but from the grid cursor changing its position

For unknown reasons, range selection in the test doesn't really starts off
unless we move the mouse first while still inside the first selected cell
2022-09-12 21:51:46 +01:00
Artur Wieczorek 5e2da5a106 Get rid of v2.8 code 2022-08-02 08:26:29 +02:00