Allow other classes to access the SetupMouseEvent function.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2006-10-19 00:22:11 +00:00
parent 24f6c4e865
commit bdf895fdd9

View File

@@ -248,9 +248,9 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
wxWindow* g_MacLastWindow = NULL ; wxWindow* g_MacLastWindow = NULL ;
static EventMouseButton lastButton = 0 ; EventMouseButton g_lastButton = 0 ;
static void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent ) void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
{ {
UInt32 modifiers = cEvent.GetParameter<UInt32>(kEventParamKeyModifiers, typeUInt32) ; UInt32 modifiers = cEvent.GetParameter<UInt32>(kEventParamKeyModifiers, typeUInt32) ;
Point screenMouseLocation = cEvent.GetParameter<Point>(kEventParamMouseLocation) ; Point screenMouseLocation = cEvent.GetParameter<Point>(kEventParamMouseLocation) ;
@@ -274,19 +274,19 @@ static void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
button = kEventMouseButtonSecondary ; button = kEventMouseButtonSecondary ;
// otherwise we report double clicks by connecting a left click with a ctrl-left click // otherwise we report double clicks by connecting a left click with a ctrl-left click
if ( clickCount > 1 && button != lastButton ) if ( clickCount > 1 && button != g_lastButton )
clickCount = 1 ; clickCount = 1 ;
// we must make sure that our synthetic 'right' button corresponds in // we must make sure that our synthetic 'right' button corresponds in
// mouse down, moved and mouse up, and does not deliver a right down and left up // mouse down, moved and mouse up, and does not deliver a right down and left up
if ( cEvent.GetKind() == kEventMouseDown ) if ( cEvent.GetKind() == kEventMouseDown )
lastButton = button ; g_lastButton = button ;
if ( button == 0 ) if ( button == 0 )
lastButton = 0 ; g_lastButton = 0 ;
else if ( lastButton ) else if ( g_lastButton )
button = lastButton ; button = g_lastButton ;
// determine the correct down state, wx does not want a 'down' for a mouseUp event, // determine the correct down state, wx does not want a 'down' for a mouseUp event,
// while mac delivers this button // while mac delivers this button