changed FindControl to FindControlUnderMouse and use ControlRef != NULL instead of ControlPart = noPart , we had false ControlPart = 0 returned under Carbon in MacOS X
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -835,7 +835,8 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
|||||||
if ( event.m_metaDown )
|
if ( event.m_metaDown )
|
||||||
modifiers |= cmdKey ;
|
modifiers |= cmdKey ;
|
||||||
|
|
||||||
controlpart = FindControl( localwhere , window , &control ) ;
|
// controlpart = FindControl( localwhere , window , &control ) ;
|
||||||
|
control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if ( AcceptsFocus() && FindFocus() != this )
|
if ( AcceptsFocus() && FindFocus() != this )
|
||||||
@@ -851,7 +852,7 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
|||||||
else
|
else
|
||||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||||
wxTheApp->s_lastMouseDown = 0 ;
|
wxTheApp->s_lastMouseDown = 0 ;
|
||||||
if ( controlpart && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
if ( control && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
||||||
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
||||||
{
|
{
|
||||||
MacHandleControlClick( control , controlpart ) ;
|
MacHandleControlClick( control , controlpart ) ;
|
||||||
|
@@ -835,7 +835,8 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
|||||||
if ( event.m_metaDown )
|
if ( event.m_metaDown )
|
||||||
modifiers |= cmdKey ;
|
modifiers |= cmdKey ;
|
||||||
|
|
||||||
controlpart = FindControl( localwhere , window , &control ) ;
|
// controlpart = FindControl( localwhere , window , &control ) ;
|
||||||
|
control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if ( AcceptsFocus() && FindFocus() != this )
|
if ( AcceptsFocus() && FindFocus() != this )
|
||||||
@@ -851,7 +852,7 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
|||||||
else
|
else
|
||||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||||
wxTheApp->s_lastMouseDown = 0 ;
|
wxTheApp->s_lastMouseDown = 0 ;
|
||||||
if ( controlpart && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
if ( control && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
||||||
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
||||||
{
|
{
|
||||||
MacHandleControlClick( control , controlpart ) ;
|
MacHandleControlClick( control , controlpart ) ;
|
||||||
|
Reference in New Issue
Block a user