]> Shamusworld >> Repos - architektonas/blob - src/forms/dlgattributes.cpp
Changed RS_Graphic to Drawing; this is less confusing as a drawing is
[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 // (C) 2010 Underground Software
7 //
8 // JLH = James L. Hammons <jlhamm@acm.org>
9 //
10 // Who  When        What
11 // ---  ----------  -----------------------------------------------------------
12 // JLH  05/20/2010  Created this file. :-)
13 //
14
15 #include "dlgattributes.h"
16
17 //#include "layerbox.h"
18 #include "rs_modification.h"
19 #include "rs_layerlist.h"
20
21 DlgAttributes::DlgAttributes(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
22         QDialog(parent, flags)
23 {
24         ui.setupUi(this);
25 }
26
27 DlgAttributes::~DlgAttributes()
28 {
29 }
30
31 void DlgAttributes::setData(RS_AttributesData * data, RS_LayerList & layerList)
32 {
33         this->data = data;
34
35         //pen = line->getPen();
36         ui.wPen->setPen(data->pen, true, true, "Pen");
37
38         //Drawing* graphic = line->getGraphic();
39         //if (graphic!=NULL) {
40         ui.cbLayer->init(layerList, false, true);
41         //}
42         //cbLayer->setLayer(data->layer);
43         //RS_Layer* lay = line->getLayer(false);
44         //if (lay!=NULL) {
45         //    cbLayer->setLayer(*lay);
46         //}
47 }
48
49 void DlgAttributes::updateData()
50 {
51         data->pen = ui.wPen->getPen();
52         data->layer = ui.cbLayer->currentText();
53
54         data->changeColor = !ui.wPen->isColorUnchanged();
55         data->changeLineType = !ui.wPen->isLineTypeUnchanged();
56         data->changeWidth = !ui.wPen->isWidthUnchanged();
57
58         data->changeLayer = !ui.cbLayer->isUnchanged();
59 }