]> Shamusworld >> Repos - architektonas/blob - src/forms/dlgattributes.cpp
4f18d61e49eec9d62f20193c63e0c3b56cac8122
[architektonas] / src / forms / dlgattributes.cpp
1 // dlgattributes.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  05/20/2010  Created this file. :-)
15 //
16
17 #include "dlgattributes.h"
18
19 //#include "layerbox.h"
20 #include "rs_modification.h"
21 #include "rs_layerlist.h"
22
23 DlgAttributes::DlgAttributes(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
24         QDialog(parent, flags)
25 {
26         ui.setupUi(this);
27 }
28
29 DlgAttributes::~DlgAttributes()
30 {
31 }
32
33 void DlgAttributes::setData(RS_AttributesData * data, RS_LayerList & layerList)
34 {
35         this->data = data;
36
37         //pen = line->getPen();
38         ui.wPen->setPen(data->pen, true, true, "Pen");
39
40         //Drawing* graphic = line->getGraphic();
41         //if (graphic!=NULL) {
42         ui.cbLayer->init(layerList, false, true);
43         //}
44         //cbLayer->setLayer(data->layer);
45         //RS_Layer* lay = line->getLayer(false);
46         //if (lay!=NULL) {
47         //    cbLayer->setLayer(*lay);
48         //}
49 }
50
51 void DlgAttributes::updateData()
52 {
53         data->pen = ui.wPen->getPen();
54         data->layer = ui.cbLayer->currentText();
55
56         data->changeColor = !ui.wPen->isColorUnchanged();
57         data->changeLineType = !ui.wPen->isLineTypeUnchanged();
58         data->changeWidth = !ui.wPen->isWidthUnchanged();
59
60         data->changeLayer = !ui.cbLayer->isUnchanged();
61 }