X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f97c985452b20a8c2f0bbfb1d0275298bf09fb45..2356708db31b737c6eae53c2316b642aa5a2e68d:/utils/ogl/src/lines.cpp?ds=sidebyside diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp index d03b2f401a..a62cffbfa3 100644 --- a/utils/ogl/src/lines.cpp +++ b/utils/ogl/src/lines.cpp @@ -11,6 +11,7 @@ #ifdef __GNUG__ #pragma implementation "lines.h" +#pragma implementation "linesp.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -24,9 +25,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include @@ -217,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 @@ -285,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((double)(xp - w/2.0), (double)(yp - h/2.0), (double)w, (double)h); + 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__ @@ -321,10 +320,10 @@ 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((double)(xp - w/2.0), (double)(yp - h/2.0), (double)w, (double)h); + dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h); } } @@ -723,13 +722,13 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p &side1_x, &side1_y, &side2_x, &side2_y); wxPoint points[4]; - points[0].x = tip_x; points[0].y = tip_y; - points[1].x = side1_x; points[1].y = side1_y; - points[2].x = side2_x; points[2].y = side2_y; - points[3].x = tip_x; points[3].y = tip_y; + points[0].x = (int) tip_x; points[0].y = (int) tip_y; + points[1].x = (int) side1_x; points[1].y = (int) side1_y; + 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; } @@ -749,13 +748,13 @@ 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(x1, y1, diameter, diameter); + dc.DrawEllipse((long) x1, (long) y1, (long) diameter, (long) diameter); break; } case ARROW_SINGLE_OBLIQUE: @@ -832,8 +831,8 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p arrow->GetMetaFile()->GetBounds(&minX, &minY, &maxX, &maxY); // Make erasing rectangle slightly bigger or you get droppings. int extraPixels = 4; - dc.DrawRectangle((double)(deltaX + x + minX - (extraPixels/2.0)), (double)(deltaY + y + minY - (extraPixels/2.0)), - (double)(maxX - minX + extraPixels), (double)(maxY - minY + extraPixels)); + dc.DrawRectangle((long)(deltaX + x + minX - (extraPixels/2.0)), (long)(deltaY + y + minY - (extraPixels/2.0)), + (long)(maxX - minX + extraPixels), (long)(maxY - minY + extraPixels)); } else arrow->GetMetaFile()->Draw(dc, x+deltaX, y+deltaY); @@ -855,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++) @@ -871,15 +870,15 @@ 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. if (old_pen && (old_pen->GetWidth() > 1)) { - dc.DrawRectangle((double)(m_xpos - (bound_x/2.0) - 2.0), (double)(m_ypos - (bound_y/2.0) - 2.0), - (double)(bound_x+4.0), (double)(bound_y+4.0)); + dc.DrawRectangle((long)(m_xpos - (bound_x/2.0) - 2.0), (long)(m_ypos - (bound_y/2.0) - 2.0), + (long)(bound_x+4.0), (long)(bound_y+4.0)); } else { @@ -1178,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]; @@ -1212,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); } @@ -1424,7 +1423,7 @@ void wxLineShape::WriteAttributes(wxExpr *clause) head_list->Append(new wxExpr((long)head->GetArrowEnd())); head_list->Append(new wxExpr(head->GetXOffset())); head_list->Append(new wxExpr(head->GetArrowSize())); - head_list->Append(new wxExpr(wxExprString, (head->GetName() ? head->GetName() : ""))); + head_list->Append(new wxExpr(wxExprString, head->GetName())); head_list->Append(new wxExpr(head->GetId())); // New members of wxArrowHead @@ -1814,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; } } @@ -1848,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); @@ -1862,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; @@ -2430,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);