Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.
Preserve the existing API by reimplementing it in terms of the new one.
Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
This is not the best solution, but getting dozens of lines of warnings
when compiling this file is not great neither and there doesn't seem to
be anything else to do about this.
This was already the case in the generic version, but wxMSW one just
silently returned 0 for invalid item index.
Make it consistent with the other platforms and SetItemState() by
checking the index in it too.
Closes https://github.com/wxWidgets/wxWidgets/pull/1702
Unhandled mouse events should be skipped. Otherwise wxEVT_CONTEXT_MENU
event couldn't be generated by right clicking anywhere inside wxGrid and
could be only generated for the main grid part (but not the labels) by
pressing Shift-F10 under MSW.
Closes https://github.com/wxWidgets/wxWidgets/pull/1697
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.
This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.
Closes https://github.com/wxWidgets/wxWidgets/pull/1696
This is important to allow catching the context menu events from the
composite control children at the main window level using the main
window ID: previously, these events used the (typically auto-generated
internally) ID of the child window, which was an implementation detail
and prevented the code binding to these events using the ID of e.g.
wxListCtrl itself from working under the other platforms, where
wxListCtrl is a generic composite window, even if it worked under MSW,
where wxListCtrl is native.
Put common code from all the different ports into it.
This is not very useful right now, but it will allow to change this
function once, instead of applying the same change to all ports, in the
upcoming commit.
This crash was introduced in 2d15218c9d
and could happens inside wxBitmap::MSWBlendMaskWithAlpha() because the
code checked for a mask and alpha, but the mask could be lost after
AllocExclusive().
In practice, this happened e.g. when using 16-bit color as is the case
for Windows 7 Hyper-V VMs.
Closes https://github.com/wxWidgets/wxWidgets/pull/1695
wxEVT_TEXT events generated by native wxSearchCtrl implementations
always returned an empty string, as wxSearchCtrl was not recognized by
the special hack inside wxCommandEvent::GetString() which retrieved the
text on demand.
Fix this by adding yet another special case for this. This is not ideal,
but should do for now.
wxEVT_TEXT events generated by native wxSearchCtrl implementations
always returned an empty string, as wxSearchCtrl was not recognized by
the special hack inside wxCommandEvent::GetString() which retrieved the
text on demand.
Fix this by adding yet another special case for this. This is not ideal,
but should do for now.
Generalize the fix of d6fb86a81c and
explicitly activate the parent when a TLW with wxFRAME_FLOAT_ON_PARENT
style is hidden or minimized and not only when it is destroyed.
Closes#18535.
Ensure that the dialog is still alive when it gets the kill focus event
for its child which had focus just before the dialog was closed (or any
other events generated by this child when it detects that it's losing
focus, such as wxEVT_SPINCTRL) by resetting focus when the dialog is
being hidden and not when it's being destroyed.
This makes the events order more consistent with wxMSW but also, most
importantly, safer, as wxEVT_KILL_FOCUS handlers could previously easily
reference the fields of an already half-destroyed wxDialog-derived
object by the time they were run during wxTopLevelWindowGTK destructor
execution.
Closes#18145.
This is yet another fix related to recent wxBMPHandler changes: this one
is trivial, as it just avoids gcc signed/unsigned comparison warning,
but is still needed for the clean build.
See #18634.
The code from the previous commit used sizeof(BITMAPINFOHEADER), but
this struct is only defined under MSW, so this broke the build under the
other platforms.
Luckily, we don't actually need the struct itself, but just its size, so
simply hardcode it here as it's fixed (part of the BMP format) and not
going to change.
See #18634.
Only BITMAPINFOHEADER data are explicitly read and processed so for a bitmap
with BITMAPV4HEADER or BITMAPV5HEADER we have to forward stream position
to the end of the actual header in order to start reading colour table
from the right position.
Closes#18634.
The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
This adds a demonstration of drawing with affine 2D transformation applied
to wxDC. Transformation paramaters (translation, scale, rotation angle)
can be set/reset with new menu "Transformation".
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.