-
-
-void RS_ActionDimRadial::commandEvent(RS_CommandEvent* e) {
- QString c = e->getCommand().toLower();
-
- if (checkCommand("help", c)) {
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
- + getAvailableCommands().join(", "));
- return;
- }
-
- // setting new text label:
- if (getStatus()==SetText) {
- setText(c);
- RS_DIALOGFACTORY->requestOptions(this, true, true);
- graphicView->enableCoordinateInput();
- setStatus(lastStatus);
- return;
- }
-
- // command: text
- if (checkCommand("text", c)) {
- lastStatus = (Status)getStatus();
- graphicView->disableCoordinateInput();
- setStatus(SetText);
- }
-
- // setting angle
- if (getStatus()==SetPos) {
- bool ok;
- double a = RS_Math::eval(c, &ok);
- if (ok==true) {
- pos.setPolar(1.0, RS_Math::deg2rad(a));
- pos += data.definitionPoint;
- trigger();
- reset();
- setStatus(SetEntity);
- } else {
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- }
- return;
- }
+void RS_ActionDimRadial::commandEvent(RS_CommandEvent * e)
+{
+ QString c = e->getCommand().toLower();
+
+ if (checkCommand("help", c))
+ {
+ RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ + getAvailableCommands().join(", "));
+ return;
+ }
+
+ // setting new text label:
+ if (getStatus() == SetText)
+ {
+ setText(c);
+ RS_DIALOGFACTORY->requestOptions(this, true, true);
+ graphicView->enableCoordinateInput();
+ setStatus(lastStatus);
+ return;
+ }
+
+ // command: text
+ if (checkCommand("text", c))
+ {
+ lastStatus = (Status)getStatus();
+ graphicView->disableCoordinateInput();
+ setStatus(SetText);
+ }
+
+ // setting angle
+ if (getStatus() == SetPos)
+ {
+ bool ok;
+ double a = RS_Math::eval(c, &ok);
+
+ if (ok == true)
+ {
+ pos.setPolar(1.0, RS_Math::deg2rad(a));
+ pos += data.definitionPoint;
+ trigger();
+ reset();
+ setStatus(SetEntity);
+ }
+ else
+ RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+
+ return;
+ }