Corrected double clicks (always on the same window).

Corrected mouse up events (same window as mouse down).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2002-05-05 11:36:33 +00:00
parent a9d171bd00
commit 32b5be3d67
6 changed files with 374 additions and 320 deletions

View File

@@ -1386,6 +1386,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
}
extern int wxBusyCursorCount ;
static wxWindow *gs_lastWhich = NULL;
bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
{
@@ -1438,6 +1439,23 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
wxToolTip::RelayEvent( this , event);
#endif // wxUSE_TOOLTIPS
if (gs_lastWhich != this)
{
gs_lastWhich = this;
// Double clicks must always occur on the same window
if (event.GetEventType() == wxEVT_LEFT_DCLICK)
event.SetEventType( wxEVT_LEFT_DOWN );
if (event.GetEventType() == wxEVT_RIGHT_DCLICK)
event.SetEventType( wxEVT_RIGHT_DOWN );
// Same for mouse up events
if (event.GetEventType() == wxEVT_LEFT_UP)
return TRUE;
if (event.GetEventType() == wxEVT_RIGHT_UP)
return TRUE;
}
GetEventHandler()->ProcessEvent( event ) ;
return TRUE;