From c0989defa045fb64e325fc7b37b4dd2c8f21a2d8 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 18 Apr 2006 22:26:26 +0000 Subject: [PATCH] Fixes after stock gdi changes within core library git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/ogl/basic.h | 6 +++--- contrib/include/wx/ogl/drawn.h | 12 ++++++------ contrib/samples/ogl/ogledit/doc.cpp | 4 ++-- contrib/samples/ogl/ogledit/doc.h | 2 +- contrib/src/ogl/basic.cpp | 2 +- contrib/src/ogl/drawn.cpp | 12 ++++++------ contrib/src/ogl/lines.cpp | 8 ++++---- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/contrib/include/wx/ogl/basic.h b/contrib/include/wx/ogl/basic.h index 3c3895b614..0360f19c9e 100644 --- a/contrib/include/wx/ogl/basic.h +++ b/contrib/include/wx/ogl/basic.h @@ -300,7 +300,7 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler inline void SetId(long i) { m_id = i; } inline long GetId() const { return m_id; } - void SetPen(wxPen *pen); + void SetPen(const wxPen *pen); void SetBrush(const wxBrush *brush); virtual void Show(bool show); @@ -329,7 +329,7 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler void AddText(const wxString& string); - inline wxPen *GetPen() const { return m_pen; } + inline const wxPen *GetPen() const { return m_pen; } inline const wxBrush *GetBrush() const { return m_brush; } /* @@ -527,7 +527,7 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler wxShapeEvtHandler* m_eventHandler; bool m_formatted; double m_xpos, m_ypos; - wxPen* m_pen; + const wxPen* m_pen; const wxBrush* m_brush; wxFont* m_font; wxColour m_textColour; diff --git a/contrib/include/wx/ogl/drawn.h b/contrib/include/wx/ogl/drawn.h index 7b1d0f9449..f90f541089 100644 --- a/contrib/include/wx/ogl/drawn.h +++ b/contrib/include/wx/ogl/drawn.h @@ -61,7 +61,7 @@ class WXDLLIMPEXP_OGL wxPseudoMetaFile: public wxObject inline const wxBrush* GetFillBrush() const { return m_fillBrush; } inline void SetOutlinePen(wxPen* pen) { m_outlinePen = pen; } - inline wxPen* GetOutlinePen() const { return m_outlinePen; } + inline const wxPen* GetOutlinePen() const { return m_outlinePen; } inline void SetOutlineOp(int op) { m_outlineOp = op; } inline int GetOutlineOp() const { return m_outlineOp; } @@ -96,8 +96,8 @@ public: virtual void SetClippingRect(const wxRect& rect); virtual void DestroyClippingRect(); - virtual void SetPen(wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual - virtual void SetBrush(wxBrush* brush, bool isFill = false); // pens/brushes etc. + virtual void SetPen(const wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual + virtual void SetBrush(const wxBrush* brush, bool isFill = false); // pens/brushes etc. virtual void SetFont(wxFont* font); virtual void SetTextColour(const wxColour& colour); virtual void SetBackgroundColour(const wxColour& colour); @@ -113,7 +113,7 @@ public: // Pen/brush specifying outline/fill colours // to override operations. - wxPen* m_outlinePen; + const wxPen* m_outlinePen; const wxBrush* m_fillBrush; wxList m_outlineColours; // List of the GDI operations that comprise the outline wxList m_fillColours; // List of the GDI operations that fill the shape @@ -184,8 +184,8 @@ class WXDLLIMPEXP_OGL wxDrawnShape: public wxRectangleShape virtual void SetClippingRect(const wxRect& rect); virtual void DestroyClippingRect(); - virtual void SetDrawnPen(wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual - virtual void SetDrawnBrush(wxBrush* brush, bool isFill = false); // pens/brushes etc. + virtual void SetDrawnPen(const wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual + virtual void SetDrawnBrush(const wxBrush* brush, bool isFill = false); // pens/brushes etc. virtual void SetDrawnFont(wxFont* font); virtual void SetDrawnTextColour(const wxColour& colour); virtual void SetDrawnBackgroundColour(const wxColour& colour); diff --git a/contrib/samples/ogl/ogledit/doc.cpp b/contrib/samples/ogl/ogledit/doc.cpp index 9d23abf698..9133a0844d 100644 --- a/contrib/samples/ogl/ogledit/doc.cpp +++ b/contrib/samples/ogl/ogledit/doc.cpp @@ -233,8 +233,8 @@ bool DiagramCommand::Do(void) theShape->AssignNewIds(); theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString)); theShape->SetCentreResize(false); - theShape->SetPen(*wxBLACK_PEN); - theShape->SetBrush(*wxCYAN_BRUSH); + theShape->SetPen(wxBLACK_PEN); + theShape->SetBrush(wxCYAN_BRUSH); theShape->SetSize(60, 60); } diff --git a/contrib/samples/ogl/ogledit/doc.h b/contrib/samples/ogl/ogledit/doc.h index 912d81c15b..741d4c7062 100644 --- a/contrib/samples/ogl/ogledit/doc.h +++ b/contrib/samples/ogl/ogledit/doc.h @@ -154,7 +154,7 @@ class DiagramCommand: public wxCommand bool deleteShape; // Storage for property commands - wxBrush *shapeBrush; + const wxBrush *shapeBrush; wxPen *shapePen; wxString shapeLabel; public: diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 6ed61e7e0e..ab9c5a8334 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -684,7 +684,7 @@ bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), return false; } -void wxShape::SetPen(wxPen *the_pen) +void wxShape::SetPen(const wxPen *the_pen) { m_pen = the_pen; } diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index db117810e6..5fac9c84ad 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -361,12 +361,12 @@ void wxDrawnShape::DestroyClippingRect() m_metafiles[m_currentAngle].DestroyClippingRect(); } -void wxDrawnShape::SetDrawnPen(wxPen* pen, bool isOutline) +void wxDrawnShape::SetDrawnPen(const wxPen* pen, bool isOutline) { m_metafiles[m_currentAngle].SetPen(pen, isOutline); } -void wxDrawnShape::SetDrawnBrush(wxBrush* brush, bool isFill) +void wxDrawnShape::SetDrawnBrush(const wxBrush* brush, bool isFill) { m_metafiles[m_currentAngle].SetBrush(brush, isFill); } @@ -2417,9 +2417,9 @@ void wxPseudoMetaFile::DestroyClippingRect() m_ops.Append(theOp); } -void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline) +void wxPseudoMetaFile::SetPen(const wxPen* pen, bool isOutline) { - m_gdiObjects.Append(pen); + m_gdiObjects.Append(wx_const_cast(wxPen*, pen)); int n = m_gdiObjects.GetCount(); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1); @@ -2432,9 +2432,9 @@ void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline) } } -void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill) +void wxPseudoMetaFile::SetBrush(const wxBrush* brush, bool isFill) { - m_gdiObjects.Append(brush); + m_gdiObjects.Append(wx_const_cast(wxBrush*, brush)); int n = m_gdiObjects.GetCount(); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1); diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index f875a404b5..a5982157a0 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -836,7 +836,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p void wxLineShape::OnErase(wxDC& dc) { - wxPen *old_pen = m_pen; + const wxPen *old_pen = m_pen; const wxBrush *old_brush = m_brush; wxPen bg_pen = GetBackgroundPen(); wxBrush bg_brush = GetBackgroundBrush(); @@ -957,7 +957,7 @@ 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; + const wxPen *old_pen = m_pen; const wxBrush *old_brush = m_brush; wxPen dottedPen(*wxBLACK, 1, wxDOT); @@ -1741,7 +1741,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub wxLineShape *lineShape = (wxLineShape *)this; - wxPen *old_pen = lineShape->GetPen(); + const wxPen *old_pen = lineShape->GetPen(); const wxBrush *old_brush = lineShape->GetBrush(); wxPen dottedPen(*wxBLACK, 1, wxDOT); @@ -1789,7 +1789,7 @@ 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(); + const wxPen *old_pen = lineShape->GetPen(); const wxBrush *old_brush = lineShape->GetBrush(); wxPen dottedPen(*wxBLACK, 1, wxDOT); -- 2.45.2