]> Shamusworld >> Repos - architektonas/blob - src/forms/dlgdimension.cpp
Bugfixes related to removing Snapper class.
[architektonas] / src / forms / dlgdimension.cpp
1 // dlgdimension.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 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
9 //
10 // JLH = James L. Hammons <jlhamm@acm.org>
11 //
12 // Who  When        What
13 // ---  ----------  -----------------------------------------------------------
14 // JLH  06/11/2010  Created this file. :-)
15 //
16
17 #include "dlgdimension.h"
18
19 #include "dimension.h"
20 #include "drawing.h"
21
22 DlgDimension::DlgDimension(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
23         QDialog(parent, flags)
24 {
25         ui.setupUi(this);
26 }
27
28 DlgDimension::~DlgDimension()
29 {
30 }
31
32 void DlgDimension::setDim(Dimension & d)
33 {
34         dim = &d;
35         ui.wPen->setPen(dim->getPen(false), true, false, "Pen");
36         Drawing * graphic = dim->getGraphic();
37
38         if (graphic)
39                 ui.cbLayer->init(*(graphic->getLayerList()), false, false);
40
41         Layer * lay = dim->getLayer(false);
42
43         if (lay)
44                 ui.cbLayer->setLayer(*lay);
45
46         ui.wLabel->setLabel(dim->getLabel(false));
47 }
48
49 void DlgDimension::updateDim()
50 {
51         dim->setLabel(ui.wLabel->getLabel());
52 }