Stop defining pid_t in wx setup.h to avoid conflicts with the other
libraries (such as Boost.Process) also defining it under MSW and also
just because this was completely unnecessary.
See https://github.com/wxWidgets/wxWidgets/pull/2452
With both GTK 2 and 3 if a wxDVC cell has a background colour attribute
set then wxDataViewCustomRenderer::RenderText() sets the cell's
background property. With wxDataViewCheckIconText this results in items
drawn prior to the text to be painted over.
Reproducible using the dataview sample which on the MyListModel page
uses a background cell colour for the first column of odd-indexed rows.
Fix by drawing the text first, followed by the checkbox and possible
icon as before. There appear to be no other custom renderers in wx which
draw multiple items and may have needed fixing as well.
This commit is best viewed with git --color-moved option.
Closes https://github.com/wxWidgets/wxWidgets/pull/2449
The latter two are always defined in sys/types.h on all Unix systems and
we already define them for MSVC (which doesn't use configure anyhow).
The former type is always defined everywhere.
This type should always be defined in sys/types.h on any non-ancient
Unix system, so don't bother checking for it, which is not only wasteful
but can even be harmful because it can conflict with pid_t definitions
in the other libraries under Windows, where we (wrongly) define it as
int (which is actually a bug in autoconf, which was recently fixed, see
https://savannah.gnu.org/support/index.php?110296) when using CMake.
So just don't define it at all: it should be already defined under Unix
and we don't use it under MSW anyhow.
See https://github.com/microsoft/vcpkg/issues/19110
See #18150.
The distinction between redrawing the background and the rest of the
window only exists in MSW and we can't refresh the window without
refreshing its background in the other ports, but we can at least
document this.
Closes#19234.
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.