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/11/2010 Created this file. :-)
17 #include "dlgdimlinear.h"
19 #include "dimlinear.h"
23 DlgDimLinear::DlgDimLinear(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
24 QDialog(parent, flags)
29 DlgDimLinear::~DlgDimLinear()
33 void DlgDimLinear::setDim(DimLinear & d)
36 ui.wPen->setPen(dim->getPen(false), true, false, "Pen");
37 Drawing * graphic = dim->getGraphic();
40 ui.cbLayer->init(*(graphic->getLayerList()), false, false);
42 Layer * lay = dim->getLayer(false);
45 ui.cbLayer->setLayer(*lay);
47 ui.wLabel->setLabel(dim->getLabel(false));
48 ui.leAngle->setText(QString("%1").arg(Math::rad2deg(dim->getAngle())));
51 void DlgDimLinear::updateDim()
53 dim->setLabel(ui.wLabel->getLabel());
54 dim->setAngle(Math::deg2rad(Math::eval(ui.leAngle->text(), 0.0)));