X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1484b5cc701329c54bbe70f2a155119fd86945c7..e6b1317b7903e4802f4bab2b7540600340361061:/contrib/src/ogl/ogldiag.cpp diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index 1f7be29092..d580ee81ac 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -6,13 +6,9 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "ogldiag.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -21,11 +17,11 @@ #endif #ifndef WX_PRECOMP -#include +#include "wx/wx.h" #endif #if wxUSE_PROLOGIO -#include +#include "wx/deprecated/wxexpr.h" #endif #ifdef new @@ -45,8 +41,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxDiagram, wxObject) wxDiagram::wxDiagram() { m_diagramCanvas = NULL; - m_quickEditMode = FALSE; - m_snapToGrid = TRUE; + m_quickEditMode = false; + m_snapToGrid = true; m_gridSpacing = 5.0; m_shapeList = new wxList; m_mouseTolerance = DEFAULT_MOUSE_TOLERANCE; @@ -175,7 +171,7 @@ void wxDiagram::ShowAll(bool show) void wxDiagram::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2) { - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -231,7 +227,7 @@ bool wxDiagram::SaveFile(const wxString& filename) if (!shape->IsKindOf(CLASSINFO(wxControlPoint))) { - wxExpr *expr = NULL; + wxExpr *expr; if (shape->IsKindOf(CLASSINFO(wxLineShape))) expr = new wxExpr(_T("line")); else @@ -239,7 +235,7 @@ bool wxDiagram::SaveFile(const wxString& filename) OnShapeSave(*database, *shape, *expr); } - node = node->Next(); + node = node->GetNext(); } OnDatabaseSave(*database); @@ -250,7 +246,7 @@ bool wxDiagram::SaveFile(const wxString& filename) { wxEndBusyCursor(); delete database; - return FALSE; + return false; } database->Write(file); @@ -285,7 +281,7 @@ bool wxDiagram::SaveFile(const wxString& filename) } wxEndBusyCursor(); - return TRUE; + return true; } bool wxDiagram::LoadFile(const wxString& filename) @@ -296,7 +292,7 @@ bool wxDiagram::LoadFile(const wxString& filename) if (!database.Read(filename)) { wxEndBusyCursor(); - return FALSE; + return false; } DeleteAllShapes(); @@ -308,14 +304,14 @@ bool wxDiagram::LoadFile(const wxString& filename) OnHeaderLoad(database, *header); // Scan through all clauses and register the ids - wxNode *node = database.First(); + wxNode *node = database.GetFirst(); while (node) { wxExpr *clause = (wxExpr *)node->GetData(); long id = -1; clause->GetAttributeValue(_T("id"), id); wxRegisterId(id); - node = node->Next(); + node = node->GetNext(); } ReadNodes(database); @@ -326,7 +322,7 @@ bool wxDiagram::LoadFile(const wxString& filename) wxEndBusyCursor(); - return TRUE; + return true; } void wxDiagram::ReadNodes(wxExprDatabase& database) @@ -348,7 +344,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) OnShapeLoad(database, *shape, *clause); shape->SetCanvas(GetCanvas()); - shape->Show(TRUE); + shape->Show(true); m_shapeList->Append(shape); @@ -389,7 +385,7 @@ void wxDiagram::ReadLines(wxExprDatabase& database) if (classInfo) { wxLineShape *shape = (wxLineShape *)classInfo->CreateObject(); - shape->Show(TRUE); + shape->Show(true); OnShapeLoad(database, *shape, *clause); shape->SetCanvas(GetCanvas()); @@ -519,12 +515,12 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) // Allow for modifying file bool wxDiagram::OnDatabaseLoad(wxExprDatabase& WXUNUSED(db)) { - return TRUE; + return true; } bool wxDiagram::OnDatabaseSave(wxExprDatabase& WXUNUSED(db)) { - return TRUE; + return true; } bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) @@ -534,33 +530,33 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) if (shape.IsKindOf(CLASSINFO(wxCompositeShape))) { - wxNode *node = shape.GetChildren().First(); + wxNode *node = shape.GetChildren().GetFirst(); while (node) { wxShape *childShape = (wxShape *)node->GetData(); wxExpr *childExpr = new wxExpr(_T("shape")); OnShapeSave(db, *childShape, *childExpr); - node = node->Next(); + node = node->GetNext(); } } - return TRUE; + return true; } bool wxDiagram::OnShapeLoad(wxExprDatabase& WXUNUSED(db), wxShape& shape, wxExpr& expr) { shape.ReadAttributes(&expr); - return TRUE; + return true; } bool wxDiagram::OnHeaderSave(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr)) { - return TRUE; + return true; } bool wxDiagram::OnHeaderLoad(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr)) { - return TRUE; + return true; } #endif