3 // Part of the Architektonas Project
5 // Copyright (C) 2010 Underground Software
6 // See the README and GPLv2 files for licensing and warranty information
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 09/13/2010 Created this file. :-)
15 // NOTE: Still need to add "Arc" checkbox and "Radius" textedit
16 #warning "!!! Still need to add 'Arc' checkbox and 'Radius' textedit !!!"
18 #include "polylineoptions.h"
21 #include "actiondrawpolyline.h"
22 #include "actioninterface.h"
25 PolylineOptions::PolylineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
26 QWidget(parent, flags), action(NULL),
27 bClose(new QToolButton(this)),
28 bUndo(new QToolButton(this))
30 QHBoxLayout * layout = new QHBoxLayout(this);
31 layout->setContentsMargins(0, 0, 0, 0);
33 bClose->setText(tr("Close"));
34 bUndo->setText(tr("Undo"));
36 layout->addWidget(bClose);
37 layout->addWidget(bUndo);
39 connect(bClose, SIGNAL(clicked()), this, SLOT(close()));
40 connect(bUndo, SIGNAL(clicked()), this, SLOT(undo()));
42 // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
43 // nothing will show up on the screen. :-)
45 parent->addWidget(this);
48 PolylineOptions::~PolylineOptions()
52 void PolylineOptions::setAction(ActionInterface * a, bool /*update*/)
54 if (a && a->rtti() == RS2::ActionDrawPolyline)
56 action = (ActionDrawPolyline *)a;
60 DEBUG->print(Debug::D_ERROR, "PolylineOptions::setAction: wrong action type");
65 void PolylineOptions::close()
71 void PolylineOptions::undo()