- drawing->SetToolActive(addLineAct->isChecked() ? new DrawLineAction() : NULL);
- drawing->SetToolActive(addCircleAct->isChecked() ? new DrawCircleAction() : NULL);
- drawing->SetToolActive(addArcAct->isChecked() ? new DrawArcAction() : NULL);
- drawing->SetToolActive(addDimensionAct->isChecked() ? new DrawDimensionAction() : NULL);
- drawing->SetToolActive(addSplineAct->isChecked() ? new DrawSplineAction() : NULL);
- drawing->SetToolActive(mirrorAct->isChecked() ? new MirrorAction() : NULL);
- drawing->SetToolActive(rotateAct->isChecked() ? new RotateAction() : NULL);
- drawing->SetToolActive(trimAct->isChecked() ? new TrimAction() : NULL);
- drawing->SetToolActive(triangulateAct->isChecked() ? new TriangulateAction() : NULL);
-
- if (drawing->toolAction)
- Object::ignoreClicks = true;
-
+void ApplicationWindow::SetInternalToolStates(void)
+{
+ // We can be sure that if we've come here, then either an active tool is
+ // being deactivated, or a new tool is being activated. In either case,
+ // the tool state needs to be reset. Also, we reset the crosshair
+ // suppression flag.
+ Global::toolState = TSNone;
+ Global::toolSuppressCrosshair = false;
+
+ if (addLineAct->isChecked())
+ Global::tool = TTLine;
+ else if (addCircleAct->isChecked())
+ Global::tool = TTCircle;
+ else if (addArcAct->isChecked())
+ Global::tool = TTArc;
+ else if (addDimensionAct->isChecked())
+ Global::tool = TTDimension;
+ else if (addSplineAct->isChecked())
+ Global::tool = TTSpline;
+ else if (addPolygonAct->isChecked())
+ Global::tool = TTPolygon;
+ else if (deleteAct->isChecked())
+ Global::tool = TTDelete;
+ else if (mirrorAct->isChecked())
+ Global::tool = TTMirror;
+ else if (rotateAct->isChecked())
+ Global::tool = TTRotate;
+ else if (trimAct->isChecked())
+ Global::tool = TTTrim;
+ else if (parallelAct->isChecked())
+ Global::tool = TTParallel;
+ else if (triangulateAct->isChecked())
+ Global::tool = TTTriangulate;
+ else
+ Global::tool = TTNone;
+
+ cw->SetToolPrompt();//cw->cmdline);