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:
@@ -2338,20 +2338,7 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
|
||||
{
|
||||
if ( event.GetEventType() == wxEVT_RIGHT_DOWN )
|
||||
{
|
||||
// copied from wxGTK : CS
|
||||
// VZ: shouldn't we move this to base class then?
|
||||
|
||||
// generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN
|
||||
// except that:
|
||||
//
|
||||
// (a) it's a command event and so is propagated to the parent
|
||||
// (b) under MSW it can be generated from kbd too
|
||||
// (c) it uses screen coords (because of (a))
|
||||
wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU,
|
||||
this->GetId(),
|
||||
this->ClientToScreen(event.GetPosition()));
|
||||
evtCtx.SetEventObject(this);
|
||||
if ( ! HandleWindowEvent(evtCtx) )
|
||||
if ( !WXSendContextMenuEvent(ClientToScreen(event.GetPosition())) )
|
||||
event.Skip() ;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user