]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/ogl/ogledit/view.cpp
Avoid warnings from mgl headers if possible.
[wxWidgets.git] / contrib / samples / ogl / ogledit / view.cpp
index 8e26ab5f6ee661246a4eef8757ac56f9a8ac4bfe..a23020a93d636e8369e69f233ac3b0d97e725bef 100644 (file)
@@ -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()
@@ -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
     {
@@ -176,19 +176,17 @@ bool DiagramView::OnClose(bool WXUNUSED(deleteWindow))
 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))