mouse event handling extended

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-09-11 18:03:59 +00:00
parent 8fef2a9b08
commit 6724566552
2 changed files with 10 additions and 4 deletions

View File

@@ -242,7 +242,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
return result ; return result ;
} }
static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{ {
OSStatus result = eventNotHandledErr ; OSStatus result = eventNotHandledErr ;
@@ -267,7 +267,10 @@ static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef
WindowRef window ; WindowRef window ;
short windowPart = ::FindWindow(point, &window); short windowPart = ::FindWindow(point, &window);
if ( IsWindowActive(window) && windowPart == inContent ) // either we really are active or we are capturing mouse events
if ( (IsWindowActive(window) && windowPart == inContent) ||
(wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) )
{ {
switch ( GetEventKind( event ) ) switch ( GetEventKind( event ) )
{ {

View File

@@ -242,7 +242,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
return result ; return result ;
} }
static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{ {
OSStatus result = eventNotHandledErr ; OSStatus result = eventNotHandledErr ;
@@ -267,7 +267,10 @@ static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef
WindowRef window ; WindowRef window ;
short windowPart = ::FindWindow(point, &window); short windowPart = ::FindWindow(point, &window);
if ( IsWindowActive(window) && windowPart == inContent ) // either we really are active or we are capturing mouse events
if ( (IsWindowActive(window) && windowPart == inContent) ||
(wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) )
{ {
switch ( GetEventKind( event ) ) switch ( GetEventKind( event ) )
{ {