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);
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; }
/*
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;
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; }
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);
// 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
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);
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);
}
bool deleteShape;
// Storage for property commands
- wxBrush *shapeBrush;
+ const wxBrush *shapeBrush;
wxPen *shapePen;
wxString shapeLabel;
public:
return false;
}
-void wxShape::SetPen(wxPen *the_pen)
+void wxShape::SetPen(const wxPen *the_pen)
{
m_pen = the_pen;
}
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);
}
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);
}
}
-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);
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();
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);
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);
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);