Just extract the code generating wxEVT_SHOW for TLWs in wxGTK in its own
function before modifying it to avoid having to do it in two places.
No real changes, this is a pure refactoring.
This breaks existing unit tests using wxUIActionSimulator that do things
similar to
wxUIActionSimulator sim;
sim.Char('o', wxMOD_CMD);
wxTEST_DIALOG(wxYield(), ... expected "Open" dialog ...);
because the expected dialog would be shown from inside Char(), unlike
with the wxMSW implementation and GTK until the changes of 59ad9f46e6
(Make wxUIActionSimulator works more reliably on GTK/X11, 2020-05-07).
To still make sure there is a delay after the event, sleep, if
necessary, before simulating the next event: this is still enough for wx
test suite to pass, but allows the code like above to work with both
wxMSW and wxGTK.
In fact, doing it like this makes the code simpler and removes the need
to distinguish between press and release events or maintaining the
number of currently simulated-as-depressed buttons or keys, so it also
simplifies things as a side effect.
Also add some comments and rename Default_Delay constant to a more
accurately named MIN_DELAY_BETWEEN_EVENTS.
Closes https://github.com/wxWidgets/wxWidgets/pull/2318
We don't seem to be doing anything wrong, but ASAN detects many such
leaks as soon as we call functions such as gtk_css_style_render_icon()
(used by wxRendererGTK::DrawCheckBox()) and several others.
Briefly explain how to check that wxWidgets is installed correctly.
This is again redundant with the information already present elsewhere,
but it seems worth repeating it here.
Currently this simply links to the existing port-specific installation
instructions, but this should provide a less confusing and more
prominent entry point than the existing topics.
It is surprising that "for (auto& c: s)" doesn't compile, so document
this and propose a replacement.
Do not document the fact that "for (auto c: s)" actually allows to
modify the string via "c" (which is still wxUniCharRef) as this is
probably just going to confuse people more than help.
Events and sizing is more important than Unicode or i18n, so put them
first.
Also "important" doesn't really mean anything, so use a hopefully more
clear section name.
We can use BCM_GETIDEALSIZE message to get the size of the button that
best fits its text and image (if present).
It gives better results for text wxButton with wxBU_EXACTFIT style.
This was added 52cc838b12 (Implement 0-width pen consistently in
wxGraphicsContext, 2021-04-05) but doesn't seem useful and, in fact, was
not used at all in the constructor body, resulting in an unused
parameter warning, so just remove it.
No real changes.
This shortcut is undocumented, but works in rich edit controls and even
in plain ones if they use SHAutoComplete(), so support it in all
controls because this is what people expect.
Since f7247086c2 ("Fix storing wxBitmap data in GdkPixbuf", 2019-09-18),
919a4ec702 ("Fix drawing wxBitmap with mask", 2019-09-18) and other
commits (see #18498, #18508) RGBA wxBitmaps with masks are drawn properly
under wxGTK2 so if source wxImage has both alpha channel and a mask
the target wxBitmap also should have both components.
Since f7247086c2 ("Fix storing wxBitmap data in GdkPixbuf", 2019-09-18),
919a4ec702 ("Fix drawing wxBitmap with mask", 2019-09-18) and other
commits (see #18498, #18508) RGBA wxBitmaps with masks are drawn properly
under wxGTK2 so only wxBitmap raw RGBA data should be transferred to
wxImage RGBA data because mask is stored in the target wxImage separately.
Implementation is a hack, using a magic pointer value because just
storing this in wxTextAutoCompleteData is not simple, as any flag added
to it would need to be reset in several different places.
This is not used yet, but will be in the upcoming commits.
The new function has more clear semantics than GetOrCreateCompleter()
which both returned the completer value and set m_autoCompleteData to it
as a side effect. MSWEnsureHasAutoCompleteData() still does the latter,
but returns just a boolean indicating whether it succeeded or failed,
making using it more straightforward.
No real changes.
Make wxAppTraitsBase::GetAssertStackTrace() and reuse it in the assert
handler defined in the test to show more information about the asserts,
especially those failing in worker threads, if possible.
Don't use SetAllowSort() in one class and {Allow,Forbid}Sort() in
another one, both could be fine on their own but not together.
Also simplify code by forbidding sorting only if necessary (and add a
comment explaining why do we do it), which removes the need for
re-allowing it from two different places.
Avoid resorting the tree on each insertion, this results in horrible
performance even with a few thousand items. Instead, sort all the new
items only once at the end.
Catch all the exceptions when processing this event from the keyboard
hook as they must not escape from it and outside of the application.
Closes#19133.
Previously, splitting a string obtained by joining together array
with (any but last) elements ending in the escape character (normally
the backslash), didn't recover the original array because the separator
character following it in the resulting string was considered to be
escaped by wxSplit().
Fix this by escaping the trailing escape character itself.
Add a test confirming that this works as expected now, document this
behaviour and also slightly simplify wxSPlit() logic.
See https://github.com/wxWidgets/wxWidgets/pull/2311Closes#19131.
Just add a call to SetTextColoursAndFont() now that it is present in
this renderer base class (see the parent commit) to ensure that the
correct, i.e. corresponding to the column attribute, colour is used for
the stars.
Send a wxFullScreenEvent when the user enters or exits full screen on
macOS. EnableFullScreenView() has to be used to enable the native
full screen API.
Closes https://github.com/wxWidgets/wxWidgets/pull/2284