X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2108f33a68772013d4e1c9dc2e476bb8ae77ad8f..f03b9d4585c6b087330598205d7e1de5ac10592b:/samples/docvwmdi/view.cpp diff --git a/samples/docvwmdi/view.cpp b/samples/docvwmdi/view.cpp index ea8b46df06..d359871f46 100644 --- a/samples/docvwmdi/view.cpp +++ b/samples/docvwmdi/view.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -24,8 +24,8 @@ #include "wx/wx.h" #endif -#if !USE_DOC_VIEW_ARCHITECTURE -#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h! +#if !wxUSE_DOC_VIEW_ARCHITECTURE +#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h! #endif #include "docview.h" @@ -54,9 +54,10 @@ bool DrawingView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) // X seems to require a forced resize int x, y; frame->GetSize(&x, &y); - frame->SetSize(x, y); + frame->SetSize(-1, -1, x, y); #endif frame->Show(TRUE); + Activate(TRUE); return TRUE; } @@ -106,14 +107,14 @@ bool DrawingView::OnClose(bool deleteWindow) // Clear the canvas in case we're in single-window mode, // and the canvas stays. canvas->Clear(); - canvas->view = NULL; - canvas = NULL; + canvas->view = (wxView *) NULL; + canvas = (MyCanvas *) NULL; wxString s(wxTheApp->GetAppName()); if (frame) frame->SetTitle(s); - SetFrame(NULL); + SetFrame((wxFrame*)NULL); Activate(FALSE); @@ -128,7 +129,7 @@ bool DrawingView::OnClose(bool deleteWindow) void DrawingView::OnCut(wxCommandEvent& WXUNUSED(event) ) { DrawingDocument *doc = (DrawingDocument *)GetDocument(); - doc->GetCommandProcessor()->Submit(new DrawingCommand("Cut Last Segment", DOODLE_CUT, doc, NULL)); + doc->GetCommandProcessor()->Submit(new DrawingCommand((const wxString) "Cut Last Segment", DOODLE_CUT, doc, (DoodleSegment *) NULL)); } IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView) @@ -146,7 +147,7 @@ bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) // X seems to require a forced resize int x, y; frame->GetSize(&x, &y); - frame->SetSize(x, y); + frame->SetSize(-1, -1, x, y); #endif frame->Show(TRUE); @@ -188,7 +189,7 @@ BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow) END_EVENT_TABLE() // Define a constructor for my canvas -MyCanvas::MyCanvas(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style): +MyCanvas::MyCanvas(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style): wxScrolledWindow(frame, -1, pos, size, style) { view = v; @@ -208,7 +209,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) if (!view) return; - static DoodleSegment *currentSegment = NULL; + static DoodleSegment *currentSegment = (DoodleSegment *) NULL; wxClientDC dc(this); PrepareDC(dc); @@ -222,7 +223,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) if (currentSegment->lines.Number() == 0) { delete currentSegment; - currentSegment = NULL; + currentSegment = (DoodleSegment *) NULL; } else { @@ -232,7 +233,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) doc->GetCommandProcessor()->Submit(new DrawingCommand("Add Segment", DOODLE_ADD, doc, currentSegment)); view->GetDocument()->Modify(TRUE); - currentSegment = NULL; + currentSegment = (DoodleSegment *) NULL; } } @@ -255,7 +256,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) } // Define a constructor for my text subwindow -MyTextWindow::MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style): +MyTextWindow::MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style): wxTextCtrl(frame, -1, "", pos, size, style) { view = v;