]> 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 035a76c16daf04e6ee9f99a90098900ada8b00d2..23e49e721e0e8040c8125a9b15813afe8609f881 100644 (file)
@@ -222,7 +222,7 @@ void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event)
  */
 
 BEGIN_EVENT_TABLE(wxPreviewControlBar, wxPanel)
  */
 
 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)
        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 );
 }
 
   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);
 {
   wxPreviewFrame *frame = (wxPreviewFrame *)GetParent();
   frame->Close(TRUE);
@@ -312,6 +312,7 @@ void wxPreviewControlBar::CreateButtons()
 {
   SetSize(0, 0, 400, 40);
 
 {
   SetSize(0, 0, 400, 40);
 
+  /*
 #ifdef __WXMSW__
   int fontSize = 9;
 #else
 #ifdef __WXMSW__
   int fontSize = 9;
 #else
@@ -320,6 +321,7 @@ void wxPreviewControlBar::CreateButtons()
 
   wxFont buttonFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
   SetFont(buttonFont);
 
   wxFont buttonFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
   SetFont(buttonFont);
+ */
 
   int buttonWidth = 65;
 #ifdef __WXGTK__
 
   int buttonWidth = 65;
 #ifdef __WXGTK__
@@ -330,7 +332,12 @@ void wxPreviewControlBar::CreateButtons()
 
   int x = 5;
   int y = 5;
 
   int x = 5;
   int y = 5;
+
+#ifdef __WXMOTIF__
+  int gap = 15;
+#else
   int gap = 5;
   int gap = 5;
+#endif
 
   m_closeButton = new wxButton(this, wxID_PREVIEW_CLOSE, _("Close"),
        wxPoint(x, y), wxSize(buttonWidth, buttonHeight));
 
   m_closeButton = new wxButton(this, wxID_PREVIEW_CLOSE, _("Close"),
        wxPoint(x, y), wxSize(buttonWidth, buttonHeight));
@@ -394,7 +401,7 @@ void wxPreviewControlBar::CreateButtons()
 
   delete[] choices;
 
 
   delete[] choices;
 
-  m_closeButton->SetDefault();
+  //  m_closeButton->SetDefault();
 }
 
 void wxPreviewControlBar::SetZoomControl(int zoom)
 }
 
 void wxPreviewControlBar::SetZoomControl(int zoom)
@@ -422,6 +429,10 @@ int wxPreviewControlBar::GetZoomControl()
  * Preview frame
  */
 
  * 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)
 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)
@@ -435,7 +446,7 @@ wxPreviewFrame::~wxPreviewFrame()
 {
 }
 
 {
 }
 
-bool wxPreviewFrame::OnClose()
+void wxPreviewFrame::OnCloseWindow(wxCloseEvent& event)
 {
   MakeModal(FALSE);
   
 {
   MakeModal(FALSE);
   
@@ -449,7 +460,8 @@ bool wxPreviewFrame::OnClose()
     m_printPreview->SetFrame(NULL);
   }
   delete m_printPreview;
     m_printPreview->SetFrame(NULL);
   }
   delete m_printPreview;
-  return TRUE;
+
+  Destroy();
 }
 
 void wxPreviewFrame::Initialize()
 }
 
 void wxPreviewFrame::Initialize()