]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Attempt to implement a bunch of wx string.h equivalents.
[wxWidgets.git] / src / common / docview.cpp
index cb1ddc4380da6fc4bbf0870ea25b5b74f61e2e22..a7fd1a22094b5b4bd53bffb8c88883cdcdbbf618 100644 (file)
     #include "wx/mdi.h"
 #endif
 
     #include "wx/mdi.h"
 #endif
 
+#if wxUSE_PRINTING_ARCHITECTURE
+  #include "wx/prntbase.h"
+  #include "wx/printdlg.h"
+#endif
+
 #include "wx/msgdlg.h"
 #include "wx/choicdlg.h"
 #include "wx/docview.h"
 #include "wx/msgdlg.h"
 #include "wx/choicdlg.h"
 #include "wx/docview.h"
-#include "wx/printdlg.h"
 #include "wx/confbase.h"
 
 #include <stdio.h>
 #include "wx/confbase.h"
 
 #include <stdio.h>
@@ -240,9 +244,7 @@ bool wxDocument::SaveAs()
         return FALSE;
 
     wxString fileName(tmp);
         return FALSE;
 
     wxString fileName(tmp);
-    wxString path("");
-    wxString name("");
-    wxString ext("");
+    wxString path, name, ext;
     wxSplitPath(fileName, & path, & name, & ext);
 
     if (ext.IsEmpty() || ext == _T(""))
     wxSplitPath(fileName, & path, & name, & ext);
 
     if (ext.IsEmpty() || ext == _T(""))
@@ -669,9 +671,11 @@ BEGIN_EVENT_TABLE(wxDocManager, wxEvtHandler)
     EVT_MENU(wxID_SAVEAS, wxDocManager::OnFileSaveAs)
     EVT_MENU(wxID_UNDO, wxDocManager::OnUndo)
     EVT_MENU(wxID_REDO, wxDocManager::OnRedo)
     EVT_MENU(wxID_SAVEAS, wxDocManager::OnFileSaveAs)
     EVT_MENU(wxID_UNDO, wxDocManager::OnUndo)
     EVT_MENU(wxID_REDO, wxDocManager::OnRedo)
+#if wxUSE_PRINTING_ARCHITECTURE
     EVT_MENU(wxID_PRINT, wxDocManager::OnPrint)
     EVT_MENU(wxID_PRINT_SETUP, wxDocManager::OnPrintSetup)
     EVT_MENU(wxID_PREVIEW, wxDocManager::OnPreview)
     EVT_MENU(wxID_PRINT, wxDocManager::OnPrint)
     EVT_MENU(wxID_PRINT_SETUP, wxDocManager::OnPrintSetup)
     EVT_MENU(wxID_PREVIEW, wxDocManager::OnPreview)
+#endif
 END_EVENT_TABLE()
 
 wxDocManager::wxDocManager(long flags, bool initialize)
 END_EVENT_TABLE()
 
 wxDocManager::wxDocManager(long flags, bool initialize)
@@ -787,6 +791,7 @@ void wxDocManager::OnFileSaveAs(wxCommandEvent& WXUNUSED(event))
 
 void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event))
 {
 
 void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_PRINTING_ARCHITECTURE
     wxView *view = GetCurrentView();
     if (!view)
         return;
     wxView *view = GetCurrentView();
     if (!view)
         return;
@@ -799,10 +804,12 @@ void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event))
 
         delete printout;
     }
 
         delete printout;
     }
+#endif // wxUSE_PRINTING_ARCHITECTURE
 }
 
 void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
 {
 }
 
 void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_PRINTING_ARCHITECTURE
     wxWindow *parentWin = wxTheApp->GetTopWindow();
     wxView *view = GetCurrentView();
     if (view)
     wxWindow *parentWin = wxTheApp->GetTopWindow();
     wxView *view = GetCurrentView();
     if (view)
@@ -813,10 +820,12 @@ void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
     wxPrintDialog printerDialog(parentWin, & data);
     printerDialog.GetPrintDialogData().SetSetupDialog(TRUE);
     printerDialog.ShowModal();
     wxPrintDialog printerDialog(parentWin, & data);
     printerDialog.GetPrintDialogData().SetSetupDialog(TRUE);
     printerDialog.ShowModal();
+#endif // wxUSE_PRINTING_ARCHITECTURE
 }
 
 void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
 {
 }
 
 void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_PRINTING_ARCHITECTURE
     wxView *view = GetCurrentView();
     if (!view)
         return;
     wxView *view = GetCurrentView();
     if (!view)
         return;
@@ -834,6 +843,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
         frame->Initialize();
         frame->Show(TRUE);
     }
         frame->Initialize();
         frame->Show(TRUE);
     }
+#endif // wxUSE_PRINTING_ARCHITECTURE
 }
 
 void wxDocManager::OnUndo(wxCommandEvent& WXUNUSED(event))
 }
 
 void wxDocManager::OnUndo(wxCommandEvent& WXUNUSED(event))
@@ -1154,7 +1164,11 @@ wxDocTemplate *wxDocManager::FindTemplateForPath(const wxString& path)
 // template extension.
 
 wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
 // template extension.
 
 wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
+#ifdef __WXMSW__
                                                 int noTemplates,
                                                 int noTemplates,
+#else
+                                                int WXUNUSED(noTemplates),
+#endif
                                                 wxString& path,
                                                 long WXUNUSED(flags),
                                                 bool WXUNUSED(save))
                                                 wxString& path,
                                                 long WXUNUSED(flags),
                                                 bool WXUNUSED(save))
@@ -1183,9 +1197,12 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
 
     int FilterIndex = 0;
     wxString pathTmp = wxFileSelectorEx(_("Select a file"),
 
     int FilterIndex = 0;
     wxString pathTmp = wxFileSelectorEx(_("Select a file"),
-                                        _T(""), _T(""), _T(""),
+                                        _T(""),
+                                        _T(""),
                                         &FilterIndex,
                                         &FilterIndex,
-                                        descrBuf, 0, wxTheApp->GetTopWindow());
+                                        descrBuf,
+                                        0,
+                                        wxTheApp->GetTopWindow());
 
     if (!pathTmp.IsEmpty())
     {
 
     if (!pathTmp.IsEmpty())
     {