supporting events also for root control (needed for event handling of mouse and paint at tlw-level)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-04-01 15:24:19 +00:00
parent b19bf058f3
commit 125c798467

View File

@@ -540,6 +540,7 @@ wxWindowMac::~wxWindowMac()
void wxWindowMac::MacInstallEventHandler()
{
wxAssociateControlWithMacControl( (ControlRef) m_macControl , this ) ;
InstallControlEventHandler( (ControlRef) m_macControl, GetwxMacWindowEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this,
(EventHandlerRef *)&m_macControlEventHandler);
@@ -610,7 +611,6 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
{
wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
wxAssociateControlWithMacControl( (ControlRef) m_macControl , this ) ;
::SetControlReference( (ControlRef) m_macControl , (long) this ) ;
MacInstallEventHandler();
@@ -1068,6 +1068,7 @@ void wxWindowMac::MacWindowToRootWindow( int *x , int *y ) const
if ( x ) pt.x = *x ;
if ( y ) pt.y = *y ;
if ( !IsTopLevel() )
HIViewConvertPoint( &pt , (ControlRef) m_macControl , (ControlRef) MacGetTopLevelWindow()->GetHandle() ) ;
if ( x ) *x = (int) pt.x ;
@@ -1100,6 +1101,7 @@ void wxWindowMac::MacRootWindowToWindow( int *x , int *y ) const
if ( x ) pt.x = *x ;
if ( y ) pt.y = *y ;
if ( !IsTopLevel() )
HIViewConvertPoint( &pt , (ControlRef) MacGetTopLevelWindow()->GetHandle() , (ControlRef) m_macControl ) ;
if ( x ) *x = (int) pt.x ;
@@ -2390,10 +2392,6 @@ wxRegion wxWindowMac::MacGetVisibleRegion( bool includeOuterStructures )
*/
bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
{
// we let the OS handle root control redraws
if ( m_macControl == MacGetTopLevelWindow()->GetHandle() )
return false ;
RgnHandle updatergn = (RgnHandle) updatergnr ;
bool handled = false ;