Commit Graph

71396 Commits

Author SHA1 Message Date
Kvaz1r
3e675fa75e Fix HitTestSingleLine(Scrolled) 2021-07-26 11:13:14 +03:00
Kvaz1r
a02b930596 Fix HitTestSingleLine(Beyond) 2021-07-26 11:06:51 +03:00
Maarten Bent
d07377fdf7 CMake: Use PCRE2 system library when available
Similar to other system libraries, use the builtin version on Windows and macOS
and try to find the system library on Unix.

Find the correct PCRE2 library based on the code point width that will be used.
2021-07-25 12:23:07 +02:00
Vadim Zeitlin
27d0e7804c Replace DoGetBorderSize() with GetWindowBorderSize()
We accidentally ended up with two functions doing the same thing, since
DoGetBorderSize() was added in 743b426605 (Added DoGetClientBestSize()
and use it for a couple of controls in wxMSW., 2009-06-22), as we
already had GetWindowBorderSize() added even earlier in 333d70525c
(added wxWindow::GetWindowBorderSize(), 2006-11-25), so remove the
redundant non-public function and use GetWindowBorderSize() everywhere.

This does change the behaviour of GetWindowBorderSize() in wxMSW, wxGTK
and wxUniv, as it now does what DoGetBorderSize() used to do, but this
should be an improvement, as DoGetBorderSize() implementation was more
precise.
2021-07-24 21:18:45 +02:00
Vadim Zeitlin
d50a707b0f Disable use of liblzma by default in configure too
Make configure behaviour consistent with CMake the default value of 0
for wxUSE_LIBLZMA in setup.h under MSW.

This also means that dependency on the system liblzma is not picked up
by default when --disable-sys-libs configure option is used, as this was
rather unexpected.
2021-07-24 20:51:08 +02:00
jolz
5a514afd34 Remove dependency on GTK from wxbase in CMake build
libwx_baseu_3.1.so should not include "-lgtk-3" during link.

See https://github.com/wxWidgets/wxWidgets/pull/2434

Closes #19224.
2021-07-24 19:19:03 +02:00
Vadim Zeitlin
68a293e75d Skip wxRegEx tests requiring Unicode support if wxUSE_UNICODE=0
There is not much else that can be done if we can't even represent the
contents of the test data properly.
2021-07-24 19:17:59 +02:00
Vadim Zeitlin
3415325f4f Add wxRegEx::GetLibraryVersionInfo()
This allows to check the version of PCRE used.
2021-07-24 19:17:59 +02:00
Vadim Zeitlin
dbe0950384 Drop WX_NO_REGEX_ADVANCED and always define wxHAS_REGEX_ADVANCED
Using non-PCRE system regex library, which was the only build variant
when wxHAS_REGEX_ADVANCED was not defined, is not supported any more, so
simplify the code by not testing for it.
2021-07-24 19:17:59 +02:00
Vadim Zeitlin
3d8438619d Use PCRE as built-in regex library
Replace the use of Henry Spencer's regex library with PCRE at the build
level and enable wxUSE_PCRE in wxRegEx code to switch to PCRE-based
implementation there.

Note that this has to be done unconditionally because there is no simple
way to select between the previously used regex library and PCRE at the
makefiles level.

We could still keep the possibility to use the system regex library
under Unix, but this doesn't seem to be worth doing, as we don't support
Unicode REs properly when using it (and never did), so drop support for
this too.
2021-07-24 19:17:59 +02:00
Vadim Zeitlin
966e9cefb5 Add PCRE submodule containing PCRE2 with wx-specific changes
The changes in wx branch make it possible to build PCRE using just the
makefiles, i.e. without configure step.

See README-WX.md in the submodule for more details.
2021-07-24 19:17:59 +02:00
Vadim Zeitlin
7b3659ea19 Check for WXREGEX_USING_BUILTIN rather than WX_NO_REGEX_ADVANCED
No real changes, just get rid of checks for WX_NO_REGEX_ADVANCED which
is rather confusing as it's not defined neither when using the system
library (which doesn't support advanced RE syntax at all), nor when
using PCRE (which always supports it).
2021-07-24 19:17:58 +02:00
Vadim Zeitlin
fa59d5700a Implement wxRegEx using PCRE
Adjust the tests and document the incompatibilities with the previously
used regex syntax.

In this commit the use of PCRE is conditional on wxUSE_PCRE which is
never defined as 1 yet, so the new code is still disabled.
2021-07-24 19:17:58 +02:00
Vadim Zeitlin
912f4b76ac Fix wxGTK build after WXSetInitialFittingClientSize() change
This should have been part of 136574b1e0 (Make wxSizer::SetSizeHints()
work again, 2021-07-24).

See #19170.
2021-07-24 19:15:55 +02:00
Vadim Zeitlin
f58af942ef Merge branch 'github-actions-cmake' of https://github.com/MaartenBent/wxWidgets
Add CI workflow using CMake.

See https://github.com/wxWidgets/wxWidgets/pull/2440
2021-07-24 18:22:50 +02:00
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
Maarten Bent
fcd9b4ba2b Add CMake builds to GitHub Actions 2021-07-24 16:39:19 +02:00
Maarten Bent
7446c64333 Add script to determine proc count in CI 2021-07-24 16:38:28 +02:00
Vadim Zeitlin
b30a93465a Don't allow accelerators intercept F4 in the MSW comboboxes
This key is used to open the dropdown and should still work even if
there is an accelerator using it too.
2021-07-24 12:43:17 +01:00
Vadim Zeitlin
47a5f42b78 Don't intercept key with modifiers in wxChoice
Check that we're dealing with plain keys, don't override accelerators
using {Alt,Ctrl,Shift}-Return, for example.
2021-07-24 12:43:17 +01:00
Vadim Zeitlin
61ff7de997 Slightly simplify wxChoice::MSWShouldPreProcessMessage()
No real changes, just make this version more consistent with the one in
wxTextCtrl and avoid unnecessary casts.
2021-07-24 12:43:17 +01:00
Vadim Zeitlin
8004002e5e Fix handling keys also used as accelerators in wxMSW wxComboBox
wxComboBox::MSWShouldPreProcessMessage() didn't take into account many
keys that must be handled in wxComboBox even if they're used as
accelerators, including plain (i.e. without Ctrl modifier) Delete, Home
and End that are used by the embedded text control, if there is one.

Fix this by reusing wxTextCtrl::MSWShouldPreProcessMessage() which
already handled these keys correctly, by moving it to wxTextEntry, which
can be used from both classes.

Also add a check for wxCB_READONLY to prevent overriding the
accelerators using the keys that the combobox doesn't need when there is
no text control in it.

Closes #19227.
2021-07-24 12:41:49 +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
af019685da 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-23 15:24:55 +01: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
Maarten Bent
8fe396d890 Fix -Wundef warnings in iOS build
Make sure <Availability.h> is always included in macOS/iOS build.
2021-07-21 22:32:28 +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