- if (drawing->toolAction)
- {
- delete drawing->toolAction;
- drawing->toolAction = NULL;
- Object::ignoreClicks = false;
- }
-
- 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;
+ Global::toolState = TSNone;
+
+ 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 (triangulateAct->isChecked())
+ Global::tool = TTTriangulate;
+ else
+ Global::tool = TTNone;