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"
19 #include "rs_dialogfactory.h"
20 #include "graphicview.h"
22 ActionModifyDeleteQuick::ActionModifyDeleteQuick(
23 RS_EntityContainer & container, GraphicView & graphicView):
24 ActionInterface("Quick Delete Entities", container, graphicView)
29 ActionModifyDeleteQuick::~ActionModifyDeleteQuick()
34 * Deletes all entities that were selected.
36 void ActionModifyDeleteQuick::trigger()
38 RS_DEBUG->print("ActionModifyDeleteQuick::trigger()");
42 RS_DEBUG->print("Entity found");
43 RS_EntityContainer * parent = en->getParent();
47 en->setSelected(false);
48 graphicView->deleteEntity(en);
49 en->changeUndoState();
53 document->startUndoCycle();
54 document->addUndoable(en);
55 document->endUndoCycle();
59 RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
62 RS_DEBUG->print("ActionModifyDeleteQuick::mousePressEvent:"
66 void ActionModifyDeleteQuick::mouseReleaseEvent(QMouseEvent * e)
68 if (e->button() == Qt::RightButton)
69 init(getStatus() - 1);
77 void ActionModifyDeleteQuick::updateMouseButtonHints()
82 RS_DIALOGFACTORY->updateMouseWidget(tr("Pick entity to delete"),
87 RS_DIALOGFACTORY->updateMouseWidget("", "");
92 void ActionModifyDeleteQuick::updateMouseCursor()
94 graphicView->setMouseCursor(RS2::DelCursor);