X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ba06d5a8ccf8c224fcfbd52fa01a55abf7befbd..3030ae493df7500fd5da7555f141c0c8a690bd8a:/contrib/src/ogl/lines.cpp?ds=inline diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index c9f63ba16d..a5982157a0 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "lines.h" -#pragma implementation "linesp.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -22,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 @@ -34,7 +29,6 @@ #endif #include -#include #include "wx/ogl/ogl.h" @@ -668,7 +662,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p * Add yOffset to arrow, if any */ - const double myPi = (double) 3.14159265; + const double myPi = (double) M_PI; // The translation that the y offset may give double deltaX = 0.0; double deltaY = 0.0; @@ -842,8 +836,8 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p void wxLineShape::OnErase(wxDC& dc) { - wxPen *old_pen = m_pen; - wxBrush *old_brush = m_brush; + const wxPen *old_pen = m_pen; + const wxBrush *old_brush = m_brush; wxPen bg_pen = GetBackgroundPen(); wxBrush bg_brush = GetBackgroundBrush(); SetPen(&bg_pen); @@ -963,10 +957,10 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming) void wxLineShape::OnDrawOutline(wxDC& dc, double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(w), double WXUNUSED(h)) { - wxPen *old_pen = m_pen; - wxBrush *old_brush = m_brush; + const wxPen *old_pen = m_pen; + const wxBrush *old_brush = m_brush; - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); SetPen(& dottedPen); SetBrush( wxTRANSPARENT_BRUSH ); @@ -1550,7 +1544,7 @@ void wxLineShape::ReadAttributes(wxExpr *clause) wxExpr *spacingExpr = node->Nth(7); if (type_expr) - arrowType = (int)type_expr->IntegerValue(); + arrowType = (WXTYPE)type_expr->IntegerValue(); if (end_expr) arrowEnd = (int)end_expr->IntegerValue(); if (dist_expr) @@ -1734,7 +1728,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -1747,10 +1741,10 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub wxLineShape *lineShape = (wxLineShape *)this; - wxPen *old_pen = lineShape->GetPen(); - wxBrush *old_brush = lineShape->GetBrush(); + const wxPen *old_pen = lineShape->GetPen(); + const wxBrush *old_brush = lineShape->GetBrush(); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); lineShape->SetPen(& dottedPen); lineShape->SetBrush(wxTRANSPARENT_BRUSH); @@ -1795,10 +1789,10 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, lpt->m_xpos = x; lpt->m_ypos = y; lpt->m_point->x = x; lpt->m_point->y = y; - wxPen *old_pen = lineShape->GetPen(); - wxBrush *old_brush = lineShape->GetBrush(); + const wxPen *old_pen = lineShape->GetPen(); + const wxBrush *old_brush = lineShape->GetBrush(); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); lineShape->SetPen(& dottedPen); lineShape->SetBrush(wxTRANSPARENT_BRUSH); @@ -2356,7 +2350,7 @@ wxArrowHead::wxArrowHead(WXTYPE type, int end, double size, double dist, const w m_id = wxNewId(); } -wxArrowHead::wxArrowHead(wxArrowHead& toCopy) +wxArrowHead::wxArrowHead(wxArrowHead& toCopy):wxObject() { m_arrowType = toCopy.m_arrowType; m_arrowEnd = toCopy.GetArrowEnd(); m_arrowSize = toCopy.m_arrowSize; @@ -2408,7 +2402,7 @@ wxLabelShape::wxLabelShape(wxLineShape *parent, wxShapeRegion *region, double w, { m_lineShape = parent; m_shapeRegion = region; - SetPen(wxThePenList->FindOrCreatePen(wxColour(0, 0, 0), 1, wxDOT)); + SetPen(wxThePenList->FindOrCreatePen(*wxBLACK, 1, wxDOT)); } wxLabelShape::~wxLabelShape() @@ -2509,4 +2503,3 @@ void wxLabelShape::OnRightClick(double x, double y, int keys, int attachment) { m_lineShape->GetEventHandler()->OnRightClick(x, y, keys, attachment); } -