Commit Graph

70973 Commits

Author SHA1 Message Date
Vadim Zeitlin
4186292e11 Improve wxIMPLEMENT_APP() documentation
Explain that this macro defines the application entry point.

Also document wxIMPLEMENT_WXWIN_MAIN which wasn't documented at all
previously.
2021-07-24 17:21:39 +01:00
Vadim Zeitlin
83396e54b5 Extend and improve wxSizer::SetSizeHints() documentation
Notably explicitly mention that the parameter of this method does not
need to be the window using this sizer.
2021-07-24 17:21:39 +01:00
Vadim Zeitlin
136574b1e0 Make wxSizer::SetSizeHints() work again
This function was broken when it was called for a window which was not
the window the sizer was associated with since the recent (pre-3.1.5)
changes trying to work around the problem with the initial windows size
when using GTK 3, see 9c0a8be1dc (Merge branch 'gtk-initial-size',
2021-04-13).

Fix it by passing the sizer to use for calculating the size explicitly
to WXSetInitialFittingClientSize() when we have it, and only falling
back on the window's own sizer if we don't.

Closes #19170.
2021-07-24 17:21:39 +01:00
Vadim Zeitlin
0b71b8d8eb Use simpler expression for libgcc path in MSW CI workflow
Use the gcc option which outputs this path directly, rather than
constructing it manually from pieces.

No real changes.
2021-07-24 17:21:39 +01:00
Artur Wieczorek
d4dd61800a Skip test known to fail under macOS < 10.13 2021-07-23 18:45:23 +02:00
Artur Wieczorek
bf2771d6d7 Check if stack of graphics states is empty while attempting to reset the clip
For macOS < 10.13 there is not available any method to really reset
the clipping region so ResetClip() is implemented using hack that
works for sure only if no graphics state was stored before on the stack
with PushState(). If ResetClip() is called when some graphics states
are already stored with PushState() we can only warn that resetting the clip
may be not effective.

See #19231.
2021-07-23 18:38:55 +02:00
Artur Wieczorek
7349f138e7 Keep track of graphics state stack depth
To avoid restoring graphics state from the empty stack. This
could also help in diagnosing potential problems with unbalanced
PushState()/PopState() calls.
2021-07-23 18:10:59 +02:00
Vadim Zeitlin
3e7ad82016 Merge branch 'more-tests-fixes'
Miscellaneous minor tests fixes/improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2442
2021-07-23 00:17:11 +02:00
Vadim Zeitlin
f417705e97 Try better workaround for the ASAN CI build failures
Try excluding RichTextCtrlTestCase in the CI build using ASAN, as the
test can still be killed while running the Table sub-test of this test
case even when running only a subset of all tests, so try skipping this
one instead.
2021-07-22 22:01:41 +02:00
Vadim Zeitlin
9dbf063a75 Fix ProcessEnter unit tests when running it on its own with wxGTK
Apparently setting focus doesn't work until a mouse click is simulated
to bring up the main test window to the front. This happened implicitly
when running the full test suite, due to e.g. doing it in wxButton unit
tests, which come before wxComboBox::ProcessEnter test, but not when
running just this test (or wxTextCtrl::ProcessEnter) on its own.

Make the test self-contained by simulating a mouse click before
simulating pressing "Enter".
2021-07-22 19:15:50 +02:00
Vadim Zeitlin
e6bac095ca Get rid of CppUnit boilerplate in wxButton unit tests
No real changes, just simplify the code by using CATCH directly.
2021-07-22 19:15:07 +02:00
Vadim Zeitlin
05f36c4819 Merge branch 'ci-asan-fixes'
Work around test failures in the ASAN build on GitHub CI.

See https://github.com/wxWidgets/wxWidgets/pull/2439
2021-07-22 17:34:34 +02:00
Vadim Zeitlin
f982f15a65 Temporary work around for a problem in ProcessEnter() unit test
Running this test on its own doesn't work currently, so run
ButtonTestCase, which uses wxUIActionSimulator::Click(), which somehow
fixes the problem in ProcessEnter test (by giving focus to the correct
window, probably), before it to avoid failures in this test now that we
run "wx*" tests separately.
2021-07-22 17:32:40 +02:00
Vadim Zeitlin
6af7c3da82 Work around GUI tests failure in ASAN build on GitHub CI
It seems like running the full test suite runs out of memory, as the
test is simply killed, without any more details, after running a certain
number of tests.

Split the tests into 2 parts and run them separately to work around this
problem.
2021-07-22 17:31:21 +02:00
Vadim Zeitlin
1154689322 Show the GUI tests being executed in the CI workflow
This is useful to check where the test dies when it does it.
2021-07-22 17:27:43 +02:00
Artur Wieczorek
c175b31630 Suppress "parameter unused" error in some builds 2021-07-21 07:21:29 +02:00
Artur Wieczorek
7ce588afab Don't use wxDC to get clipping box in wxGCDC
We shouldn't call wxDCImpl::DoGetClippingRect() from
wxGCDCImpl::DoGetClippingRect() because it wouldn't return the correct
result if there is an affine transformation applied to this DC,
as wxDCImpl is not aware of such transformations.
2021-07-20 23:10:26 +02:00
Artur Wieczorek
9e5c3a1152 Fix destroying clipping region for wxGCDC with applied affine transformation
We need to take into account all aplied transformations (including affine
transformations set with SetTransformMatrix()) while resetting clipping
box to its initial size.
2021-07-20 22:57:27 +02:00
Artur Wieczorek
42ee966b63 Add tests of clipping region functions for wxDC with transform matrix 2021-07-20 22:56:56 +02:00
Artur Wieczorek
902f4c61a4 Reimplement unit tests for clipping region functions with Catch
Use Catch instead of CppUnit for all unit tests here.
2021-07-20 22:42:02 +02:00
Artur Wieczorek
ce5e6cfc10 Fix setting clipping region for wxDC with rotated coordinate system (wxMSW)
We cannot assume that axis-aligned clipping box in local coordinates will
remain axis-aligned box in device coordinates so we need to take into
account all 4 corners of the clipping rectangle to create a polygonal
clipping region in device space.

Closes #19228.
2021-07-20 22:30:56 +02:00
James Pan
a35d8b932c Fix errors and inconsistent terms in zh_TW translations 2021-07-19 14:46:51 +02:00
Vadim Zeitlin
8b0decdf9d Merge branch 'univ_listbox_fixtest' of https://github.com/Kvaz1r/wxWidgets
Fix wxListBox in wxUniv to pass HitTest and ClickNotOnItem unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/2432
2021-07-17 20:41:50 +02:00
Vadim Zeitlin
d81d7b1563 Exclude .gitmodules from whitespace code style checks
This file uses TABs and can keep using them.
2021-07-17 20:41:18 +02:00
Kvaz1r
1e680157a9 Send event on toggle deselecting 2021-07-17 20:48:31 +03:00
Vadim Zeitlin
3489a07ad6 Avoid harmless MSVS 2019 variable shadowing warning
Rename a local variable to avoid clashing with the same name in an outer
scope, fixing a warning introduced in f41564a3e2 (Add
wxRegEx::ConvertFromBasic() helper, 2021-06-18).
2021-07-17 18:17:26 +02:00
Vadim Zeitlin
71d1ced5b8 Fix recently broken wxRegEx build in UTF-8 mode
Restore the use of c_str() replaced with wx_str() in 4dd77dabe8 (Check
for WXREGEX_CONVERT_TO_MB when calling regcomp() too, 2021-07-16), as
it's still necessary when wxUSE_UNICODE_UTF8==1.
2021-07-17 17:59:05 +02:00
Vadim Zeitlin
304d5e6c59 Merge branch 'regex-prepare-pcre'
Cleanup and simplify wxRegEx code.

See https://github.com/wxWidgets/wxWidgets/pull/2437
2021-07-17 17:13:38 +02:00
Vadim Zeitlin
fa1f7e74ce Merge branch 'deprecate-filename-normalize'
Deprecate wxFilename::Normalize() without flags and add convenient
GetAbsolutePath() to be used instead.

See https://github.com/wxWidgets/wxWidgets/pull/2428
2021-07-17 17:10:40 +02:00
Vadim Zeitlin
7ebb20fb04 Merge branch 'combo-simplify'
Simplify wxComboCtrl code by always using wxPopupTransientWindow if it's
available instead of various platform-specific workarounds that
shouldn't be needed any longer.

See https://github.com/wxWidgets/wxWidgets/pull/2423
2021-07-17 17:08:29 +02:00
Vadim Zeitlin
11d89a2233 Show "sys" when system liblzma is detected by configure
This is just a cosmetic change to make the lzma line in the summary
shown by configure at the end consistent with the other libraries.
2021-07-17 17:04:21 +02:00
Vadim Zeitlin
4dd77dabe8 Check for WXREGEX_CONVERT_TO_MB when calling regcomp() too
Make code more consistent by using the same approach as in the other
places where conversion is necessary in some builds and define temporary
variables for clarity.

Also use wx_str() when the conversion is not necessary rather than
c_str() as this is more efficient and allows to address an existing
FIXME comment.
2021-07-16 11:23:17 +02:00
Vadim Zeitlin
fb21f556a7 Use wxCharBuffer instead of manual allocations in GetErrorMsg()
Replace new[]/delete[] with a wxCharBuffer object.

Also check for conversion failure when converting the error message to
wide char string.
2021-07-16 11:17:32 +02:00
Vadim Zeitlin
d83368664c Remove unnecessary call to clear() in Replace()
There doesn't seem to be any need to clear the string in
WXREGEX_CONVERT_TO_MB case.
2021-07-16 11:02:48 +02:00
Vadim Zeitlin
838b693b46 Fix wxRegEx::GetMatch() to work in WXREGEX_CONVERT_TO_MB case
Using the offset into the wide string doesn't work for non-ASCII
characters, it must be converted to UTF-8 first.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
3a52523f96 Simplify code in wxRegExImpl::Replace()
Check for WXREGEX_CONVERT_TO_MB once and define textstr variable
pointing to the string data instead of using it several times.

No real changes.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
10dce93921 Remove handling of conversion errors that can't happen any more
Since we always convert to UTF-8, there can be no conversion errors and
we don't need to worry about them.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
78546007af Get rid of WXREGEX_IF_NEED_LEN() in wxRegEx code
Define wx_regexec() wrapper so that we can just drop the length if it's
not supported in one place, instead of having to use this ugly macro in
several places.

No real changes.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
8b812a92ae Always convert to UTF-8 if conversion is necessary
When using system regex functions in Unicode build, convert to UTF-8 and
not the current locale encoding, as this should work just as well if the
conversion doesn't fail and even better if it would fail when converting
to the current locale encoding because conversion to UTF-8 never does.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
f41564a3e2 Add wxRegEx::ConvertFromBasic() helper
This will be used to implement support for BREs using PCRE which doesn't
support them directly in the upcoming commits.
2021-07-15 22:45:29 +02:00
Vadim Zeitlin
020b5f7383 Add simple wxRegEx benchmark
Allow testing speed of some simple regex operations to compare the speed
of the currently used regex library with some other alternatives.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
8be998861d Use CHECK rather than REQUIRE in individual regex tests
Don't prevent the remaining CheckMatch() tests from running if one of
them fails by using CHECK() rather than REQUIRE().

This is a bit awkward and we probably ought to use sections here
instead, but this change is more minimal.

This commit is best viewed ignoring whitespace-only changes.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
381cd322ec Always skip the rest of regex tests checking for compile failure
It's useless to continue with testing the given regex if compiling it
has unexpectedly succeeded, all the rest of the tests will fail anyhow.

Also explain that REQUIRE() can't be used here, which is why we need to
use CHECK() and then check the same condition again before returning to
avoid the temptation to "simplify" things.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
862c051e9e Remove unnecessary calls to c_str() for wxLogError() arguments
Just pass strings to wxLogError() directly.

No real changes.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
94576538d3 Merge branch 'msw-install-docs'
Minor updates to wxMSW install docs.

See https://github.com/wxWidgets/wxWidgets/pull/2433
2021-07-15 21:42:12 +02:00
Vadim Zeitlin
3ec24bd981 Exclude cotire.cmake from white space checks
This is a third-party file using TABs for indentation.
2021-07-15 21:40:58 +02:00
JackBoosY
2f6dd5e80c Cmake: fix the generator expression with CUDA using file(GENERATE)
Closes https://github.com/wxWidgets/wxWidgets/pull/2404
2021-07-15 21:40:38 +02:00
Vadim Zeitlin
ed600d8304 Merge branch 'remove-travis' (except for the last commit)
Remove Travis-related scripts, checks and README badge.

See https://github.com/wxWidgets/wxWidgets/pull/2435
2021-07-15 21:36:01 +02:00
Vadim Zeitlin
63b4c5ee67 Remove checks for buildbot in the test suite
buildbot is not used since a long time, so don't bother checking for it
in IsAutomaticTest().

This commit is best viewed ignoring whitespace-only changes.
2021-07-15 19:59:11 +02:00
Vadim Zeitlin
278771e7d8 Remove mention of .travis.yml in Git attributes file
This file doesn't exist any longer.
2021-07-15 19:59:11 +02:00