X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d96cdd4a885886d1c76c6f4cb1a7eefba34b3d10..694f70fa9c0cc8889c208020bf75b2e3861f6818:/contrib/samples/ogl/studio/shapes.cpp diff --git a/contrib/samples/ogl/studio/shapes.cpp b/contrib/samples/ogl/studio/shapes.cpp index da69c5b64c..7ca63c9c90 100644 --- a/contrib/samples/ogl/studio/shapes.cpp +++ b/contrib/samples/ogl/studio/shapes.cpp @@ -83,7 +83,7 @@ void csEvtHandler::CopyData(wxShapeEvtHandler& copy) csEvtHandler& csCopy = (csEvtHandler&) copy; csCopy.m_label = m_label; } - + void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment)) { wxClientDC dc(GetShape()->GetCanvas()); @@ -196,7 +196,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetLogicalFunction(OGLRBLF); dc.SetPen(dottedPen); double xp, yp; @@ -210,7 +210,7 @@ void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUN wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetLogicalFunction(OGLRBLF); dc.SetPen(dottedPen); double xp, yp; @@ -226,7 +226,7 @@ void csEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int at // Check if we're on an object int new_attachment; wxShape *otherShape = canvas->FindFirstSensitiveShape(x, y, &new_attachment, OP_DRAG_RIGHT); - + if (otherShape && !otherShape->IsKindOf(CLASSINFO(wxLineShape))) { wxLineShape* theShape = new csLineShape; @@ -282,7 +282,7 @@ void csEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attac dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush(* wxTRANSPARENT_BRUSH); @@ -301,7 +301,7 @@ void csEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attac GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); // Draw bounding box for other selected shapes - wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); + wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { wxShape* shape = (wxShape*) node->GetData(); @@ -351,7 +351,7 @@ void csEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment) dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -360,7 +360,7 @@ void csEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment) GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); // Draw bounding box for other selected shapes - wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); + wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { wxShape* shape = (wxShape*) node->GetData(); @@ -415,7 +415,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment) new csCommandState(ID_CS_MOVE, newShape, GetShape())); // Move line points - wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); + wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { wxShape* shape = (wxShape*) node->GetData(); @@ -429,7 +429,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment) { wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy(); - wxNode *node1 = newLineShape->GetLineControlPoints()->GetFirst(); + wxObjectList::compatibility_iterator node1 = newLineShape->GetLineControlPoints()->GetFirst(); while (node1) { wxRealPoint *point = (wxRealPoint *)node1->GetData(); @@ -707,7 +707,7 @@ bool csEvtHandler::EditProperties() /* * Diagram */ - + bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) { wxDiagram::OnShapeSave(db, shape, expr); @@ -723,7 +723,7 @@ bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) expr.GetAttributeValue(_T("label"), label); csEvtHandler *handler = new csEvtHandler(&shape, &shape, label); shape.SetEventHandler(handler); - + return true; } @@ -1155,7 +1155,7 @@ void studioShapeEditProc(wxMenu& menu, wxCommandEvent& event) break; double theta = shape->GetRotation(); - const double myPi = 3.1415926535897932384626433832795 ; + const double myPi = M_PI; double ninetyDegrees = myPi/2.0; wxString opStr;