X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e40298d54ecd5b109222a7c60aa2ef084a304d69..79a73b4f86090278c242a8cca5fd9147a31a4419:/src/mac/carbon/dialog.cpp diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index 7b7bfc024b..581c50198f 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -63,7 +63,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) return FALSE; - MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) , name ) ; + MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) & ~(wxYES|wxOK|wxNO|wxCANCEL) , name ) ; m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ; SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; @@ -78,6 +78,9 @@ void wxDialog::SetModal(bool flag) m_windowStyle |= wxDIALOG_MODAL; wxModelessWindows.DeleteObject(this); +#if TARGET_CARBON + SetWindowModality( (WindowRef) MacGetWindowRef() , kWindowModalityAppModal , NULL ) ; +#endif } else { @@ -89,7 +92,7 @@ void wxDialog::SetModal(bool flag) wxDialog::~wxDialog() { - m_isBeingDeleted = TRUE ; + m_isBeingDeleted = TRUE; Show(FALSE); } @@ -164,18 +167,8 @@ void wxDialog::DoShowModal() wxModalDialogs.Append(this); - wxWindow *parent = GetParent(); + wxWindow *parent = GetParent(); - // remember where the focus was - wxWindow *winFocus = FindFocus(); - if ( !winFocus ) - { - winFocus = parent; - } - if ( !winFocus ) - { - winFocus = wxTheApp->GetTopWindow(); - } #if TARGET_CARBON BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ; #else @@ -195,13 +188,6 @@ void wxDialog::DoShowModal() // TODO probably reenable the parent window if any s_macIsInModalLoop = formerModal ; #endif - - - // and restore focus - if ( winFocus ) - { - winFocus->SetFocus(); - } }