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. :-)
23 DlgLine::DlgLine(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
24 QDialog(parent, flags)
33 void DlgLine::setLine(Line & l)
36 //pen = line->getPen();
37 ui.wPen->setPen(line->getPen(false), true, false, "Pen");
38 Drawing * graphic = line->getGraphic();
41 ui.cbLayer->init(*(graphic->getLayerList()), false, false);
43 Layer * lay = line->getLayer(false);
46 ui.cbLayer->setLayer(*lay);
49 s.setNum(line->getStartpoint().x);
50 ui.leStartX->setText(s);
51 s.setNum(line->getStartpoint().y);
52 ui.leStartY->setText(s);
53 s.setNum(line->getEndpoint().x);
54 ui.leEndX->setText(s);
55 s.setNum(line->getEndpoint().y);
56 ui.leEndY->setText(s);
59 void DlgLine::updateLine()
61 line->setStartpoint(Vector(Math::eval(ui.leStartX->text()),
62 Math::eval(ui.leStartY->text())));
63 line->setEndpoint(Vector(Math::eval(ui.leEndX->text()),
64 Math::eval(ui.leEndY->text())));
65 line->setPen(ui.wPen->getPen());
66 line->setLayer(ui.cbLayer->currentText());