Commit Graph

71161 Commits

Author SHA1 Message Date
Lauri Nurmi
f4eae4df2a Really determine availability of all stdtoxx_l() functions
The case of missing strtod_l() is already handled by 9507bc430e
(Determine availability of the required xlocale API by compiling,
2017-04-14).

Similarly test for all the strto*_l() functions used by wx instead of
assuming that they are available if strtod_l() is.

It appears that the 'musl' C standard library, used on e.g. Alpine
Linux, does have strtod_l(), but not the others. Because of which this
check did not properly disable the feature, and compilation would fail.

Closes https://github.com/wxWidgets/wxWidgets/pull/2451
2021-07-27 17:47:32 +02:00
Lauri Nurmi
b029902f6c Fix compilation with gcc 4.4 under CentOS 6
Fix

	'friend' keyword needs 'class'

error introduced by 035c29e6a2 (Make wxRescaleCoord() safer by requiring
explicitly using From/To, 2021-07-13) which broke the build with gcc
4.4.7 used under CentOS 6.

Closes https://github.com/wxWidgets/wxWidgets/pull/2450
2021-07-27 17:47:31 +02:00
Vadim Zeitlin
62c776c17c Merge branch 'regex-pcre'
Implement wxRegEx using PCRE2.

See https://github.com/wxWidgets/wxWidgets/pull/2438
2021-07-27 17:47:31 +02:00
Artur Wieczorek
ea04c72754 Revert "Store clipping box coordinates in device units in wxWindowDCImpl, wxGTKDCImpl"
This reverts commit 95f1b262a4 ("Store clipping box coordinates in
device units in wxWindowDCImpl, wxGTKDCImpl", 2021-07-26) because
device coordinates can be used to determine final clipping box
coordinates more accurately only if current logical coordinates
are not stored directly in the corresponding variables of the base
class wxDCImpl.
2021-07-27 17:25:30 +02:00
Artur Wieczorek
eb055dba71 Store clipping box in device units only if it's set with wxDCImpl::DoSetClippingRegion
If derived class sets clipping region in a legitimate way by call to
DoSetClippingRegion() instead of directly storing logical coordinates
of the box in the internal variables we can store coordinates in
device units to determine final logical coordinates more reliably even
in case when coordinate transformations were applied to DC
in the meantime.
2021-07-27 17:14:50 +02:00
Kvaz1r
5bc725f505 Set insertion point to 0 in SetValue for multiline 2021-07-27 10:50:24 +03:00
Artur Wieczorek
95f1b262a4 Store clipping box coordinates in device units in wxWindowDCImpl, wxGTKDCImpl
Because retrieving clipping box coordinates in DoGetClippingRect() is
delegated to wxDCImpl::DoGetClippingRect() we need to store coordinates
in device units because such units are used internally in wxDCImpl
(2bcc9382a7 ("Store clipping box coordinates in device units for generic
wxDC", 2021-07-26).
Stored device units are converted to the current logical units
in wxDCImpl::DoGetClippingRect().
2021-07-26 23:43:17 +02:00
Artur Wieczorek
2bcc9382a7 Store clipping box coordinates in device units for generic wxDC
Clipping box coordinates should be stored internally in device units
to be independent on changes of logical coordinates made between calls
to wxDCImpl::DoSetClippingRegion().
These stored coordinates should be converted on demand to the current
logical units on call to wxDCImpl::DoGetClippingRect().
2021-07-26 21:04:21 +02:00
Artur Wieczorek
30a4090ac9 Fix determining DC area for wxDC with applied affine transformation
We need to take into account all aplied transformations (including affine
transformation set with SetTransformMatrix()) while calculating entire
DC area in logical coordinaates.
For derived wxDC's that support affine transformations
DeviceToLogical[Rel]() functions are overriden with
platform-specific implementations taking into account all applied
transformations (see documentation of wxDC::DeviceToLogical(),
wxDC::DeviceToLogicalRel()) and they may be not equivalent to
DeviceToLogical[Rel]{X|Y}().
2021-07-26 20:39:40 +02:00
Artur Wieczorek
74833ac435 Fix SetDeviceClippingRegion for wxSVGFileDC
Device-based coordinates should be converted to logical coordinates
before they are passed to SetClippingRegion().
2021-07-26 20:33:40 +02:00
Artur Wieczorek
b1206a6d50 Fix inserting new SVG <g> element
New <g> container element should be created every time
the actual transformation is changed and that's why
the flag should be set in ComputeScaleAndOrigin().
2021-07-26 20:30:57 +02:00
Artur Wieczorek
4193077888 Normalize clipping box in wxSVGFileDC::DoSetClippingRegion
Clipping box parameters should be in the canonical form
with (x,y) pointing to the top-left corner of the box and with
width/height >= 0 because SVG doesn't accept negative values
of width/height and because this form in expected in wxDCImpl.
2021-07-26 20:08:49 +02:00
Artur Wieczorek
4e16f01de9 Run all clipping region tests against wxSVGFileDC 2021-07-26 18:51:25 +02:00
Vadim Zeitlin
cf91a8d9a2 Merge branch 'border-size-functions'
Replace DoGetBorderSize() with GetWindowBorderSize() to avoid having 2
different functions doing (almost) the same thing.

See https://github.com/wxWidgets/wxWidgets/pull/2445
2021-07-26 13:59:41 +02:00
PB
3a0bb1b18c Fix setting focus to wxWebViewEdge
It was impossible to give focus to the actual web view in wxWebViewEdge
by keyboard navigation or programmatically with wxWebViewEdge::SetFocus().

Fix it by calling CoreWebView2Controller::MoveFocus() in the wxWebViewEdge's
wxEVT_SET_FOCUS handler.

Closes https://github.com/wxWidgets/wxWidgets/pull/2444
2021-07-26 13:57:10 +02:00
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