1 // actionmodifydeletequick.cpp
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 06/04/2010 Added this text. :-)
17 #include "actionmodifydeletequick.h"
20 #include "rs_dialogfactory.h"
21 #include "graphicview.h"
23 ActionModifyDeleteQuick::ActionModifyDeleteQuick(
24 RS_EntityContainer & container, GraphicView & graphicView):
25 ActionInterface("Quick Delete Entities", container, graphicView)
30 ActionModifyDeleteQuick::~ActionModifyDeleteQuick()
35 * Deletes all entities that were selected.
37 void ActionModifyDeleteQuick::trigger()
39 RS_DEBUG->print("ActionModifyDeleteQuick::trigger()");
43 RS_DEBUG->print("Entity found");
44 RS_EntityContainer * parent = en->getParent();
48 en->setSelected(false);
49 graphicView->deleteEntity(en);
50 en->changeUndoState();
54 document->startUndoCycle();
55 document->addUndoable(en);
56 document->endUndoCycle();
60 RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
63 RS_DEBUG->print("ActionModifyDeleteQuick::mousePressEvent:"
67 void ActionModifyDeleteQuick::mouseReleaseEvent(QMouseEvent * e)
69 if (e->button() == Qt::RightButton)
70 init(getStatus() - 1);
78 void ActionModifyDeleteQuick::updateMouseButtonHints()
83 RS_DIALOGFACTORY->updateMouseWidget(tr("Pick entity to delete"),
88 RS_DIALOGFACTORY->updateMouseWidget("", "");
93 void ActionModifyDeleteQuick::updateMouseCursor()
95 graphicView->setMouseCursor(RS2::DelCursor);