Create WXSendContextMenuEvent() helper function

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 commit is contained in:
Vadim Zeitlin
2020-01-07 16:33:20 +01:00
parent d52331046c
commit 3a09975465
7 changed files with 19 additions and 37 deletions

View File

@@ -1619,15 +1619,11 @@ bool wxWindowQt::QtHandleCloseEvent ( QWidget *handler, QCloseEvent *WXUNUSED( e
bool wxWindowQt::QtHandleContextMenuEvent ( QWidget *WXUNUSED( handler ), QContextMenuEvent *event )
{
wxContextMenuEvent e( wxEVT_CONTEXT_MENU, GetId() );
e.SetPosition(
const wxPoint pos =
event->reason() == QContextMenuEvent::Keyboard
? wxDefaultPosition
: wxQtConvertPoint( event->globalPos() )
);
e.SetEventObject(this);
return ProcessWindowEvent( e );
: wxQtConvertPoint( event->globalPos() );
return WXSendContextMenuEvent(pos);
}
bool wxWindowQt::QtHandleFocusEvent ( QWidget *WXUNUSED( handler ), QFocusEvent *event )