]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/prntbase.cpp
A couple of identifiers at global level moved to the .cpp file from .h where
[wxWidgets.git] / src / common / prntbase.cpp
index 03532a1b970c94bf51cc25e3d41220eaa0bffe9a..23e49e721e0e8040c8125a9b15813afe8609f881 100644 (file)
@@ -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()