X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Frs_actiondrawpoint.cpp;h=820863903028762de03d75cfbb1f82d7c72e44d6;hb=27d4a138d23453e93a833e9347444b828a971cb4;hp=79e599443081e9789ba892004f71e7a6cd45861d;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/actions/rs_actiondrawpoint.cpp b/src/actions/rs_actiondrawpoint.cpp index 79e5994..8208639 100644 --- a/src/actions/rs_actiondrawpoint.cpp +++ b/src/actions/rs_actiondrawpoint.cpp @@ -14,11 +14,12 @@ #include "rs_actiondrawpoint.h" -#include "rs_snapper.h" -#include "rs_point.h" +#include "rs_commandevent.h" +#include "rs_dialogfactory.h" +#include "graphicview.h" +#include "rs_preview.h" -RS_ActionDrawPoint::RS_ActionDrawPoint(RS_EntityContainer & container, - RS_GraphicView & graphicView): +RS_ActionDrawPoint::RS_ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Points", container, graphicView) { } @@ -27,16 +28,6 @@ RS_ActionDrawPoint::~RS_ActionDrawPoint() { } -QAction * RS_ActionDrawPoint::createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/) -{ - QAction * action = new QAction(tr("&Points") + QString("\tpo"), 0); -// QAction* action = new QAction(tr("Points"), tr("&Points"), -// QKeySequence(), NULL); - action->setStatusTip(tr("Draw Points")); - - return action; -} - void RS_ActionDrawPoint::trigger() { if (pt.valid) @@ -61,29 +52,29 @@ void RS_ActionDrawPoint::trigger() void RS_ActionDrawPoint::mouseMoveEvent(QMouseEvent * e) { - snapPoint(e); + snapPoint(e); } void RS_ActionDrawPoint::mouseReleaseEvent(QMouseEvent * e) { - if (RS2::qtToRsButtonState(e->button()) == RS2::LeftButton) + if (e->button() == Qt::LeftButton) { - RS_CoordinateEvent ce(snapPoint(e)); + Vector ce(snapPoint(e)); coordinateEvent(&ce); } - else if (RS2::qtToRsButtonState(e->button()) == RS2::RightButton) + else if (e->button() == Qt::RightButton) { deleteSnapper(); init(getStatus() - 1); } } -void RS_ActionDrawPoint::coordinateEvent(RS_CoordinateEvent * e) +void RS_ActionDrawPoint::coordinateEvent(Vector * e) { if (e == NULL) return; - Vector mouse = e->getCoordinate(); + Vector mouse = *e; pt = mouse; trigger(); @@ -118,6 +109,7 @@ void RS_ActionDrawPoint::updateMouseButtonHints() case 0: RS_DIALOGFACTORY->updateMouseWidget(tr("Specify location"), tr("Cancel")); break; + default: RS_DIALOGFACTORY->updateMouseWidget("", ""); break; @@ -125,8 +117,9 @@ void RS_ActionDrawPoint::updateMouseButtonHints() } } -void RS_ActionDrawPoint::updateMouseCursor() { - graphicView->setMouseCursor(RS2::CadCursor); +void RS_ActionDrawPoint::updateMouseCursor() +{ + graphicView->setMouseCursor(RS2::CadCursor); } void RS_ActionDrawPoint::updateToolBar() @@ -139,3 +132,4 @@ void RS_ActionDrawPoint::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarPoints); } } +