]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxWindowDisabler instead of ShowModal() for showing the print preview frame ...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 17:09:30 +0000 (17:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 17:09:30 +0000 (17:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/prntbase.h
src/common/prntbase.cpp

index d7ed29ed22e001d45c8cf6122251b24d8a7f2c27..bc8df5fed0d95423e3883485e5a399a69f4d535c 100644 (file)
@@ -212,6 +212,7 @@ protected:
     wxPreviewCanvas*      m_previewCanvas;
     wxPreviewControlBar*  m_controlBar;
     wxPrintPreviewBase*   m_printPreview;
+    wxWindowDisabler*     m_windowDisabler;
 
 private:
     DECLARE_CLASS(wxPreviewFrame)
index 9c24e2d6867b0348eaab0882e9cb01c337673690..bb29c3e968d9eb0633cbf6db171fe534310bb25c 100644 (file)
@@ -544,6 +544,7 @@ wxFrame(parent, -1, title, pos, size, style, name)
     m_printPreview = preview;
     m_controlBar = NULL;
     m_previewCanvas = NULL;
+    m_windowDisabler = NULL;
 
     // Give the application icon
 #ifdef __WXMSW__
@@ -559,11 +560,8 @@ wxPreviewFrame::~wxPreviewFrame()
 
 void wxPreviewFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 {
-    // MakeModal doesn't work on wxMac, especially when there
-    // are multiple top-level windows.
-#ifndef __WXMAC__
-    MakeModal(FALSE);
-#endif
+    if (m_windowDisabler)
+        delete m_windowDisabler;
 
     // Need to delete the printout and the print preview
     wxPrintout *printout = m_printPreview->GetPrintout();
@@ -598,11 +596,7 @@ void wxPreviewFrame::Initialize()
     SetAutoLayout( TRUE );
     SetSizer( item0 );
 
-    // MakeModal doesn't work on wxMac, especially when there
-    // are multiple top-level windows.
-#ifndef __WXMAC__
-    MakeModal(TRUE);
-#endif
+    m_windowDisabler = new wxWindowDisabler(this);
 
     Layout();