toplevel event handler exposed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2004-03-28 17:50:04 +00:00
parent aa4d3151d6
commit 949cb163a7

View File

@ -74,7 +74,7 @@ extern long wxMacTranslateKey(unsigned char key, unsigned char code) ;
static const EventTypeSpec eventList[] =
{
// TODO remove control related event like key and mouse (except for WindowLeave events)
#if !TARGET_API_MAC_OSX
#if 1
{ kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } ,
{ kEventClassKeyboard, kEventRawKeyDown } ,
@ -827,6 +827,16 @@ void wxTopLevelWindowMac::MacSetBackgroundBrush( const wxBrush &brush )
}
}
void wxTopLevelWindowMac::MacInstallTopLevelWindowEventHandler()
{
if ( m_macEventHandler != NULL )
{
verify_noerr( ::RemoveEventHandler( (EventHandlerRef) m_macEventHandler ) ) ;
}
InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacTopLevelEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler);
}
void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
const wxPoint& pos,
const wxSize& size,
@ -950,13 +960,12 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
else
{
::CreateRootControl( (WindowRef)m_macWindow , (ControlRef*)&m_macControl ) ;
MacInstallEventHandler() ;
}
MacInstallEventHandler() ;
InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacTopLevelEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler);
MacInstallTopLevelWindowEventHandler() ;
m_macFocus = NULL ;
if ( HasFlag(wxFRAME_SHAPED) )