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
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/28/2010 Created this file. :-)
15 #include "textoptions.h"
17 #include "rs_actiondrawtext.h"
18 #include "rs_actioninterface.h"
20 TextOptions::TextOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/)
25 TextOptions::~TextOptions()
29 void TextOptions::setAction(RS_ActionInterface * a, bool update)
31 if (a != NULL && a->rtti() == RS2::ActionDrawText)
33 action = (RS_ActionDrawText *)a;
40 st = action->getText();
41 sa = QString("%1").arg(RS_Math::rad2deg(action->getAngle()));
49 ui.teText->setText(st);
50 ui.leAngle->setText(sa);
54 RS_DEBUG->print(RS_Debug::D_ERROR, "TextOptions::setAction: wrong action type");
59 void TextOptions::updateText()
62 action->setText(ui.teText->text());
65 void TextOptions::updateAngle()
68 action->setAngle(RS_Math::deg2rad(RS_Math::eval(ui.leAngle->text())));