3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/22/2010 Added this text. :-)
15 #include "actioneditcopy.h"
17 #include "rs_dialogfactory.h"
18 #include "rs_modification.h"
23 * @param undo true for undo and false for redo.
25 ActionEditCopy::ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView):
26 ActionInterface("Edit Copy", container, graphicView)
31 ActionEditCopy::~ActionEditCopy()
35 void ActionEditCopy::init(int status)
37 ActionInterface::init(status);
40 void ActionEditCopy::trigger()
44 RS_Modification m(*container, graphicView);
45 m.copy(referencePoint, !copy);
48 graphicView->killSelectActions();
49 RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
52 void ActionEditCopy::mouseMoveEvent(QMouseEvent * e)
57 void ActionEditCopy::mouseReleaseEvent(QMouseEvent * e)
59 if (e->button() == Qt::LeftButton)
61 Vector ce(snapPoint(e));
64 else if (e->button() == Qt::RightButton)
67 init(getStatus() - 1);
71 void ActionEditCopy::coordinateEvent(Vector * e)
80 void ActionEditCopy::updateMouseButtonHints()
84 case SetReferencePoint:
85 RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"),
90 RS_DIALOGFACTORY->updateMouseWidget("", "");
95 void ActionEditCopy::updateMouseCursor()
97 graphicView->setMouseCursor(RS2::CadCursor);
100 void ActionEditCopy::updateToolBar()
103 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
105 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);