printing = false;
deleteMode = false;
factor = Vector(1.0, 1.0);
- offsetX = 0;
- offsetY = 0;
+ offsetX = offsetY = 0;
previousFactor = Vector(1.0, 1.0);
- previousOffsetX = 0;
- previousOffsetY = 0;
+ previousOffsetX = previousOffsetY = 0;
container = NULL;
- eventHandler = new EventHandler(this);
+ eventHandler = new EventHandler();
gridColor = Qt::gray;
metaGridColor = Color(64, 64, 64);
grid = new Grid(this);
draftMode = false;
painter = NULL;
- borderLeft = 0;
- borderTop = 0;
- borderRight = 0;
- borderBottom = 0;
+ borderLeft = borderTop = borderRight = borderBottom = 0;
relativeZero = Vector(false);
relativeZeroLocked = false;
*/
ActionInterface * GraphicView::getDefaultAction()
{
- if (eventHandler != NULL)
- return eventHandler->getDefaultAction();
- else
- return NULL;
+ if (eventHandler)
+ return eventHandler->GetDefaultAction();
+
+ return NULL;
}
/**
void GraphicView::setDefaultAction(ActionInterface * action)
{
if (eventHandler)
- eventHandler->setDefaultAction(action);
+ eventHandler->SetDefaultAction(action);
}
/**
ActionInterface * GraphicView::getCurrentAction()
{
if (eventHandler)
- return eventHandler->getCurrentAction();
+ return eventHandler->GetCurrentAction();
else
return NULL;
}
DEBUG->print("GraphicView::setCurrentAction");
if (eventHandler)
- eventHandler->setCurrentAction(action);
+ eventHandler->SetCurrentAction(action);
DEBUG->print("GraphicView::setCurrentAction: OK");
}
void GraphicView::killSelectActions()
{
if (eventHandler)
- eventHandler->killSelectActions();
+ eventHandler->KillSelectActions();
}
/**
*/
void GraphicView::killAllActions()
{
+ //KillAll does nothing...
if (eventHandler)
- eventHandler->killAllActions();
+ eventHandler->KillAllActions();
}
/**
*/
void GraphicView::back()
{
- if (eventHandler && eventHandler->hasAction())
- eventHandler->back();
+ if (eventHandler && eventHandler->HasAction())
+ eventHandler->Back();
else if (DIALOGFACTORY)
DIALOGFACTORY->requestPreviousMenu();
}
*/
void GraphicView::enter()
{
- if (eventHandler && eventHandler->hasAction())
- eventHandler->enter();
+ if (eventHandler && eventHandler->HasAction())
+ eventHandler->Enter();
}
/**
void GraphicView::mousePressEvent(QMouseEvent * e)
{
if (eventHandler)
- eventHandler->mousePressEvent(e);
+ eventHandler->MousePressEvent(e);
}
/**
if (!eventHandler)
return;
- if (e->button() != Qt::RightButton || eventHandler->hasAction())
+ if (e->button() != Qt::RightButton || eventHandler->HasAction())
{
- eventHandler->mouseReleaseEvent(e);
+ eventHandler->MouseReleaseEvent(e);
}
else
{
{
DEBUG->print("GraphicView::mouseMoveEvent begin");
- Drawing * graphic = NULL;
+ Drawing * drawing = NULL;
if (container->rtti() == RS2::EntityGraphic)
- graphic = (Drawing *)container;
+ drawing = (Drawing *)container;
DEBUG->print("GraphicView::mouseMoveEvent 001");
DEBUG->print("GraphicView::mouseMoveEvent 002");
if (eventHandler)
- eventHandler->mouseMoveEvent(e);
+ eventHandler->MouseMoveEvent(e);
DEBUG->print("GraphicView::mouseMoveEvent 003");
- if (!eventHandler || !eventHandler->hasAction() && graphic)
+ if (!eventHandler || !eventHandler->HasAction() && drawing)
{
- Vector mouse = toGraph(Vector(mx, my));
- Vector relMouse = mouse - getRelativeZero();
-
if (DIALOGFACTORY)
+ {
+ Vector mouse = toGraph(Vector(mx, my));
+ Vector relMouse = mouse - getRelativeZero();
DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse);
+ }
}
DEBUG->print("GraphicView::mouseMoveEvent end");
void GraphicView::mouseLeaveEvent()
{
if (eventHandler)
- eventHandler->mouseLeaveEvent();
+ eventHandler->MouseLeaveEvent();
}
/**
void GraphicView::mouseEnterEvent()
{
if (eventHandler)
- eventHandler->mouseEnterEvent();
+ eventHandler->MouseEnterEvent();
}
/**
void GraphicView::keyPressEvent(QKeyEvent * e)
{
if (eventHandler)
- eventHandler->keyPressEvent(e);
+ eventHandler->KeyPressEvent(e);
}
/**
void GraphicView::keyReleaseEvent(QKeyEvent * e)
{
if (eventHandler)
- eventHandler->keyReleaseEvent(e);
+ eventHandler->KeyReleaseEvent(e);
}
/**
void GraphicView::commandEvent(CommandEvent * e)
{
if (eventHandler)
- eventHandler->commandEvent(e);
+ eventHandler->HandleCommandEvent(this, e);
}
/**
void GraphicView::enableCoordinateInput()
{
if (eventHandler)
- eventHandler->enableCoordinateInput();
+ eventHandler->EnableCoordinateInput();
}
/**
void GraphicView::disableCoordinateInput()
{
if (eventHandler)
- eventHandler->disableCoordinateInput();
+ eventHandler->DisableCoordinateInput();
}
/**
return;
Vector c = center;
+
if (c.valid == false)
c = toGraph(Vector(getWidth() / 2, getHeight() / 2));
{
defaultSnapMode = sm;
+// Don't need this shiaut anymore
+#if 0
if (eventHandler)
eventHandler->setSnapMode(sm);
//us up, hm notwithstanding. [and it does. :-)]
//hm.
snapper.setSnapMode(sm);
+#endif
}
/**
{
defaultSnapRes = sr;
+// Don't need this shiaut anymore
+#if 0
if (eventHandler != NULL)
eventHandler->setSnapRestriction(sr);
+#endif
}
/**
return CatchEntity(Vector(toGraphX(e->x()), toGraphY(e->y())), level);
}
+/**
+ * @return Pointer to the entity which was the key entity for the last
+ * successful snapping action. If the snap mode is "end point" the key entity
+ * is the entity whose end point was caught. If the snap mode didn't require an
+ * entity (e.g. free, grid) this method will return NULL.
+ */
+Entity * GraphicView::GetSnapperEntity()
+{
+ return snapEntity;
+}
+
/**
* Snap to a coordinate in the drawing using the current snap mode.
*
finished = true;
}
-/**
- * @return Pointer to the entity which was the key entity for the last
- * successful snapping action. If the snap mode is "end point" the key entity
- * is the entity whose end point was caught. If the snap mode didn't require an
- * entity (e.g. free, grid) this method will return NULL.
- */
-Entity * Snapper::getKeyEntity()
-{
- return keyEntity;
-}
-
/** Sets a new snap mode. */
void Snapper::setSnapMode(RS2::SnapMode snapMode)
{