- QPainter p(this);
-//hm, causes lockup
-// p.setRenderHint(QPainter::Antialiasing);
-//Doesn't do crap!
-//dc.SetBackground(*wxWHITE_BRUSH);
-
-// Due to the screwiness of wxWidgets coord system, the origin is ALWAYS
-// the upper left corner--regardless of axis orientation, etc...
-// int width, height;
-// dc.GetSize(&width, &height);
- QSize winSize = size();
-
-// dc.SetDeviceOrigin(-offsetX, height - (-offsetY));
-// dc.SetAxisOrientation(true, true);
- p.translate(QPoint(-offsetX, winSize.height() - (-offsetY)));
- p.scale(1.0, -1.0);
-
-// Scrolling can be done by using OffsetViewportOrgEx
-// Scaling can be done by adjusting SetWindowExtEx (it's denominator of txform)
-// you'd use: % = ViewportExt / WindowExt
-// But it makes the window look like crap: fuggetuboutit.
-// Instead, we have to scale EVERYTHING by hand. Crap!
-// It's not *that* bad, but not as convenient either...
-
-// dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0x00, 0x00, 0xFF), 1, wxDOT)));
-//// dc.DrawLine(0, 0, 10, 10);
- p.setPen(QPen(Qt::blue, 1.0, Qt::DotLine));
-
- // Draw coordinate axes
-
-// dc.CrossHair(0, 0);
- p.drawLine(0, -16384, 0, 16384);
- p.drawLine(-16384, 0, 16384, 0);
-
- // Draw points
-
- for(int i=0; i<pts.GetNumPoints(); i++)
- {
- if (i == ptHighlight)
- {
-// dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0xFF, 0x00, 0x00), 1, wxSOLID)));
-//// SelectObject(hdc, hRedPen1);
- p.setPen(QPen(Qt::red, 1.0, Qt::SolidLine));
-
- if (pts.GetOnCurve(i))
- {
- DrawSquareDotN(p, pts.GetX(i), pts.GetY(i), 7);
- DrawSquareDotN(p, pts.GetX(i), pts.GetY(i), 9);
- }
- else
- {
- DrawRoundDotN(p, pts.GetX(i), pts.GetY(i), 7);
- DrawRoundDotN(p, pts.GetX(i), pts.GetY(i), 9);
- }
- }
- else if ((i == ptHighlight || i == ptNextHighlight) && tool == TOOLAddPt)
- {
-// dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0x00, 0xAF, 0x00), 1, wxSOLID)));
-//// SelectObject(hdc, hGreenPen1);
- p.setPen(QPen(Qt::green, 1.0, Qt::SolidLine));