]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes after stock gdi changes within core library
authorPaul Cornett <paulcor@bullseye.com>
Tue, 18 Apr 2006 22:26:26 +0000 (22:26 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 18 Apr 2006 22:26:26 +0000 (22:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/include/wx/ogl/basic.h
contrib/include/wx/ogl/drawn.h
contrib/samples/ogl/ogledit/doc.cpp
contrib/samples/ogl/ogledit/doc.h
contrib/src/ogl/basic.cpp
contrib/src/ogl/drawn.cpp
contrib/src/ogl/lines.cpp

index 3c3895b61440ef0b997db3d6ec77c16245a9523d..0360f19c9ead5523fbd288aef6f38b0efc8bb8c8 100644 (file)
@@ -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;
index 7b1d0f944993207b29cf4fd8304cfc882279383d..f90f541089d7e6c4aa943939aee91f0c298d9aed 100644 (file)
@@ -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);
index 9d23abf698cc494be236263b89961baffda4d8ea..9133a0844dce4d7a7f20200a01bd851ddbec9c05 100644 (file)
@@ -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);
       }
index 912d81c15b914e452f94eccc2b24d245a03d90e7..741d4c70621b3c882be3d65649cf6bd05318e3fc 100644 (file)
@@ -154,7 +154,7 @@ class DiagramCommand: public wxCommand
   bool deleteShape;
 
   // Storage for property commands
-  wxBrush *shapeBrush;
+  const wxBrush *shapeBrush;
   wxPen *shapePen;
   wxString shapeLabel;
  public:
index 6ed61e7e0ee68d3d58f4d952cead1d276029ea32..ab9c5a8334ac55abc3d34afc523c78a941b8ab72 100644 (file)
@@ -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;
 }
index db117810e610d6924db88a559add243c6989f125..5fac9c84adfb7f249201e919e8f55300c252ddc1 100644 (file)
@@ -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);
index f875a404b55b08ab0854b635db4a5317e4e1a70a..a5982157a087c9411f47b5ad1a04dc478609f768 100644 (file)
@@ -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);