]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dialog.cpp
Patch [ 1314868 ] [wxMSW] Show MDI child menubars when ShowFullScreen(false)
[wxWidgets.git] / src / mac / carbon / dialog.cpp
index 9ec4ef5220b13e90232794cb99f3004a20de2642..d1aa43669ca7044df6a348be1137d229a475afe8 100644 (file)
@@ -9,9 +9,7 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "dialog.h"
-#endif
+#include "wx/wxprec.h"
 
 #include "wx/dialog.h"
 #include "wx/utils.h"
@@ -27,7 +25,6 @@ wxList wxModalDialogs;
 //wxList wxModelessWindows;  // Frames and modeless dialogs
 extern wxList wxPendingDelete;
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
 
 BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
@@ -42,8 +39,6 @@ BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
   EVT_CLOSE(wxDialog::OnCloseWindow)
 END_EVENT_TABLE()
 
-#endif
-
 void wxDialog::Init()
 {
     m_isModalStyle = false;
@@ -113,7 +108,8 @@ void wxDialog::OnCharHook(wxKeyEvent& event)
 
 bool wxDialog::IsModal() const
 {
-    return m_isModalStyle;
+    return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast
+    //    return m_isModalStyle;
 }
 
 
@@ -136,7 +132,7 @@ bool wxDialog::Show(bool show)
         InitDialog();
     }
 
-    if ( IsModal() )
+    if ( m_isModalStyle )
     {
         if ( show )
         {
@@ -163,6 +159,8 @@ void wxDialog::DoShowModal()
 
     wxModalDialogs.Append(this);
 
+    SetFocus() ;
+    
 #if TARGET_CARBON
     BeginAppModalStateForWindow(  (WindowRef) MacGetWindowRef()) ;
 #else
@@ -188,7 +186,7 @@ void wxDialog::DoShowModal()
 // Replacement for Show(TRUE) for modal dialogs - returns return code
 int wxDialog::ShowModal()
 {
-    if ( !IsModal() )
+    if ( !m_isModalStyle )
     {
         SetModal(TRUE);
     }
@@ -201,8 +199,9 @@ int wxDialog::ShowModal()
 //     dialogs and should work for both of them
 void wxDialog::EndModal(int retCode)
 {
-  SetReturnCode(retCode);
-  Show(FALSE);
+    SetReturnCode(retCode);
+    Show(FALSE);
+    SetModal(false);
 }
 
 // Standard buttons