]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionselect.cpp
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / actions / rs_actionselect.cpp
1 // rs_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 "rs_actionselect.h"
16
17 #include "rs_actionselectsingle.h"
18 #include "rs_dialogfactory.h"
19 #include "graphicview.h"
20
21 RS_ActionSelect::RS_ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, RS2::ActionType nextAction):
22         RS_ActionInterface("Select Entities", container, graphicView)
23 {
24         this->nextAction = nextAction;
25 }
26
27 RS_ActionSelect::~RS_ActionSelect()
28 {
29 }
30
31 void RS_ActionSelect::init(int status)
32 {
33         RS_ActionInterface::init(status);
34         graphicView->setCurrentAction(new RS_ActionSelectSingle(*container, *graphicView));
35 }
36
37 void RS_ActionSelect::mouseReleaseEvent(QMouseEvent * e)
38 {
39         if (e->button() == Qt::RightButton)
40                 init(getStatus() - 1);
41 }
42
43 void RS_ActionSelect::updateToolBar()
44 {
45         if (RS_DIALOGFACTORY != NULL)
46         {
47                 if (!isFinished())
48                         RS_DIALOGFACTORY->requestToolBarSelect(this, nextAction);
49                 else
50                         RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
51         }
52 }