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 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/22/2010 Added this text. :-)
17 #include "actioneditcopy.h"
19 #include "dialogfactory.h"
20 #include "modification.h"
25 * @param undo true for undo and false for redo.
27 ActionEditCopy::ActionEditCopy(bool copy, EntityContainer & container, GraphicView & graphicView):
28 ActionInterface("Edit Copy", container, graphicView)
33 ActionEditCopy::~ActionEditCopy()
37 void ActionEditCopy::init(int status)
39 ActionInterface::init(status);
42 void ActionEditCopy::trigger()
46 Modification m(*container, graphicView);
47 m.copy(referencePoint, !copy);
50 graphicView->killSelectActions();
51 DIALOGFACTORY->updateSelectionWidget(container->countSelected());
54 void ActionEditCopy::mouseMoveEvent(QMouseEvent * e)
59 void ActionEditCopy::mouseReleaseEvent(QMouseEvent * e)
61 if (e->button() == Qt::LeftButton)
63 Vector ce(snapPoint(e));
66 else if (e->button() == Qt::RightButton)
69 init(getStatus() - 1);
73 void ActionEditCopy::coordinateEvent(Vector * e)
82 void ActionEditCopy::updateMouseButtonHints()
86 case SetReferencePoint:
87 DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"),
92 DIALOGFACTORY->updateMouseWidget("", "");
97 void ActionEditCopy::updateMouseCursor()
99 graphicView->setMouseCursor(RS2::CadCursor);
102 void ActionEditCopy::updateToolBar()
105 DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
107 DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);