X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9838df2cefc5b368bb11f98c784ecc78f45ecaf7..84c188148d287017b052ea034e54ebce7d9993e6:/src/common/prntbase.cpp diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 03532a1b97..23e49e721e 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -222,7 +222,7 @@ void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event) */ BEGIN_EVENT_TABLE(wxPreviewControlBar, wxPanel) - EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnClose) + EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnWindowClose) EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrint) EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPrevious) EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNext) @@ -259,7 +259,7 @@ void wxPreviewControlBar::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.DrawLine( 0, h-1, w, h-1 ); } -void wxPreviewControlBar::OnClose(wxCommandEvent& WXUNUSED(event)) +void wxPreviewControlBar::OnWindowClose(wxCommandEvent& WXUNUSED(event)) { wxPreviewFrame *frame = (wxPreviewFrame *)GetParent(); frame->Close(TRUE); @@ -429,6 +429,10 @@ int wxPreviewControlBar::GetZoomControl() * Preview frame */ +BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame) + EVT_CLOSE(wxPreviewFrame::OnCloseWindow) +END_EVENT_TABLE() + wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): wxFrame(parent, -1, title, pos, size, style, name) @@ -442,7 +446,7 @@ wxPreviewFrame::~wxPreviewFrame() { } -bool wxPreviewFrame::OnClose() +void wxPreviewFrame::OnCloseWindow(wxCloseEvent& event) { MakeModal(FALSE); @@ -456,7 +460,8 @@ bool wxPreviewFrame::OnClose() m_printPreview->SetFrame(NULL); } delete m_printPreview; - return TRUE; + + Destroy(); } void wxPreviewFrame::Initialize()