]> Shamusworld >> Repos - architektonas/blob - src/actions/actionselect.cpp
ab19e14a0d8afac296242135c95c24fc75bc6962
[architektonas] / src / actions / actionselect.cpp
1 // actionselect.cpp
2 //
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
7 //
8 // JLH = James L. Hammons <jlhamm@acm.org>
9 //
10 // Who  When        What
11 // ---  ----------  -----------------------------------------------------------
12 // JLH  06/04/2010  Added this text. :-)
13 //
14
15 #include "actionselect.h"
16
17 #include "actionselectsingle.h"
18 #include "rs_dialogfactory.h"
19 #include "graphicview.h"
20
21 ActionSelect::ActionSelect(RS_EntityContainer & container, GraphicView & graphicView,
22         RS2::ActionType nextAction):
23         ActionInterface("Select Entities", container, graphicView)
24 {
25         this->nextAction = nextAction;
26 }
27
28 ActionSelect::~ActionSelect()
29 {
30 }
31
32 void ActionSelect::init(int status)
33 {
34         ActionInterface::init(status);
35         graphicView->setCurrentAction(new ActionSelectSingle(*container, *graphicView));
36 }
37
38 void ActionSelect::mouseReleaseEvent(QMouseEvent * e)
39 {
40         if (e->button() == Qt::RightButton)
41                 init(getStatus() - 1);
42 }
43
44 void ActionSelect::updateToolBar()
45 {
46         if (RS_DIALOGFACTORY)
47         {
48                 if (!isFinished())
49                         RS_DIALOGFACTORY->requestToolBarSelect(this, nextAction);
50                 else
51                         RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
52         }
53 }