Sorry folks, a lot of changes to remedy GetFont, GetBrush etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -605,7 +605,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
region->SetText(s);
|
||||
dc.SetFont(region->GetFont());
|
||||
dc.SetFont(* region->GetFont());
|
||||
|
||||
region->GetSize(&w, &h);
|
||||
|
||||
@@ -919,10 +919,10 @@ void wxShape::OnDrawContents(wxDC& dc)
|
||||
GetBoundingBoxMin(&bound_x, &bound_y);
|
||||
if (m_regions.Number() < 1) return;
|
||||
|
||||
if (m_pen) dc.SetPen(m_pen);
|
||||
if (m_pen) dc.SetPen(* m_pen);
|
||||
|
||||
wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data();
|
||||
if (region->GetFont()) dc.SetFont(region->GetFont());
|
||||
if (region->GetFont()) dc.SetFont(* region->GetFont());
|
||||
|
||||
dc.SetTextForeground(* (region->GetActualColourObject()));
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
@@ -988,8 +988,8 @@ void wxShape::OnEraseContents(wxDC& dc)
|
||||
if (m_pen)
|
||||
penWidth = m_pen->GetWidth();
|
||||
|
||||
dc.SetPen(g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(g_oglWhiteBackgroundBrush);
|
||||
dc.SetPen(* g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(* g_oglWhiteBackgroundBrush);
|
||||
dc.DrawRectangle(WXROUND(topLeftX - penWidth), WXROUND(topLeftY - penWidth),
|
||||
WXROUND(maxX + penWidth*2.0 + 4.0), WXROUND(maxY + penWidth*2.0 + 4.0));
|
||||
}
|
||||
@@ -2535,8 +2535,8 @@ void wxShape::OnDrawControlPoints(wxDC& dc)
|
||||
if (!m_drawHandles)
|
||||
return;
|
||||
|
||||
dc.SetBrush(wxBLACK_BRUSH);
|
||||
dc.SetPen(wxBLACK_PEN);
|
||||
dc.SetBrush(* wxBLACK_BRUSH);
|
||||
dc.SetPen(* wxBLACK_PEN);
|
||||
|
||||
wxNode *node = m_controlPoints.First();
|
||||
while (node)
|
||||
|
@@ -503,8 +503,8 @@ void wxPolygonShape::OnDraw(wxDC& dc)
|
||||
if (m_shadowMode != SHADOW_NONE)
|
||||
{
|
||||
if (m_shadowBrush)
|
||||
dc.SetBrush(m_shadowBrush);
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetBrush(* m_shadowBrush);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
|
||||
dc.DrawPolygon(n, intPoints, WXROUND(m_xpos + m_shadowOffsetX), WXROUND(m_ypos + m_shadowOffsetY));
|
||||
}
|
||||
@@ -512,12 +512,12 @@ void wxPolygonShape::OnDraw(wxDC& dc)
|
||||
if (m_pen)
|
||||
{
|
||||
if (m_pen->GetWidth() == 0)
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
else
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetPen(* m_pen);
|
||||
}
|
||||
if (m_brush)
|
||||
dc.SetBrush(m_brush);
|
||||
dc.SetBrush(* m_brush);
|
||||
dc.DrawPolygon(n, intPoints, WXROUND(m_xpos), WXROUND(m_ypos));
|
||||
|
||||
delete[] intPoints;
|
||||
@@ -525,7 +525,7 @@ void wxPolygonShape::OnDraw(wxDC& dc)
|
||||
|
||||
void wxPolygonShape::OnDrawOutline(wxDC& dc, double x, double y, double w, double h)
|
||||
{
|
||||
dc.SetBrush(wxTRANSPARENT_BRUSH);
|
||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||
// Multiply all points by proportion of new size to old size
|
||||
double x_proportion = (double)(fabs(w/m_originalWidth));
|
||||
double y_proportion = (double)(fabs(h/m_originalHeight));
|
||||
@@ -879,8 +879,8 @@ void wxRectangleShape::OnDraw(wxDC& dc)
|
||||
if (m_shadowMode != SHADOW_NONE)
|
||||
{
|
||||
if (m_shadowBrush)
|
||||
dc.SetBrush(m_shadowBrush);
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetBrush(* m_shadowBrush);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
|
||||
if (m_cornerRadius != 0.0)
|
||||
dc.DrawRoundedRectangle(WXROUND(x1 + m_shadowOffsetX), WXROUND(y1 + m_shadowOffsetY),
|
||||
@@ -892,12 +892,12 @@ void wxRectangleShape::OnDraw(wxDC& dc)
|
||||
if (m_pen)
|
||||
{
|
||||
if (m_pen->GetWidth() == 0)
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
else
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetPen(* m_pen);
|
||||
}
|
||||
if (m_brush)
|
||||
dc.SetBrush(m_brush);
|
||||
dc.SetBrush(* m_brush);
|
||||
|
||||
if (m_cornerRadius != 0.0)
|
||||
dc.DrawRoundedRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height), m_cornerRadius);
|
||||
@@ -1049,8 +1049,8 @@ void wxEllipseShape::OnDraw(wxDC& dc)
|
||||
if (m_shadowMode != SHADOW_NONE)
|
||||
{
|
||||
if (m_shadowBrush)
|
||||
dc.SetBrush(m_shadowBrush);
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetBrush(* m_shadowBrush);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
dc.DrawEllipse((long) ((m_xpos - GetWidth()/2) + m_shadowOffsetX),
|
||||
(long) ((m_ypos - GetHeight()/2) + m_shadowOffsetY),
|
||||
(long) GetWidth(), (long) GetHeight());
|
||||
@@ -1059,12 +1059,12 @@ void wxEllipseShape::OnDraw(wxDC& dc)
|
||||
if (m_pen)
|
||||
{
|
||||
if (m_pen->GetWidth() == 0)
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
else
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetPen(* m_pen);
|
||||
}
|
||||
if (m_brush)
|
||||
dc.SetBrush(m_brush);
|
||||
dc.SetBrush(* m_brush);
|
||||
dc.DrawEllipse((long) (m_xpos - GetWidth()/2), (long) (m_ypos - GetHeight()/2), (long) GetWidth(), (long) GetHeight());
|
||||
}
|
||||
|
||||
|
@@ -101,8 +101,8 @@ void wxCompositeShape::OnDraw(wxDC& dc)
|
||||
if (m_shadowMode != SHADOW_NONE)
|
||||
{
|
||||
if (m_shadowBrush)
|
||||
dc.SetBrush(m_shadowBrush);
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetBrush(* m_shadowBrush);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
|
||||
if (m_cornerRadius != 0.0)
|
||||
dc.DrawRoundedRectangle(WXROUND(x1 + m_shadowOffsetX), WXROUND(y1 + m_shadowOffsetY),
|
||||
@@ -841,7 +841,7 @@ wxDivisionShape::~wxDivisionShape()
|
||||
|
||||
void wxDivisionShape::OnDraw(wxDC& dc)
|
||||
{
|
||||
dc.SetBrush(wxTRANSPARENT_BRUSH);
|
||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
double x1 = (double)(GetX() - (GetWidth()/2.0));
|
||||
@@ -856,18 +856,18 @@ void wxDivisionShape::OnDraw(wxDC& dc)
|
||||
|
||||
if (m_leftSide)
|
||||
{
|
||||
dc.SetPen(m_leftSidePen);
|
||||
dc.SetPen(* m_leftSidePen);
|
||||
dc.DrawLine(WXROUND(x1), WXROUND(y2), WXROUND(x1), WXROUND(y1));
|
||||
}
|
||||
if (m_topSide)
|
||||
{
|
||||
dc.SetPen(m_topSidePen);
|
||||
dc.SetPen(* m_topSidePen);
|
||||
dc.DrawLine(WXROUND(x1), WXROUND(y1), WXROUND(x2), WXROUND(y1));
|
||||
}
|
||||
|
||||
// For testing purposes, draw a rectangle so we know
|
||||
// how big the division is.
|
||||
// SetBrush(wxCYAN_BRUSH);
|
||||
// SetBrush(* wxCYAN_BRUSH);
|
||||
// wxRectangleShape::OnDraw(dc);
|
||||
}
|
||||
|
||||
|
@@ -81,7 +81,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
|
||||
double leftX = (double)(m_xpos - (m_width / 2.0));
|
||||
double rightX = (double)(m_xpos + (m_width / 2.0));
|
||||
|
||||
if (m_pen) dc.SetPen(m_pen);
|
||||
if (m_pen) dc.SetPen(* m_pen);
|
||||
|
||||
if (m_textColour) dc.SetTextForeground(* m_textColour);
|
||||
|
||||
@@ -108,7 +108,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
dc.SetFont(region->GetFont());
|
||||
dc.SetFont(* region->GetFont());
|
||||
dc.SetTextForeground(* region->GetActualColourObject());
|
||||
|
||||
double proportion =
|
||||
@@ -128,7 +128,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
|
||||
wxPen *regionPen = region->GetActualPen();
|
||||
if (regionPen)
|
||||
{
|
||||
dc.SetPen(regionPen);
|
||||
dc.SetPen(* regionPen);
|
||||
dc.DrawLine(WXROUND(leftX), WXROUND(y), WXROUND(rightX), WXROUND(y));
|
||||
}
|
||||
}
|
||||
|
@@ -431,7 +431,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
|
||||
if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex))
|
||||
{
|
||||
if (m_image->m_outlinePen)
|
||||
dc.SetPen(m_image->m_outlinePen);
|
||||
dc.SetPen(* m_image->m_outlinePen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -440,7 +440,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
|
||||
{
|
||||
wxPen *pen = (wxPen *)node->Data();
|
||||
if (pen)
|
||||
dc.SetPen(pen);
|
||||
dc.SetPen(* pen);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -456,14 +456,14 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
|
||||
{
|
||||
wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxSOLID);
|
||||
if (br)
|
||||
dc.SetBrush(br);
|
||||
dc.SetBrush(* br);
|
||||
}
|
||||
}
|
||||
else if (m_image->m_fillColours.Member((wxObject *)m_gdiIndex))
|
||||
{
|
||||
if (m_image->m_fillBrush)
|
||||
{
|
||||
dc.SetBrush(m_image->m_fillBrush);
|
||||
dc.SetBrush(* m_image->m_fillBrush);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -473,7 +473,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
|
||||
{
|
||||
wxBrush *brush = (wxBrush *)node->Data();
|
||||
if (brush)
|
||||
dc.SetBrush(brush);
|
||||
dc.SetBrush(* brush);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -485,7 +485,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
|
||||
{
|
||||
wxFont *font = (wxFont *)node->Data();
|
||||
if (font)
|
||||
dc.SetFont(font);
|
||||
dc.SetFont(* font);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1194,7 +1194,7 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
|
||||
// Draw an outline using the current operation.
|
||||
bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double h, double oldW, double oldH)
|
||||
{
|
||||
dc.SetBrush(wxTRANSPARENT_BRUSH);
|
||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||
|
||||
// Multiply all points by proportion of new size to old size
|
||||
double x_proportion = (double)(fabs(w/oldW));
|
||||
|
@@ -216,7 +216,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
region->SetText(s);
|
||||
dc.SetFont(region->GetFont());
|
||||
dc.SetFont(* region->GetFont());
|
||||
|
||||
region->GetSize(&w, &h);
|
||||
// Initialize the size if zero
|
||||
@@ -284,15 +284,15 @@ void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y
|
||||
// First, clear a rectangle for the text IF there is any
|
||||
if (region->GetFormattedText().Number() > 0)
|
||||
{
|
||||
dc.SetPen(g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(g_oglWhiteBackgroundBrush);
|
||||
dc.SetPen(* g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(* g_oglWhiteBackgroundBrush);
|
||||
|
||||
// Now draw the text
|
||||
if (region->GetFont()) dc.SetFont(region->GetFont());
|
||||
if (region->GetFont()) dc.SetFont(* region->GetFont());
|
||||
|
||||
dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h);
|
||||
|
||||
if (m_pen) dc.SetPen(m_pen);
|
||||
if (m_pen) dc.SetPen(* m_pen);
|
||||
dc.SetTextForeground(* region->GetActualColourObject());
|
||||
|
||||
#ifdef __WXMSW__
|
||||
@@ -320,8 +320,8 @@ void wxLineShape::EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double
|
||||
|
||||
if (region->GetFormattedText().Number() > 0)
|
||||
{
|
||||
dc.SetPen(g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(g_oglWhiteBackgroundBrush);
|
||||
dc.SetPen(* g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(* g_oglWhiteBackgroundBrush);
|
||||
|
||||
dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h);
|
||||
}
|
||||
@@ -727,8 +727,8 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
|
||||
points[2].x = (int) side2_x; points[2].y = (int) side2_y;
|
||||
points[3].x = (int) tip_x; points[3].y = (int) tip_y;
|
||||
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetBrush(m_brush);
|
||||
dc.SetPen(* m_pen);
|
||||
dc.SetBrush(* m_brush);
|
||||
dc.DrawPolygon(4, points);
|
||||
break;
|
||||
}
|
||||
@@ -748,11 +748,11 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
|
||||
double x1 = (double)(x - (diameter/2.0));
|
||||
double y1 = (double)(y - (diameter/2.0));
|
||||
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetPen(* m_pen);
|
||||
if (arrow->_GetType() == ARROW_HOLLOW_CIRCLE)
|
||||
dc.SetBrush(g_oglWhiteBackgroundBrush);
|
||||
dc.SetBrush(* g_oglWhiteBackgroundBrush);
|
||||
else
|
||||
dc.SetBrush(m_brush);
|
||||
dc.SetBrush(* m_brush);
|
||||
|
||||
dc.DrawEllipse((long) x1, (long) y1, (long) diameter, (long) diameter);
|
||||
break;
|
||||
@@ -854,7 +854,7 @@ void wxLineShape::OnErase(wxDC& dc)
|
||||
|
||||
double bound_x, bound_y;
|
||||
GetBoundingBoxMax(&bound_x, &bound_y);
|
||||
if (m_font) dc.SetFont(m_font);
|
||||
if (m_font) dc.SetFont(* m_font);
|
||||
|
||||
// Undraw text regions
|
||||
for (int i = 0; i < 3; i++)
|
||||
@@ -870,8 +870,8 @@ void wxLineShape::OnErase(wxDC& dc)
|
||||
}
|
||||
|
||||
// Undraw line
|
||||
dc.SetPen(g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(g_oglWhiteBackgroundBrush);
|
||||
dc.SetPen(* g_oglWhiteBackgroundPen);
|
||||
dc.SetBrush(* g_oglWhiteBackgroundBrush);
|
||||
|
||||
// Drawing over the line only seems to work if the line has a thickness
|
||||
// of 1.
|
||||
@@ -1177,9 +1177,9 @@ void wxLineShape::OnDraw(wxDC& dc)
|
||||
if (m_lineControlPoints)
|
||||
{
|
||||
if (m_pen)
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetPen(* m_pen);
|
||||
if (m_brush)
|
||||
dc.SetBrush(m_brush);
|
||||
dc.SetBrush(* m_brush);
|
||||
|
||||
int n = m_lineControlPoints->Number();
|
||||
wxPoint *points = new wxPoint[n];
|
||||
@@ -1211,7 +1211,7 @@ void wxLineShape::OnDraw(wxDC& dc)
|
||||
wxPen *solid_pen =
|
||||
wxThePenList->FindOrCreatePen(m_pen->GetColour(), 1, wxSOLID);
|
||||
if (solid_pen)
|
||||
dc.SetPen(solid_pen);
|
||||
dc.SetPen(* solid_pen);
|
||||
}
|
||||
DrawArrows(dc);
|
||||
}
|
||||
@@ -1813,7 +1813,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y,
|
||||
|
||||
if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM || lpt->m_type == CONTROL_POINT_ENDPOINT_TO)
|
||||
{
|
||||
m_canvas->SetCursor(g_oglBullseyeCursor);
|
||||
m_canvas->SetCursor(* g_oglBullseyeCursor);
|
||||
lpt->m_oldCursor = wxSTANDARD_CURSOR;
|
||||
}
|
||||
}
|
||||
@@ -1847,7 +1847,7 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in
|
||||
if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM)
|
||||
{
|
||||
if (lpt->m_oldCursor)
|
||||
m_canvas->SetCursor(lpt->m_oldCursor);
|
||||
m_canvas->SetCursor(* lpt->m_oldCursor);
|
||||
|
||||
// this->Erase(dc);
|
||||
|
||||
@@ -1861,7 +1861,7 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in
|
||||
if (lpt->m_type == CONTROL_POINT_ENDPOINT_TO)
|
||||
{
|
||||
if (lpt->m_oldCursor)
|
||||
m_canvas->SetCursor(lpt->m_oldCursor);
|
||||
m_canvas->SetCursor(* lpt->m_oldCursor);
|
||||
|
||||
// lpt->m_xpos = x; lpt->m_ypos = y;
|
||||
|
||||
@@ -2429,11 +2429,11 @@ void wxLabelShape::OnDraw(wxDC& dc)
|
||||
if (m_pen)
|
||||
{
|
||||
if (m_pen->GetWidth() == 0)
|
||||
dc.SetPen(g_oglTransparentPen);
|
||||
dc.SetPen(* g_oglTransparentPen);
|
||||
else
|
||||
dc.SetPen(m_pen);
|
||||
dc.SetPen(* m_pen);
|
||||
}
|
||||
dc.SetBrush(wxTRANSPARENT_BRUSH);
|
||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||
|
||||
if (m_cornerRadius > 0.0)
|
||||
dc.DrawRoundedRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height), m_cornerRadius);
|
||||
|
@@ -93,7 +93,7 @@ void wxDiagram::Redraw(wxDC& dc)
|
||||
if (m_shapeList)
|
||||
{
|
||||
if (GetCanvas())
|
||||
GetCanvas()->SetCursor(wxHOURGLASS_CURSOR);
|
||||
GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR);
|
||||
wxNode *current = m_shapeList->First();
|
||||
|
||||
while (current)
|
||||
@@ -105,7 +105,7 @@ void wxDiagram::Redraw(wxDC& dc)
|
||||
current = current->Next();
|
||||
}
|
||||
if (GetCanvas())
|
||||
GetCanvas()->SetCursor(wxSTANDARD_CURSOR);
|
||||
GetCanvas()->SetCursor(* wxSTANDARD_CURSOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user