#include "wx/generic/printps.h"
/*
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
#include "wx/mdi.h"
#endif
*/
// If the frame is an MDI child, just set the title
// to the name.
// Otherwise, append the document name to the name of the application
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
if (GetFrame()->IsKindOf(CLASSINFO(wxMDIChildFrame)))
#else
if (FALSE)
{
// TODO: trouble about this is that it pulls in the postscript
// code unecessarily
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
if ( wxTheApp->GetPrintMode() == wxPRINT_WINDOWS )
{
wxWindowsPrinter printer;
wxPrintData data;
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
if ( wxTheApp->GetPrintMode() == wxPRINT_WINDOWS )
{
wxPrintDialog printerDialog(parentWin, & data);
{
// Pass two printout objects: for preview, and possible printing.
wxPrintPreviewBase *preview = NULL;
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
if ( wxTheApp->GetPrintMode() == wxPRINT_WINDOWS )
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));
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()];
int noTemplates, wxString& path, long WXUNUSED(flags), bool WXUNUSED(save))
{
// We can only have multiple filters in Windows
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
char *descrBuf = new char[1000];
descrBuf[0] = 0;
int i;