use wxWindowDisabler instead of ShowModal() for showing the print preview frame (patch 832288)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
74c481d117
commit
7c9955536a
@ -212,6 +212,7 @@ protected:
|
|||||||
wxPreviewCanvas* m_previewCanvas;
|
wxPreviewCanvas* m_previewCanvas;
|
||||||
wxPreviewControlBar* m_controlBar;
|
wxPreviewControlBar* m_controlBar;
|
||||||
wxPrintPreviewBase* m_printPreview;
|
wxPrintPreviewBase* m_printPreview;
|
||||||
|
wxWindowDisabler* m_windowDisabler;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_CLASS(wxPreviewFrame)
|
DECLARE_CLASS(wxPreviewFrame)
|
||||||
|
@ -544,6 +544,7 @@ wxFrame(parent, -1, title, pos, size, style, name)
|
|||||||
m_printPreview = preview;
|
m_printPreview = preview;
|
||||||
m_controlBar = NULL;
|
m_controlBar = NULL;
|
||||||
m_previewCanvas = NULL;
|
m_previewCanvas = NULL;
|
||||||
|
m_windowDisabler = NULL;
|
||||||
|
|
||||||
// Give the application icon
|
// Give the application icon
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@ -559,11 +560,8 @@ wxPreviewFrame::~wxPreviewFrame()
|
|||||||
|
|
||||||
void wxPreviewFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
void wxPreviewFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// MakeModal doesn't work on wxMac, especially when there
|
if (m_windowDisabler)
|
||||||
// are multiple top-level windows.
|
delete m_windowDisabler;
|
||||||
#ifndef __WXMAC__
|
|
||||||
MakeModal(FALSE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Need to delete the printout and the print preview
|
// Need to delete the printout and the print preview
|
||||||
wxPrintout *printout = m_printPreview->GetPrintout();
|
wxPrintout *printout = m_printPreview->GetPrintout();
|
||||||
@ -598,11 +596,7 @@ void wxPreviewFrame::Initialize()
|
|||||||
SetAutoLayout( TRUE );
|
SetAutoLayout( TRUE );
|
||||||
SetSizer( item0 );
|
SetSizer( item0 );
|
||||||
|
|
||||||
// MakeModal doesn't work on wxMac, especially when there
|
m_windowDisabler = new wxWindowDisabler(this);
|
||||||
// are multiple top-level windows.
|
|
||||||
#ifndef __WXMAC__
|
|
||||||
MakeModal(TRUE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user