]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
wxEVT_COMMAND_CHOICE_SELECTED => wxEVT_COMMAND_COMBOBOX_SELECTED
[wxWidgets.git] / src / msw / dialog.cpp
index 57b7d1cfc208cb82438677caaa78ca3f2e0ab8b8..d5f08d2412e554a1e2862f536c5eb0360af2e102 100644 (file)
 // for modal dialogs
 wxList wxModalDialogs;
 wxList wxModelessWindows;  // Frames and modeless dialogs
-extern wxList wxPendingDelete;
+extern wxList WXDLLEXPORT wxPendingDelete;
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
 
 BEGIN_EVENT_TABLE(wxDialog, wxPanel)
+  EVT_SIZE(wxDialog::OnSize)
   EVT_BUTTON(wxID_OK, wxDialog::OnOK)
   EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
   EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
@@ -360,6 +361,10 @@ bool wxDialog::Show(bool show)
           TranslateMessage(&msg);
           DispatchMessage(&msg);
         }
+
+        // If we get crashes (as per George Tasker's message) with nested modal dialogs,
+        // we should try removing the m_modalShowing test
+
         if (m_modalShowing && !::PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
         // dfgg: NB MUST test m_modalShowing again as the message loop could have triggered
         //       a Show(FALSE) in the mean time!!!
@@ -375,9 +380,12 @@ bool wxDialog::Show(bool show)
       node=disabledWindows.First();
       while(node) {
         wxWindow* win = (wxWindow*) node->Data();
-        HWND hWnd = (HWND) win->GetHWND();
-        if (::IsWindow(hWnd) && (wxModalDialogs.Member(win) || wxModelessWindows.Member(win) ))
-          ::EnableWindow(hWnd,TRUE);
+        if (wxModalDialogs.Member(win) || wxModelessWindows.Member(win))
+        {
+          HWND hWnd = (HWND) win->GetHWND();
+          if (::IsWindow(hWnd))
+            ::EnableWindow(hWnd,TRUE);
+        }
         node=node->Next();
       }
     }
@@ -568,6 +576,16 @@ bool wxDialog::OnClose(void)
     return FALSE;
 }
 
+void wxDialog::OnSize(wxSizeEvent& WXUNUSED(event))
+{
+  // if we're using constraints - do use them
+  #if wxUSE_CONSTRAINTS
+    if ( GetAutoLayout() ) {
+      Layout();
+    }
+  #endif
+}
+
 void wxDialog::OnCloseWindow(wxCloseEvent& event)
 {
     // Compatibility