]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
* Deleted #include "wx/bufstrm.h"
[wxWidgets.git] / src / common / docview.cpp
index 9671a5cf2ca46cf5607d17e2e8eb96c1ae02f952..30af03944460aabc4b553365994b40c84a8d1901 100644 (file)
@@ -811,7 +811,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
         preview = new wxWindowsPrintPreview(printout, view->OnCreatePrintout());
     else
 #endif
-        preview = new wxPostScriptPrintPreview(printout, view->OnCreatePrintout());
+       preview = new wxPostScriptPrintPreview(printout, view->OnCreatePrintout());
 
     wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), "Print Preview",
                wxPoint(100, 100), wxSize(600, 650));
@@ -839,6 +839,30 @@ void wxDocManager::OnRedo(wxCommandEvent& WXUNUSED(event))
     doc->GetCommandProcessor()->Redo();
 }
 
+wxView *wxDocManager::GetCurrentView(void) const
+{
+    if (m_currentView)
+        return m_currentView;
+    if (m_docs.Number() == 1)
+    {
+        wxDocument* doc = (wxDocument*) m_docs.First()->Data();
+        return doc->GetFirstView();
+    }
+    return NULL;
+}
+
+// Extend event processing to search the view's event table
+bool wxDocManager::ProcessEvent(wxEvent& event)
+{
+    wxView* view = GetCurrentView();
+    if (view)
+    {
+        if (view->ProcessEvent(event))
+            return TRUE;
+    }
+    return wxEvtHandler::ProcessEvent(event);
+}
+
 wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
 {
   wxDocTemplate **templates = new wxDocTemplate *[m_templates.Number()];