Commit Graph
3467 Commits
Author SHA1 Message Date
Lauri Nurmi 9bbb2dfb6b Test only one wxDateTimeHolidayAuthority at a time
wxDateTimeChristianHolidays was tested with a wxDateTimeUSCatholicFeasts
already existing and taking precedence. I.e. the tests for Christmas in
ChristianHolidays actually tested (again) the USCatholicFeasts
implementation.

This reveals an off-by-one bug in wxDateTimeChristianHolidays::DoIsHoliday(),
which doesn't use the enum symbol for month, and declares Christmas to be
on the 25th day of the 13th month.

Further, this raises the question whether it is a bad idea to have the
authority implementations in a header. Fixing bugs like this would
require recompiling the application, instead of simply updating the
DLL/dylib.
2025-08-30 15:05:40 +02:00
Vadim Zeitlin 8d349dbddc Make it possible to call wxMenuItem::GetBitmapBundle() again
The changes of 0dfe37a643 (Add wxMSW-specific wxBitmapBundle accessors
to wxMenuItem, 2025-08-18) broke this as wxMSW-specific function taking
bool hid the base class function.

Just make the wxMSW function compatible with the base class one by
defaulting "bChecked" to false. Alternatively, we could use using
declaration to bring the base class function in scope, but this doesn't
seem to have any advantages and this change seems more clear.

In any case, add a unit test checking that the calls to these functions
at least compile.

See #25685, #25705.

Closes #25719.
2025-08-22 21:25:11 +02:00
Vadim Zeitlin 0aa9fc1879 Fix wxMenu leak in a unit test
Don't allocate wxMenu on the heap without ever freeing it, just create
it on the stack.
2025-08-22 16:28:36 +02:00
Blake-Madden 24338bec88 Add unit tests for wxSize::IsFullySpecified()
Closes #25647.
2025-07-25 00:33:47 +02:00
Vadim Zeitlin 3b7ce8e9a7 Increment version to 3.3.2
Rebake all generated files.
2025-07-25 00:29:00 +02:00
Vadim Zeitlin ea87876f50 Merge branch 'pg-compat'
Restore compatibility with code using wxPG_XXX flags.

See #25632.
2025-07-16 01:30:56 +02:00
Vadim Zeitlin b107ec473c Rename scoped enum wxPGPropertyFlags to wxPGFlags
This allows to reintroduce wxPGPropertyFlags enum compatible with its
3.2 definition.

The new name for the scoped enum is not great because it less precise
but is shorter, which is more convenient, and it seems difficult to find
something else sufficiently different from wxPGPropertyFlags as to not
provoke confusion with it.
2025-07-14 23:13:59 +02:00
Bill Su c2502beb3f Add wxNUM_VAL_SIGN_PLUS and wxNUM_VAL_SIGN_SPACE
Add numeric formatting and validation styles for displaying
non-negative numbers with "+" or space prefix.

Closes #25635.
2025-07-14 22:45:05 +02:00
Vadim Zeitlin f862e628ba Merge branch 'listctrl-fixes'
Fix losing text of generic wxListCtrl items: fixes #25519 and also
refactors/simplifies the unit tests for this class.

See #25630.
2025-07-12 16:57:12 +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
Blake-Madden a1a0d38508 Add functions for testing wxColour opacity
Add IsTransparent(), IsOpaque() and IsTranslucent() as more readable
synonyms for testing the value of GetAlpha() directly.

Closes #25628.
2025-07-12 16:04:01 +02:00
Vadim Zeitlin 6bc4a1e1de Fix losing text of generic wxListCtrl items when copying them
During the switch from copy to move ctor of wxListCtrl in a5777cdcbd
(Make wxListItemData movable and not copyable, 2023-01-19) copying the
item text was simply lost, resulting in items forgetting their text when
they were moved internally by the vector in which they are stored, which
could result in e.g. their text becoming empty when a new column was
appended.

Fix this by adding the missing text (and also image and user data) field
to the move ctor and move assignment operator.

Closes #25519.
2025-07-12 04:12:59 +02:00
Vadim Zeitlin 61b71e5999 Replace all CppUnit-compatible macros with CATCH ones
No real changes, just get rid of the last vestiges of CppUnit in
wxListCtrl tests.
2025-07-12 04:01:19 +02:00
Vadim Zeitlin f8f2d6883e Get rid of CppUnit machinery in wxListCtrl unit tests
We still use some macros to avoid having to define the same test cases
for wxListCtrl and wxListView, but the code structure is much more
understandable and explicit now.

No changes in behaviour.
2025-07-12 03:55:27 +02:00
Vadim Zeitlin d3d3e0efa2 Merge branch 'fix-fileconf-logwarning'
Fix format specifier in wxLogWarning() call in wxFileConfig code.

See #25609.
2025-07-08 15:33:56 +02:00
Vadim Zeitlin 2099e2d92b Add a unit test for wxComboBox::SetStringSelection() events
Check that it doesn't produce any,

See #25553, #25599.
2025-07-08 15:24:19 +02:00
Vadim Zeitlin 8cfb4897ec Report 1-based positions in wxFileConfig warning message
0-based positions are probably not what the users expect.
2025-07-06 22:53:13 +02:00
Vadim Zeitlin 9baa27b86e Add unit test for wxFileConfig giving expected warnings
This should logically be part of the parent commit as it tests (mostly)
for the problem fixed by it, but do it separately because the parent
commit will need to be backported to 3.2, while this one won't be (as it
uses C++11).

See #25608.
2025-07-06 22:51:56 +02:00
Vadim Zeitlin 74c26ddb98 Extract TestLog and LogTestCase into a header
Allow reusing them in other tests.

No changes yet, this is a pure refactoring.
2025-07-06 22:44:51 +02:00
Vadim Zeitlin 1ff2eff97f Add wxSize::IsEmpty() and use it instead of IsAtLeast(1, 1)
Add a function consistent with the existing wxRect::IsEmpty() and use it
in a couple of places where IsAtLeast(wxSize(1, 1)) was used before.
2025-06-30 15:47:39 +02:00
GenevensiS 4c2ffb0c5b Add support for working with PNG "Description" text chunk
Add wxIMAGE_OPTION_PNG_DESCRIPTION which is filled with the contents of
the (first) "Description" chunk from the PNG file when loading it and
saved into such (iTXt) chunk when saving.

Fixes #25556.

Closes #25565.
2025-06-29 01:35:38 +02:00
Vadim Zeitlin af61bbe43c Trim trailing whitespace from all sources
This whitespace was annoying as it was getting automatically removed by
the contributors working with the editors respecting the settings in our
own .editorconfig and so resulting in patches that mixed significant and
whitespace-only changes.

Remove it once again (this has been already done before in 8fbca5cb70
(Remove all trailing spaces, 2019-01-30) but apparently only partially)
to avoid the problem.
2025-06-28 14:40:58 +02:00
Vadim Zeitlin 9277c7bd56 Merge branch 'msvc-utf8'
Interpret source code as being in UTF-8 when using MSVC.

See #25549.
2025-06-22 20:48:10 +02:00
Vadim Zeitlin 200e4f5ea6 Merge branch 'msw-empty-acceltable-create'
Fix creating empty accelerator table in wxMSW and make such tables
always return false from their IsOk() in all ports.

See #25538.
2025-06-22 20:40:13 +02:00
Vadim Zeitlin 51a1606b34 Replace old www.wxwidgets.org IP with 1.1.1.1 in the network test
There is no HTTP server running on 173.254.92.22 any more, so use
1.1.1.1 for testing whether Internet is accessible.
2025-06-20 17:45:51 +02:00
Vadim Zeitlin b672131185 Replace hex and octal escapes with literal UTF-8 characters
This makes the code more readable and there should be no reason not to
use UTF-8 in string literals any longer.

Also replace wxHAVE_U_ESCAPE (all still supported compilers have it)
with wxMUST_USE_U_ESCAPE, which is only set for MSVS 2015 currently and
will be removed when we drop support for it and can use literal Unicode
characters in the wide strings everywhere.
2025-06-20 17:42:55 +02:00
Vadim Zeitlin 750b2a47ae Fix creating wxAcceleratorTable with 0 entries
This was broken in 4cc13e1099 (Use vector in wxMSW wxAcceleratorTable
code, 2023-05-15), make it work again now and add a unit test ensuring
that it doesn't get broken again.

Also document the current behaviour.

Closes #25517.
2025-06-17 19:29:07 +02:00
Vadim Zeitlin edde669769 Avoid warning about possibly uninitialized variable in a test
MSVS warns about "width" being possibly uninitialized, so do initialize
it and also initialize "height" for consistency.
2025-06-17 17:07:15 +02:00
Vadim Zeitlin 18da5b8269 Add persistence support for groups of wxRadioButton controls
Unix builds / Ubuntu 24.04 wxGTK with ASAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK with UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / Windows MSVC (push) Has been cancelled
CMake builds / macOS latest wxOSX Ninja (push) Has been cancelled
CMake builds / macOS 14 wxOSX Xcode (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / Windows wxQt 6.8 (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxMac ARM with ASAN (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW builds / msw-msys2-clang (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
No Response / no-response (push) Has been cancelled
Allow to easily save and restore the selected radio button.

Closes #25530.
2025-06-16 19:21:42 +02:00
Alexander KoshelevandVadim Zeitlin 7d0023df4b Add persistence support for wxCheckBox
Allow to easily save and restore wxCheckBox state too.

Closes #25515.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2025-06-16 19:19:10 +02:00
Vadim Zeitlin 4146da6639 Merge branch 'fsvolume-icons'
Remove wxFSVolume::InitIcons() and some other minor cleanup.

See #25492.
2025-06-09 22:46:06 +02:00
Vadim Zeitlin 29f9d3512a Update version to 3.3.1 and rebake 2025-06-09 22:36:35 +02:00
Vadim Zeitlin e649bdf420 Only compile wxInfoBar unit test if wxUSE_INFOBAR==1
This should have been part of c1fa7055f6 (Fix wxInfoBar buttons
regression after custom checkbox addition, 2025-06-02).

See #25493.
2025-06-03 15:08:48 +02:00
Blake-Madden c1fa7055f6 Fix wxInfoBar buttons regression after custom checkbox addition
Update the functions dealing with buttons to take into account the extra
sizer added in cd07eabd54 (Add support for "Do not show this again"
checkbox to wxInfoBar, 2025-05-12) which broke the existing logic.

See #25394, #25461.

Closes #25489.

Closes #25493.
2025-06-03 03:25:56 +02:00
Vadim Zeitlin 5c86faa94a Add a trivial unit test of wxFSVolumeBase
Test that we can at least create it.
2025-06-03 02:03:24 +02:00
Vadim Zeitlin 01c265db15 Make wxLogXXX(string) work correctly
Don't interpret percent signs in the string as format specifiers if
there are no parameters.

This makes using wxLogWhatever(s) safe with arbitrary string "s" safe:
previously, if it contained any "%s" inside it, this could crash, but
now it just logs literal "%s".
2025-05-17 22:37:41 +02:00
Vadim Zeitlin febab88345 Get rid of CppUnit boilerplate in wxLog unit test
No real changes, just stop using CppUnit-compatible macros.
2025-05-17 22:34:52 +02:00
Vadim Zeitlin 716d74badc Add benchmarks for different string appending operations
Notably compare appending just a string, a number or a number via
conversion to string.
2025-05-12 00:31:13 +02:00
Vadim Zeitlin d387719e7d Align output from multiple benchmarks better
It's easier to compare the results of running multiple benchmarks if
their outputs are aligned.
2025-05-12 00:30:31 +02:00
Vadim Zeitlin 3e6b664762 Merge branch 'cursor-bundle'
Unix builds / Ubuntu 24.04 wxGTK with ASAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK with UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / Windows MSVC (push) Has been cancelled
CMake builds / macOS 14 wxOSX (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / Windows wxQt 6.8 (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxMac ARM with ASAN (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW builds / msw-msys2-clang (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
No Response / no-response (push) Has been cancelled
Add wxCursorBundle to make supporting high resolution cursors simpler.

Also some other cursor-related fixes.

See #25374.
2025-05-11 18:53:32 +02:00
Vadim Zeitlin fb09ee2a11 Merge branch 'webp-vcxproj' of github.com:MaartenBent/wxWidgets
Add possibility to build WebP as part of wxWidgets build, allowing to
use it with MSVS/Xcode project files too.

See #25339.
2025-05-11 16:08:00 +02:00
Vadim Zeitlin ad6f05afb4 Merge branch 'webp'
Add support for WebP image format, including animations.

See #24479, #25205.
2025-05-11 16:02:44 +02:00
Lauri Nurmi 6d8b1d4c14 Enable TestTimeTicks() for dates between 1970 and Y2K38
TestTimeTicks() checks were skipped for test dates with gmticks == -1,
ensure that these tests really run by providing the expected ticks
values.

See #24442.
2025-05-10 18:34:01 +02:00
Maxim CournoyerandVadim Zeitlin 01ca081d57 Allow using system CATCH2 library in configure
Add --with-catch2 configure option which can be used with "sys" value to
use the system version of CATCH2.

By default, still use the built-in version, however, as it doesn't have
any real drawbacks.

Closes #23654.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2025-05-10 18:23:02 +02:00
Maarten Bent fd14294606 Recreate build-files 2025-05-10 18:22:27 +02:00
Maarten Bent ad80d9c45d Fix outdated vcxproj files 2025-05-10 18:06:40 +02:00
Maarten Bent 312fa745d6 Update wxWEBPHandler tests 2025-05-10 17:19:30 +02:00
Maarten Bent d6209abf2d Update and generate build files
Run upmake, bakefile_gen, makeprojects.py, update-setup-h, autogen.
2025-05-10 17:19:29 +02:00
Hermann Höhne 15a2a622ec Add support for WebP image file format via libwebp. 2025-05-10 17:18:29 +02:00
Vadim Zeitlin b4e873312e Fix build regression due to a preprocessor condition in a test
This fixes a typo resulting in build failure from the recent b9726c02d5
(Disable sporadically failing test in MSVS 2019 CI build, 2025-05-09).

See #25056.
2025-05-10 16:06:14 +02:00