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
This commit is contained in:
Paul Cornett
2006-04-18 22:26:26 +00:00
parent e56f4f9e90
commit c0989defa0
7 changed files with 23 additions and 23 deletions

View File

@@ -300,7 +300,7 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler
inline void SetId(long i) { m_id = i; } inline void SetId(long i) { m_id = i; }
inline long GetId() const { return m_id; } inline long GetId() const { return m_id; }
void SetPen(wxPen *pen); void SetPen(const wxPen *pen);
void SetBrush(const wxBrush *brush); void SetBrush(const wxBrush *brush);
virtual void Show(bool show); virtual void Show(bool show);
@@ -329,7 +329,7 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler
void AddText(const wxString& string); 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; } inline const wxBrush *GetBrush() const { return m_brush; }
/* /*
@@ -527,7 +527,7 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler
wxShapeEvtHandler* m_eventHandler; wxShapeEvtHandler* m_eventHandler;
bool m_formatted; bool m_formatted;
double m_xpos, m_ypos; double m_xpos, m_ypos;
wxPen* m_pen; const wxPen* m_pen;
const wxBrush* m_brush; const wxBrush* m_brush;
wxFont* m_font; wxFont* m_font;
wxColour m_textColour; wxColour m_textColour;

View File

@@ -61,7 +61,7 @@ class WXDLLIMPEXP_OGL wxPseudoMetaFile: public wxObject
inline const wxBrush* GetFillBrush() const { return m_fillBrush; } inline const wxBrush* GetFillBrush() const { return m_fillBrush; }
inline void SetOutlinePen(wxPen* pen) { m_outlinePen = pen; } 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 void SetOutlineOp(int op) { m_outlineOp = op; }
inline int GetOutlineOp() const { return m_outlineOp; } inline int GetOutlineOp() const { return m_outlineOp; }
@@ -96,8 +96,8 @@ public:
virtual void SetClippingRect(const wxRect& rect); virtual void SetClippingRect(const wxRect& rect);
virtual void DestroyClippingRect(); virtual void DestroyClippingRect();
virtual void SetPen(wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual virtual void SetPen(const 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 SetBrush(const wxBrush* brush, bool isFill = false); // pens/brushes etc.
virtual void SetFont(wxFont* font); virtual void SetFont(wxFont* font);
virtual void SetTextColour(const wxColour& colour); virtual void SetTextColour(const wxColour& colour);
virtual void SetBackgroundColour(const wxColour& colour); virtual void SetBackgroundColour(const wxColour& colour);
@@ -113,7 +113,7 @@ public:
// Pen/brush specifying outline/fill colours // Pen/brush specifying outline/fill colours
// to override operations. // to override operations.
wxPen* m_outlinePen; const wxPen* m_outlinePen;
const wxBrush* m_fillBrush; const wxBrush* m_fillBrush;
wxList m_outlineColours; // List of the GDI operations that comprise the outline wxList m_outlineColours; // List of the GDI operations that comprise the outline
wxList m_fillColours; // List of the GDI operations that fill the shape 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 SetClippingRect(const wxRect& rect);
virtual void DestroyClippingRect(); virtual void DestroyClippingRect();
virtual void SetDrawnPen(wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual virtual void SetDrawnPen(const 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 SetDrawnBrush(const wxBrush* brush, bool isFill = false); // pens/brushes etc.
virtual void SetDrawnFont(wxFont* font); virtual void SetDrawnFont(wxFont* font);
virtual void SetDrawnTextColour(const wxColour& colour); virtual void SetDrawnTextColour(const wxColour& colour);
virtual void SetDrawnBackgroundColour(const wxColour& colour); virtual void SetDrawnBackgroundColour(const wxColour& colour);

View File

@@ -233,8 +233,8 @@ bool DiagramCommand::Do(void)
theShape->AssignNewIds(); theShape->AssignNewIds();
theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString)); theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString));
theShape->SetCentreResize(false); theShape->SetCentreResize(false);
theShape->SetPen(*wxBLACK_PEN); theShape->SetPen(wxBLACK_PEN);
theShape->SetBrush(*wxCYAN_BRUSH); theShape->SetBrush(wxCYAN_BRUSH);
theShape->SetSize(60, 60); theShape->SetSize(60, 60);
} }

View File

@@ -154,7 +154,7 @@ class DiagramCommand: public wxCommand
bool deleteShape; bool deleteShape;
// Storage for property commands // Storage for property commands
wxBrush *shapeBrush; const wxBrush *shapeBrush;
wxPen *shapePen; wxPen *shapePen;
wxString shapeLabel; wxString shapeLabel;
public: public:

View File

@@ -684,7 +684,7 @@ bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1),
return false; return false;
} }
void wxShape::SetPen(wxPen *the_pen) void wxShape::SetPen(const wxPen *the_pen)
{ {
m_pen = the_pen; m_pen = the_pen;
} }

View File

@@ -361,12 +361,12 @@ void wxDrawnShape::DestroyClippingRect()
m_metafiles[m_currentAngle].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); 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_metafiles[m_currentAngle].SetBrush(brush, isFill);
} }
@@ -2417,9 +2417,9 @@ void wxPseudoMetaFile::DestroyClippingRect()
m_ops.Append(theOp); 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(); int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1); 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(); int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1);

View File

@@ -836,7 +836,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
void wxLineShape::OnErase(wxDC& dc) void wxLineShape::OnErase(wxDC& dc)
{ {
wxPen *old_pen = m_pen; const wxPen *old_pen = m_pen;
const wxBrush *old_brush = m_brush; const wxBrush *old_brush = m_brush;
wxPen bg_pen = GetBackgroundPen(); wxPen bg_pen = GetBackgroundPen();
wxBrush bg_brush = GetBackgroundBrush(); 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)) 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; const wxBrush *old_brush = m_brush;
wxPen dottedPen(*wxBLACK, 1, wxDOT); wxPen dottedPen(*wxBLACK, 1, wxDOT);
@@ -1741,7 +1741,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub
wxLineShape *lineShape = (wxLineShape *)this; wxLineShape *lineShape = (wxLineShape *)this;
wxPen *old_pen = lineShape->GetPen(); const wxPen *old_pen = lineShape->GetPen();
const wxBrush *old_brush = lineShape->GetBrush(); const wxBrush *old_brush = lineShape->GetBrush();
wxPen dottedPen(*wxBLACK, 1, wxDOT); 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_xpos = x; lpt->m_ypos = y;
lpt->m_point->x = x; lpt->m_point->y = 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(); const wxBrush *old_brush = lineShape->GetBrush();
wxPen dottedPen(*wxBLACK, 1, wxDOT); wxPen dottedPen(*wxBLACK, 1, wxDOT);