Commit graph

3200 commits

Author SHA1 Message Date
Vadim Zeitlin
42839def49 Merge branch 'fix_webkit_tests'
Fix WebView tests with WebKitGTK 2.43+.

See #24276.
2024-02-03 21:54:05 +01:00
Scott Talbert
1622a5c9c2 Fix WebView tests with WebKitGTK 2.43+
It seems that WebKitGTK is now failing to navigate to about: URLs unless
they are about:blank or about:srcdoc, so use about:srcdoc as the
alternate URL to fix the WebView tests.

Ref: 3c3163e71f
2024-02-01 20:56:32 -05:00
Vadim Zeitlin
10f235b43c Avoid implicit wxString conversions in wxLog{Status,SysError}()
They don't compile when wxNO_IMPLICIT_WXSTRING_ENCODING is defined.

Closes #24267.
2024-01-30 18:45:13 +01:00
oneeyeman1
91de9867ee Add wxStandardPaths::GetSharedLibrariesDir()
This function returns the directory with the application's shared
libraries, which is different from the plugins directory under Mac.

Closes #24052.
2024-01-28 18:41:20 +01:00
taler21
28ced1bc33 Make checks on character entry in numeric validators less relaxed
Restrict the input to not allow values that are greater than the
positive maximum or less than the negative minimum.
In many cases it is not necessary to allow invalid characters to be
entered. For example, if the specified range is 0 to 100.

See #24220.
2024-01-28 18:02:13 +01:00
Vadim Zeitlin
6d0b1369aa Also add wxObjArray::swap() for consistency with the other arrays
As with the previous commit, make this kind of arrays a bit more
comfortable to use as long as we can't avoid using them completely.
2024-01-21 00:01:54 +01:00
Vadim Zeitlin
a5f02170c4 Add possibility to iterate over wxObjArray using range-for
While such arrays are deprecated, we still use some of them, e.g. in
wxAUI code, so make using them slightly less painful by allowing
iterating over them naturally.
2024-01-20 23:58:48 +01:00
Vadim Zeitlin
19aee81c1d Update nanosvg to the latest upstream version
This notably fixes crash with SVGs using 1 stop gradients.

Relax the check in a test added in #24064 as it doesn't quite pass with
the new version -- this is somewhat suspicious but as it wasn't really
clear where did the original tolerance of 3 come from, it doesn't seem
to be a huge problem to increase it to 4 neither.

Closes #24213.
2024-01-19 21:17:43 +01:00
Vadim Zeitlin
565775a2c8 Merge branch 'bitmap-create-log-size'
Add wxBitmap::CreateWithLogicalSize() and use it.

See #24199.
2024-01-12 18:37:20 +01:00
Vadim Zeitlin
5dac42edc0 Merge branch 'datetime-f-fmt'
Add support for %F (ISO 8601 date) format specifier to wxDateTime.

See #24175.
2024-01-10 18:44:30 +01:00
Vadim Zeitlin
9cc5e5d276 Add wxBitmap::CreateWithLogicalSize()
This function should be used instead of CreateWithDIPSize() in portable
code, the latter is currently often used to do what this function is
doing, but this only works correctly in wxOSX and wxGTK3 but not wxMSW.
2024-01-09 03:15:56 +01:00
Vadim Zeitlin
e2cc16ef9c Fix test suite on Linux/s390x and maybe other architectures
We can't rely on file /sys/power/state always existing, so just skip the
test (with a warning) instead of failing it if it does not exist, as is
the case at least under s390x and seemingly other non-desktop platforms.

Closes #24197.

Co-authored-by: Cliff Zhao <qzhao@suse.com>
2024-01-09 02:38:43 +01:00
Vadim Zeitlin
cc8fbeed56 Merge branch 'xml-conv-simplify'
Simplify and modernize wxXmlDocument code.

See #24179.
2024-01-07 16:12:31 +01:00
Vadim Zeitlin
d36fd5822d Add MSVS 2022 solutions files for building tests
They're almost identical to MSVS 2019 ones but still convenient to have.
2024-01-07 00:43:48 +01:00
David Miguel Susano Pinto
68bef2fbf3 Add compound operators * and / to wxPoint and wxRealPoint
Also add unit tests for them as well as for the existing additive
compound operators.
2024-01-05 19:34:43 +01: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
20845d85a5 Deprecate "encoding" parameter of wxXmlDocument ctor and Load()
This parameter wasn't used for anything as it specified the encoding of
the data contents in memory and not the encoding of the XML file as
might be believed, so it only created unnecessary confusion.

See #24167.
2024-01-01 22:08:28 +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
7543e49c3c Add support for %F (ISO 8601 date) format specifier to wxDateTime
Recognize it when formatting and parsing dates.

Closes #24173.
2023-12-30 17:01:19 +01:00
Paul Cornett
f1731fd672 Return index of first added image in wxImageList::Add()
This is what MSW does. Broken in c374eefd34 (Fold wxOSX-specific wxImageList into
generic version, 2018-10-30)
See #10013
2023-12-28 12:49:47 -08:00
Vadim Zeitlin
378da09c84 Fix typo in "receive" occurring a few times
This is just too annoying to see.
2023-12-27 02:56:20 +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
bac0aa0e83 Merge branch 'ui-tests-fixes'
Attempt to work around failures in UI tests under AppVeyor.

See #24162.
2023-12-25 18:02:51 +01:00
Vadim Zeitlin
a2a8fc1d65 Avoid harmless MSVC shadowing warning in the test
Using "argc" and "argv" for parameter names triggers C4458 with MSVS
2022, warning about hiding class members with the same names.

As we can't rename the latter, rename the parameters to avoid this.
2023-12-25 17:56:10 +01:00
Vadim Zeitlin
2573e61c19 Fix harmless MSVC warning about uninitialized variables in a test
MSVS 2022 gave C4701 when std::isinf(d) was used below in release build.
2023-12-25 17:24:55 +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
Artur Wieczorek
c8552aec0c Make wxPGPropertyFlags a bitmask
To improve type safety of flags.
2023-12-25 15:09:50 +01:00
Viachaslau Lisouski
ca405352e0 Add wxFileSystemHandler for "data" scheme
This notably allows embedding images directly in HTML.

Closes #24138.
2023-12-18 22:19:11 +01:00
Blake-Madden
5ba009e861 Add Catholic Feasts holiday authority class (US observances)
This includes a static function to calculate Easter that can be used for
other authorities.

Document the wxDateTimeWorkDays and wxDateTimeHolidayAuthority classes.

Closes #24094.
2023-12-05 00:53:26 +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
Vadim Zeitlin
5318637839 Merge branch 'fix_SVG_premultiply' of https://github.com/teliseo/wxWidgets
Fix wxBitmapBundle::FromSVG(), which renders incorrectly on GTK and add
wxHAS_PREMULTIPLIED_ALPHA to make the code dealing with alpha more clear
and correct.

See #24097.
2023-11-30 02:35:20 +01:00
Ian McInerney
97cba7c0ca Restore ToCDouble compatibility with leading spaces/+ and hex
The previous ToCDouble() function accepted leading spaces, a starting +
sign, and hex strings. std::from_chars() does not accept spaces or +,
and requires a special flag to convert hex strings, so handle this
manually to preserve the old behaviour of this function.

This is similar to the changes done for ToCULong() in #24022.

Closes #24089.
2023-11-30 02:29:58 +01:00
Tim Eliseo
06e3e26ead Add checks to BitmapBundle::FromSVG-alpha test to catch lack of SVG premultiply. 2023-11-28 13:36:06 -08:00
Tim Eliseo
a160e788ae Add test BitmapBundle::FromSVG-alpha to verify SVG alpha premultiply fix.
See #24064.
2023-11-26 13:29:41 -08:00
Tim Eliseo
fce4941404 Add wxHAS_PREMULTIPLIED_ALPHA to abstract if wxBitmap pixels are premultiplied.
All previous relevant platform-specific tests have been changed to use this
symbol. Also, samples/image now premultiplies conditionally, correcting a
visual anomaly on wxGTK.
2023-11-26 13:23:52 -08:00
Paul Cornett
edd1d758de Fix wxCheckBox::SetValue() when in undetermined state with GTK
State becomes determined when SetValue() is called.
See #24074
2023-11-20 08:50:05 -08:00
Vadim Zeitlin
dede4b9326 Use "= default" for all trivial default ctors and dtors
Replace user-specified empty constructors and destructors with the
compiler-generated versions, which has a number of advantages for code
generation, in addition to being more clear.

Closes #22965.

Closes #24058.
2023-11-17 01:33:32 +01:00
Vadim Zeitlin
5a184d423b Merge branch 'qt-uiaction-tests' of https://github.com/AliKet/wxWidgets
Enable automatic tests using wxUIActionSimulator under wxQt.

See #24015.
2023-11-17 01:05:56 +01:00
Vadim Zeitlin
ef4fecc186 Merge branches 'tree-state-bmpbundle' and 'imglist-scalefactor'
Refactor wxImageList and convert it to use physical pixels and
add support for high DPI state images wxTreeCtrl using the new
wxImageList.

See #24000, #24033.
2023-11-17 01:03:27 +01:00
Vadim Zeitlin
39079cbf23 Return true from AddCatalog() if message ID matches language
When the original messages language matches the language of the locale
being used, these strings can be used directly and so AddCatalog()
should still return true for them but it didn't do it any more after the
changes of 94b1a17aeb (Add AddAvailableCatalog() and use it in
AddStdCatalog(), 2023-09-30).

See #18227.

Closes #24019.

Closes #24037.
2023-11-07 15:11:26 +01:00
Vadim Zeitlin
53b4f4ddf2 Use physical size in wxImageList
This seems to be the only way to fix using this class, which is
fundamentally incompatible with high DPI support, with bitmaps of
different logical but identical physical sizes.

By using physical size we ensure that the code chopping up the provided
bitmap in multiple images doesn't do it with the bitmap having the same
physical size but a different logical size from all the other bitmaps.
And, conceptually, logical size of the bitmaps in it really shouldn't
matter to the image list as it doesn't have a scaling factor and so
can't do anything useful with the logical size.

Moreover, we can't add wxImageList::SetScaleFactor() neither because
this class is, by design, supposed to be shareable between different
controls which may use different scale factors, so it doesn't make sense
to speak of the scale factor of the image list itself.

This undoes the changes made in the generic implementation back in
c374eefd34 (Fold wxOSX-specific wxImageList into generic version,
2018-10-30) and also eb52e86553 (Take into account scale factor of
images added to wxImageList, 2021-04-03).

Also update a couple of places where wxImageList is still used to use
physical sizes. Unfortunately some others can't be easily fixed, e.g.
global wxFileIconsTable would have to be completely rewritten.

Finally, add a unit test checking that things work as expected now:
previously the size of 24x24 bitmap in the image list containing
(scaled) 32x32 bitmaps would be 21x21 due to sub-bitmap extraction
kicking in.

Closes #23994.
2023-11-06 21:18:34 +01:00
Vadim Zeitlin
31fefa7ba2 Merge branch 'cxx17-string-toculong'
Fixes for C++17 version of wxString::ToCULong().

See #24022.
2023-11-03 00:51:04 +01:00
ali kettab
28cf04036d Enable tests using wxUIActionSimulator under wxQt 2023-11-01 01:06:39 +01:00
ali kettab
aa4a19cb1d Fix or skip other failures in the tests under wxQt 2023-11-01 00:39:19 +01:00
ali kettab
7469f0f5c4 Fix failures in TreeCtrlTestCase tests under wxQt 2023-10-31 22:58:21 +01:00
ali kettab
0e325e6262 Fix failures in ListBoxTestCase tests under wxQt 2023-10-31 22:56:30 +01:00
ali kettab
53c2b7d65b Fix failures in wxGrid tests under wxQt 2023-10-31 22:53:59 +01:00