X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9746a2ba50fdfa914e0476cb31710f9ccb5cc3cc..4005cc780c59b38290754ff3fb5199e792e4f094:/samples/docvwmdi/view.cpp diff --git a/samples/docvwmdi/view.cpp b/samples/docvwmdi/view.cpp index d943bb082b..80adc13467 100644 --- a/samples/docvwmdi/view.cpp +++ b/samples/docvwmdi/view.cpp @@ -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,7 +54,7 @@ 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); @@ -106,8 +106,8 @@ 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) @@ -128,7 +128,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 +146,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 +188,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 +208,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 +222,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) if (currentSegment->lines.Number() == 0) { delete currentSegment; - currentSegment = NULL; + currentSegment = (DoodleSegment *) NULL; } else { @@ -232,7 +232,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 +255,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;