X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.cpp;h=23c1d49100ad95f26a55aeb7e1a441a1a8875d0b;hb=d549bfdc8c872b966b9d787c00e5e8027366093c;hp=1c095f4a73b41a3a5b070e880c81f4cb8372c04e;hpb=ef811c836c00cc94ce1eaea5c2e77e5278298b18;p=architektonas diff --git a/src/drawingview.cpp b/src/drawingview.cpp index 1c095f4..23c1d49 100644 --- a/src/drawingview.cpp +++ b/src/drawingview.cpp @@ -51,7 +51,7 @@ DrawingView::DrawingView(QWidget * parent/*= NULL*/): QWidget(parent), gridSpacing(12.0), collided(false), rotateTool(false), rx(150.0), ry(150.0), scrollDrag(false), addLineTool(false), addCircleTool(false), addDimensionTool(false), - selectionInProgress(false), +// selectionInProgress(false), toolAction(NULL) { document.isTopLevelContainer = true; @@ -284,13 +284,13 @@ void DrawingView::paintEvent(QPaintEvent * /*event*/) if (toolAction) toolAction->Draw(&painter); - if (selectionInProgress) + if (Object::selectionInProgress) { // painter.SetPen(QPen(Qt::green, 1.0, Qt::SolidLine)); painter.SetPen(QPen(QColor(255, 127, 0, 255))); // painter.SetBrush(QBrush(Qt::NoBrush)); painter.SetBrush(QBrush(QColor(255, 127, 0, 100))); - painter.DrawRect(selection); + painter.DrawRect(Object::selection); } } @@ -311,9 +311,9 @@ void DrawingView::mousePressEvent(QMouseEvent * event) // Didn't hit any object and not using a tool, so do a selection rectangle if (!(collided || toolAction)) { - selectionInProgress = true; - selection.setTopLeft(QPointF(point.x, point.y)); - selection.setBottomRight(QPointF(point.x, point.y)); + Object::selectionInProgress = true; + Object::selection.setTopLeft(QPointF(point.x, point.y)); + Object::selection.setBottomRight(QPointF(point.x, point.y)); } } else if (event->button() == Qt::MiddleButton) @@ -329,7 +329,7 @@ void DrawingView::mousePressEvent(QMouseEvent * event) void DrawingView::mouseMoveEvent(QMouseEvent * event) { Vector point = Painter::QtToCartesianCoords(Vector(event->x(), event->y())); - selection.setBottomRight(QPointF(point.x, point.y)); + Object::selection.setBottomRight(QPointF(point.x, point.y)); if (event->buttons() & Qt::MiddleButton) { @@ -373,7 +373,7 @@ void DrawingView::mouseMoveEvent(QMouseEvent * event) //changed... document.PointerMoved(point); - if (document.NeedsUpdate() || selectionInProgress) + if (document.NeedsUpdate() || Object::selectionInProgress) update(); if (toolAction) @@ -400,10 +400,10 @@ void DrawingView::mouseReleaseEvent(QMouseEvent * event) if (toolAction) toolAction->MouseReleased(); - if (selectionInProgress) + if (Object::selectionInProgress) { // Select all the stuff inside of selection - selectionInProgress = false; + Object::selectionInProgress = false; } } else if (event->button() == Qt::MiddleButton)