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 closeButton(new QToolButton(this)),
28 undoButton(new QToolButton(this)),
29 arcCheckBox(new QCheckBox(this)),
30 radiusLabel(new QLabel(this)),
31 radiusEdit(new QLineEdit(this))
33 QHBoxLayout * layout = new QHBoxLayout(this);
34 layout->setContentsMargins(0, 0, 0, 0);
36 closeButton->setText(tr("Close"));
37 undoButton->setText(tr("Undo"));
38 arcCheckBox->setText(tr("Arc"));
39 radiusLabel->setText(tr("Radius:"));
41 layout->addWidget(closeButton);
42 layout->addWidget(undoButton);
43 layout->addWidget(arcCheckBox);
44 layout->addWidget(radiusLabel);
45 layout->addWidget(radiusEdit);
47 connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
48 connect(undoButton, SIGNAL(clicked()), this, SLOT(undo()));
50 // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
51 // nothing will show up on the screen. :-)
53 parent->addWidget(this);
56 PolylineOptions::~PolylineOptions()
60 void PolylineOptions::setAction(ActionInterface * a, bool /*update*/)
62 if (a && a->rtti() == RS2::ActionDrawPolyline)
64 action = (ActionDrawPolyline *)a;
68 DEBUG->print(Debug::D_ERROR, "PolylineOptions::setAction: wrong action type");
73 void PolylineOptions::close()
79 void PolylineOptions::undo()