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
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
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.
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.
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().
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().
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}().
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().
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.
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
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
To avoid restoring graphics state from the empty stack. This
could also help in diagnosing potential problems with unbalanced
PushState()/PopState() calls.
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.
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".
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.