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 "dlgcircle.h"
23 DlgCircle::DlgCircle(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
24 QDialog(parent, flags)
29 DlgCircle::~DlgCircle()
33 void DlgCircle::setCircle(Circle & c)
36 //pen = circle->getPen();
37 ui.wPen->setPen(circle->getPen(false), true, false, "Pen");
38 Drawing * graphic = circle->getGraphic();
41 ui.cbLayer->init(*(graphic->getLayerList()), false, false);
43 Layer * lay = circle->getLayer(false);
46 ui.cbLayer->setLayer(*lay);
49 s.setNum(circle->getCenter().x);
50 ui.leCenterX->setText(s);
51 s.setNum(circle->getCenter().y);
52 ui.leCenterY->setText(s);
53 s.setNum(circle->getRadius());
54 ui.leRadius->setText(s);
57 void DlgCircle::updateCircle()
59 circle->setCenter(Vector(Math::eval(ui.leCenterX->text()),
60 Math::eval(ui.leCenterY->text())));
61 circle->setRadius(Math::eval(ui.leRadius->text()));
62 circle->setPen(ui.wPen->getPen());
63 circle->setLayer(ui.cbLayer->currentText());
64 circle->calculateBorders();