wxPropertyGrid::ExpandEscapeSequences() function should convert all valid
escape sequences (\r, \n, \t, \\) to the corresponding single characters
(CR, LF, TAB, backslash, accordingly) and
wxPropertyGrid::CreateEscapeSequences() function should do the reverse
operation and convert these raw characters to the corresponding escape
sequences.
Closes#17896.
Ensure that the restored size is at least equal to the best size of the
window to avoid cutting off parts of it in (a common) case when a newer
version of the program adds new UI elements, thus increasing the window
best size and possibly making the previously stored size too small.
Creating a font with wxFONTSTYLE_SLANT results in a font whose
GetStyle() returned wxFONTSTYLE_ITALIC, so it was never found in the
cache, resulting in, effectively, leaking memory and GDI handles because
each new call to wxFontList::FindOrCreateFont(...wxFONTSTYLE_SLANT)
created a new font.
Fix this by just hardcoding that wxFONTSTYLE_SLANT is wxFONTSTYLE_ITALIC
under MSW, this is ugly but avoids backwards incompatible (and not
obviously correct) change of making wxFont::GetStyle() return
wxFONTSTYLE_SLANT if the font was created using this style.
Notice that wxFont::GetStyle() does behave like this in wxOSX currently,
so there is an inconsistency between ports here. It would arguably be
better to make wxOSX behave like wxMSW because the actual font is really
italic and not slant/oblique and if we do this, the preprocessor
condition in this commit should be extended to cover wxOSX too.
Closes#17903.
The logic in wxButton::{Set,Unset}TmpDefault() didn't work at all when
the temporary button was the same as the permanent default button as the
code made the same button non-default immediately after making it
default (or vice versa). In particular, this ensured that default button
was never highlighted correctly (at least after the first focus change)
in dialogs containing a single button only.
Fix this by simply skipping modification of the old default button if it
was the same one as the new default button.
This feature to show/hide alpha values and opacity selector (slider) is
already implemented under wxGTK and for generic wxColourDialog.
For the sake of backward compatibility, this feature is enabled here by
default (through the corresponding property of wxColourData).
When clipping region is empty, CGContextGetClipBoundingBox() returns (+Inf,+Inf,0,0) rectangle but we need to return (0,0,0,0) rectangle in this case.
See #17609.
Currently region given in device coordinates is decomposed into the stripes which are next transformed to the logical coordinates required by underlying wxGraphicsContext::Clip() function. Some of these stripes given in device coordinates can have 1-pixel height what after transformation to logical coordinates can give zero-height stripes (after rounding). This can lead to the situation that in the region transformed to logical coordinates some stripes can disappear and final transformed region shape is different from the source shape (it has gaps).
To fix this issue device coordinates of the region are not manually transformed to the logical coordinates but instead wxGraphicsContext's is temporarily set to the state where its logical coordinates are equivalent to device coordinates and thus clipping region can be applied directly.
Solution for wxMSW, wxGTK is implemented in ea8cb7a24a.
Closes#17609.
Transformation settings already applied to the source objects (CGContext, wxWindow) and inherited by wxGraphicsContext should be considered as a baseline transformation matrix for wxGC and shouldn't be exposed through e.g. GetTransform() function (like it's done in Cairo or Direct2D). To report only transformations explicitly applied to wxGC by calls to the corresponding wxGC functions, we need to store initial CTM (in a dedicated variable) and "subtract" it from the actual transformation settings.
See #17609.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().
Solution for wxMSW, wxGTK was implemented in 98714ea452.
See #17646.
If underlying graphics context is rotated then drawing a rectangle with origin at (0,0) doesn't cover all the drawing area. To draw over entire area we need to get extents of the actual clipping region (with applied all transformations) and use it as coordinates of the drawn rectangle.
Solution for wxMSW and wxGTK was implemented in 12eaa61212eaa61930.
See #17636.
A simulation of context menu event by handling directly EVT_RIGHT_UP was implemented in wxSTC in 451c5cc7b9, but later on, EVT_CONTEXT_MENU generation in wxOSX was fixed in 524c47aa3a so simulation is no longer necessary and this event can be directly handled in wxSTC.
This makes it possible to wrap these classes automatically
It also documents wxGIFHandler::SaveAnimation() which wasn't previously
documented at all, even implicitly and so closes#16424.
Closes https://github.com/wxWidgets/wxWidgets/pull/511
Revert one of the changes of 5520702674 which
replaced direct check with a call to lstrlen() which seems to be unneeded and
doesn't compile in non-Unicode build.