This doesn't work anyhow, so it's better to prevent the code doing this
from compiling instead of getting run-time asserts or worse.
Also simplify construction of these events inside wxWidgets by passing
the window itself to the ctor instead of passing just its ID and calling
SetEventObject() separately later.
For consistency, do the same thing for wxNcPaintEvent too.
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.
Give the application code a possibility to disable or otherwise change
the menu items before the popup menu is shown, as in the other ports.
Closes https://github.com/wxWidgets/wxWidgets/pull/1532
These events use a different convention from all the other ones in Qt
and need to be ignored, rather than accepted, to prevent the default
action from occurring.
And these events are also sent to disabled windows, which are never
supposed to receive them in wx API.
Closes https://github.com/wxWidgets/wxWidgets/pull/1371
Using "move" is correct for positioning, as it takes into account the
frame extent. Unfortunately, there is no corresponding API to set the
frame size. So we need to compute the effective client size and use
"resize". We can't use "setGeometry" for this purpose, since a widget's
"geometry" excludes the frame size. We would need to adjust the position
to go from frame to client coordinates. It's more straightforward to
simply have Qt do it with "move".
Closes https://github.com/wxWidgets/wxWidgets/pull/1349
Handle some mouse events explicitly when a wxQtScrollArea is set as
"mouse captured".
The issue arises in that the QScrollArea has two methods: event() and
viewportEvent(). Normally a "QAbstractScrollAreaFilter" is set up by Qt
which routes any events to the viewportEvent() method. And the normal
event() method throws mouse events away (for reasons I'm not aware of -
but it is what it is). If a wx window with a scroll area (e.g.
wxRichTextCtrl) sets capture, the wxQtScrollArea (QScroll-derived) gets
set as the direct "mouse grabber", and all events then bypass the filter
and are sent directly to the "event" method, which throws them away. The
typical result is that the window setting capture no longer gets mouse
events, it keeps capture since it's looking for a mouse up that never
comes, and the app more or less locks up since all mouse events are
being effectively discarded.
This change catches any event that comes in via the event() method and,
when the mouse is captured by the widget, forwards it on to the
viewportEvent method instead, performing what the filter would do via
the normal event routing.
It doesn't forward on "mouse press" events because the initial event
that causes the capture ends up being fed back again, resulting in a
"captured twice" error. The underlying reason I can see for this "being
fed back again" is that, for some inexplicable reason, the
wxRichTextCtrl "skips" the event even though it has actually processed
it and taken capture. That means this solution isn't 100%, but it does
fix the 99%+ cases where the capture is only gotten to redirect mouse
moves and button ups.
Perhaps an alternative solution might be to stop grabbing the mouse in
wxQtScrollArea, but this would require more changes.
Closes https://github.com/wxWidgets/wxWidgets/pull/1346
The original drawing mechanism was generating lots of QWarning messages
when running samples (e.g. htlbox, caret, etc.) and in some cases was
not actually completely drawing every element of the sample. The issue
was that the QPicture was being shared incorrectly between wxWindow and
wxClientDC and attempts to start painting, update, etc. were generating
console warnings.
Closes https://github.com/wxWidgets/wxWidgets/pull/1152
Hide the window explicitly once it's created. This is not very useful,
as the real purpose of calling Hide() before Create() is to prevent the
window from being initially shown at all to avoid flicker, but better
than not hiding it at all.
Closes https://github.com/wxWidgets/wxWidgets/pull/1203
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.
This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
Update the actual tool tip used by Qt and not just the internal variable
when SetTip() is called.
Also implement wxToolTip::SetWindow().
Closes https://github.com/wxWidgets/wxWidgets/pull/1175
Use QScrollbar directly instead of wxScrollbar for the window scrollbars
to ensure that wxWindow::GetChildren() doesn't return these scrollbars.
Closes https://github.com/wxWidgets/wxWidgets/pull/1124
Move declaration of wxOwnerDrawnBase::ms_defaultMargin to correct file.
Do not include headers when wxUSE_UIACTIONSIMULATOR is disabled.
Add guards for wxUSE_DRAG_AND_DROP.
Use a different wxFont constructor in printing sample, which is also available in WXQT.