Optimized function to draw H/V lines is based on ExtTextOut() API and therefore raster operations modes other than wxCOPY are not applicable.
Closes#18635.
This script used to live in oss-fuzz repository itself (under
projects/wxwidgets), but it seems better to have it in the main
repository, as this will make modifying it, e.g. to add new fuzzers,
simpler.
Don't trigger a confusing assertion failure about unknown scale mode if
a 0-sized window is being repainted.
It's not clear why should an empty window get repaint events in the
first place, but this does happen, at least under MSW, so guard against
it.
Icons were not supported any longer since the switch to the native
implementation in 235e61c311.
Restore them now by using text attachments (thanks to Scott B for the
idea). The vertical alignment is still not right, but it's better than
nothing.
See #17473.
Instead of using separate check and icon+text columns in the list model
page, use the combined check+icon+text column to verify that it works
(which is not the case current in the native Mac version).
Don't call -[NSCell setTextColor:] unless it really handles it: testing
for "colText" validity was insufficient, as it could be set as a
fallback.
Also move the fallback assignments inside the branches where they're
really used.
This fixes a bug introduced in 540fed9216,
see https://github.com/wxWidgets/wxWidgets/pull/1673
Restrict GTK workaround in wxTreeListModel::IsContainer() to the native
version, it does have a drawback when using the generic one as it
resulted in all items having the expander button.
See #18632.
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.
This can, unfortunately, be useful to work around various but multiple
native control limitations.
The changes of the previous commit were insufficient, as we could also
use an invalid column index when handling mouse event in an empty grid.
Fix this by checking for the line validity in PosToEdgeOfLine() instead
of adding another ad hoc check to wxGridColLabelWindow itself, as it
seems reasonable for this function to verify that it uses valid indices.
See #18629.
When the grid is empty, XToCol() has no choice but to return invalid
index (because there are no valid ones) when it's called from the
drawing code and passing such indices to GetColPos() results in an
assert, which is fatal inside wxEVT_PAINT handler.
Just short-circuit all this code by not doing anything in the case of
empty grid. This is sloppy, but simpler and more robust than any
alternatives.
Closes#18629.
It is said in the wxDC::DrawText() documentation that current logical function is ignored by this function (e928566f). This should apply also to wxGCDC implementation for the sake of consistency and text drawing should be always done with wxCOPY mode regardless of the current mode set.
This makes more sense for a page of a GtkNotebook, which is always
positioned at (0, 0) relative to its client area, and is also more
compatible with wxMSW.
Closes#18548.
Closes https://github.com/wxWidgets/wxWidgets/pull/1670
macOS 10.12+ implements automatic tabbing in the OS. This adds
entries to the menus and also adds a tab bar. Some applications
might want to disable this, so provide an interface for doing this.
Closes https://github.com/wxWidgets/wxWidgets/pull/1674
Add support for this attribute for text-like cells to the native macOS
version too, to bring it up to parity with the generic and GTK ones.
Closes https://github.com/wxWidgets/wxWidgets/pull/1673
Don't execute uname in Unix version of wxIsPlatform64Bit () to
determine if the current platform is 64-bit capable if the binary is
already a 64bit one.
This is consistent with how MSW implementation behaves and avoids a
pointless invocation when running 64-bit binaries.
As an added benefit, this prevents user harassment by macOS 10.15 if
they launch a wx application from a "protected" location like ~/Desktop
or ~/Downloads - apparently stat()ing CWD is considered evil and
privacy-invading these days.
Don't "override" UpdateBackingFromWindow() method of the base class
unless it really exists, which is only the case for the generic
wxDragImage implementation but not the native MSW one.
See https://github.com/wxWidgets/wxWidgets/pull/1671
The sample could crash after the following sequence of actions:
1. Resize splitter to hide the right/left window.
2. Activate replace menu action.
Fix this by checking if the window being replaced is non-null.
Closes https://github.com/wxWidgets/wxWidgets/pull/1672
Cairo colour patterns support only RGBA colours and therefore it is not
possible to create a colour pattern from wxPen with non-RGB colour
(non-solid colour). As a workaround under wxOSX for solid wxPen with
non-solid colour we can convert it to Cairo surface pattern (stiple)
because under wxOSX non-solid colour is actually represented by a pattern
image.
Cairo colour patterns support only RGBA colours and therefore it is not
possible to create a colour pattern from wxBrush with non-RGB colour
(non-solid colour). However under wxOSX, when we have a solid wxBrush with
non-solid colour, we can convert it to Cairo surface pattern (stiple)
because under wxOSX non-solid colour is actually represented by a pattern
image.
Under wxOSX non-solid wxColour with NSColor backend is represented by
pattern image and it would be useful to have ability to get it e.g. to help
dealing with non-solid wxColours by frameworks not supporting such colours,
like e.g. Cairo.
It turned out that drawing horizontal/vertical lines with optimized function based on ExtTextOut() Win API works as expected only for non-scaled DC. Therefore we can use this optimized way of drawing only for non-rotated and non-scaled DCs.
On not-scaled DCs we can use optimized function to draw also 0-pixel width lines (as a 1-pixel wide lines for compatibility with Win API).
Closes#18612.
Improve colour selection in AUI tab art code: prefer to use the system
colours and only fall back on the replacement ones if the contrast is
too small for the text using system colours to be readable.
Closes#18601.