X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89e92728495341a97be57248620f5a12c1ccab1e..023fff9ae0d4b7ace23fc5c070576c240a9f6915:/src/mac/toplevel.cpp?ds=sidebyside diff --git a/src/mac/toplevel.cpp b/src/mac/toplevel.cpp index 44af089624..efcf1a737d 100644 --- a/src/mac/toplevel.cpp +++ b/src/mac/toplevel.cpp @@ -162,7 +162,7 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac() wxPendingDelete.Append( new wxMacDeferredWindowDeleter( (WindowRef) m_macWindow ) ) ; } - #if TARGET_CARBON +#if TARGET_CARBON if ( m_macEventHandler ) { ::RemoveEventHandler((EventHandlerRef) m_macEventHandler); @@ -171,21 +171,9 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac() #endif wxRemoveMacWindowAssociation( this ) ; - wxTopLevelWindows.DeleteObject(this); - if ( wxModelessWindows.Find(this) ) wxModelessWindows.DeleteObject(this); - // If this is the last top-level window, exit. - if ( wxTheApp && (wxTopLevelWindows.Number() == 0) ) - { - wxTheApp->SetTopWindow(NULL); - - if ( wxTheApp->GetExitOnFrameDelete() ) - { - wxTheApp->ExitMainLoop() ; - } - } DisposeRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ; } @@ -245,14 +233,9 @@ pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef case kEventClassTextInput : if ( wxMacConvertEventToRecord( event , &rec ) ) { - short keycode ; - short keychar ; - keychar = short(rec.message & charCodeMask); - keycode = short(rec.message & keyCodeMask) >> 8 ; - long keyval = wxMacTranslateKey(keychar, keycode) ; + wxTheApp->m_macCurrentEvent = &rec ; wxWindow* focus = wxWindow::FindFocus() ; - - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) + if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( focus , rec.message , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) { // was handled internally result = noErr ;