X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8552e6f031ded8ae61b4a5b489fbf06962365da7..ec75509f94fb11322c1c69056d1ec2af8f041fe2:/contrib/samples/ogl/ogledit/view.cpp?ds=inline diff --git a/contrib/samples/ogl/ogledit/view.cpp b/contrib/samples/ogl/ogledit/view.cpp index 74f8f357fe..a23020a93d 100644 --- a/contrib/samples/ogl/ogledit/view.cpp +++ b/contrib/samples/ogl/ogledit/view.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -38,7 +38,7 @@ IMPLEMENT_DYNAMIC_CLASS(DiagramView, wxView) BEGIN_EVENT_TABLE(DiagramView, wxView) - EVT_MENU(OGLEDIT_CUT, DiagramView::OnCut) + EVT_MENU(wxID_CUT, DiagramView::OnCut) EVT_MENU(OGLEDIT_CHANGE_BACKGROUND_COLOUR, DiagramView::OnChangeBackgroundColour) EVT_MENU(OGLEDIT_EDIT_LABEL, DiagramView::OnEditLabel) END_EVENT_TABLE() @@ -52,7 +52,7 @@ bool DiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) canvas->view = this; SetFrame(frame); - Activate(TRUE); + Activate(true); // Initialize the edit menu Undo and Redo items doc->GetCommandProcessor()->SetEditMenu(((MyFrame *)frame)->editMenu); @@ -63,10 +63,10 @@ bool DiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) shapeCanvas->SetDiagram(diagramDoc->GetDiagram()); diagramDoc->GetDiagram()->SetCanvas(shapeCanvas); - return TRUE; + return true; } -#define CENTER FALSE // Place the drawing to the center of the page +#define CENTER false // Place the drawing to the center of the page // Sneakily gets used for default print/preview @@ -127,7 +127,7 @@ void DiagramView::OnDraw(wxDC *dc) if (diagram_p->GetShapeList()) { /* wxCursor *old_cursor = NULL; */ - wxNode *current = diagram_p->GetShapeList()->GetFirst(); + wxObjectList::compatibility_iterator current = diagram_p->GetShapeList()->GetFirst(); while (current) // Loop through the entire list of shapes { @@ -152,7 +152,7 @@ void DiagramView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)) bool DiagramView::OnClose(bool WXUNUSED(deleteWindow)) { if (!GetDocument()->Close()) - return FALSE; + return false; DiagramDocument *diagramDoc = (DiagramDocument *)GetDocument(); diagramDoc->GetDiagram()->SetCanvas(NULL); @@ -168,27 +168,25 @@ bool DiagramView::OnClose(bool WXUNUSED(deleteWindow)) SetFrame(NULL); - Activate(FALSE); + Activate(false); - return TRUE; + return true; } wxShape *DiagramView::FindSelectedShape(void) { DiagramDocument *doc = (DiagramDocument *)GetDocument(); - wxShape *theShape = NULL; - wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); + wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst(); while (node) { wxShape *eachShape = (wxShape *)node->GetData(); if ((eachShape->GetParent() == NULL) && eachShape->Selected()) { - theShape = eachShape; - node = NULL; + return eachShape; } else node = node->GetNext(); } - return theShape; + return NULL; } void DiagramView::OnCut(wxCommandEvent& WXUNUSED(event)) @@ -197,7 +195,7 @@ void DiagramView::OnCut(wxCommandEvent& WXUNUSED(event)) wxShape *theShape = FindSelectedShape(); if (theShape) - doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, TRUE, theShape)); + doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), wxID_CUT, doc, NULL, 0.0, 0.0, true, theShape)); } void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) @@ -208,7 +206,7 @@ void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) if (theShape) { wxColourData data; - data.SetChooseFull(TRUE); + data.SetChooseFull(true); data.SetColour(theShape->GetBrush()->GetColour()); wxColourDialog *dialog = new wxColourDialog(frame, &data);