X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawtext.cpp;fp=src%2Factions%2Frs_actiondrawtext.cpp;h=3bb7b242cfc7ad5558322fe4057b5193631d804a;hb=d774c2655ba2c3657a565f325411144452392277;hp=1d3eb7c4c885253de8b6a385ee70e3f3d16ff6a8;hpb=468780dd17f8b0ebb35427a9fc43491721d44d69;p=architektonas diff --git a/src/actions/rs_actiondrawtext.cpp b/src/actions/actiondrawtext.cpp similarity index 70% rename from src/actions/rs_actiondrawtext.cpp rename to src/actions/actiondrawtext.cpp index 1d3eb7c..3bb7b24 100644 --- a/src/actions/rs_actiondrawtext.cpp +++ b/src/actions/actiondrawtext.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawtext.cpp +// actiondrawtext.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,31 +14,31 @@ // preview. // -#include "rs_actiondrawtext.h" +#include "actiondrawtext.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawText::RS_ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Text", container, graphicView) +ActionDrawText::ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Text", container, graphicView) { pos = Vector(false); textChanged = true; } -RS_ActionDrawText::~RS_ActionDrawText() +ActionDrawText::~ActionDrawText() { } -/*virtual*/ RS2::ActionType RS_ActionDrawText::rtti() +/*virtual*/ RS2::ActionType ActionDrawText::rtti() { return RS2::ActionDrawText; } -void RS_ActionDrawText::init(int status) +void ActionDrawText::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); if (RS_DIALOGFACTORY == NULL) return; @@ -56,7 +56,7 @@ void RS_ActionDrawText::init(int status) { data = tmp.getData(); preparePreview(); - preview->setVisible(false); +// preview->setVisible(false); setStatus(SetPos); showOptions(); @@ -80,16 +80,16 @@ void RS_ActionDrawText::init(int status) } } -void RS_ActionDrawText::reset() +void ActionDrawText::reset() { data = RS_TextData(Vector(0.0, 0.0), 1.0, 100.0, RS2::VAlignTop, - RS2::HAlignLeft, RS2::LeftToRight, RS2::Exact, 1.0, data.text, - "standard", 0.0, RS2::Update); + RS2::HAlignLeft, RS2::LeftToRight, RS2::Exact, 1.0, data.text, + "standard", 0.0, RS2::Update); } -void RS_ActionDrawText::trigger() +void ActionDrawText::trigger() { - RS_DEBUG->print("RS_ActionDrawText::trigger()"); + RS_DEBUG->print("ActionDrawText::trigger()"); if (pos.valid) { @@ -117,20 +117,19 @@ void RS_ActionDrawText::trigger() } } -void RS_ActionDrawText::preparePreview() +void ActionDrawText::preparePreview() { - clearPreview(); +/* clearPreview(); data.insertionPoint = Vector(0.0, 0.0); RS_Text * text = new RS_Text(preview, data); text->update(); - //text->setVisible(false); preview->addEntity(text); - textChanged = false; + textChanged = false;*/ } -void RS_ActionDrawText::mouseMoveEvent(QMouseEvent * e) +void ActionDrawText::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawText::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawText::mouseMoveEvent begin"); if (getStatus() == SetPos) { @@ -145,17 +144,17 @@ void RS_ActionDrawText::mouseMoveEvent(QMouseEvent * e) if (textChanged) preparePreview(); - if (!preview->isVisible()) - preview->setVisible(true); - - offset = Vector(graphicView->toGuiDX(pos.x), -graphicView->toGuiDY(pos.y)); +// if (!preview->isVisible()) +// preview->setVisible(true); +// +// offset = Vector(graphicView->toGuiDX(pos.x), -graphicView->toGuiDY(pos.y)); drawPreview(); } - RS_DEBUG->print("RS_ActionDrawText::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawText::mouseMoveEvent end"); } -void RS_ActionDrawText::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawText::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -177,7 +176,7 @@ void RS_ActionDrawText::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawText::coordinateEvent(Vector * e) +void ActionDrawText::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -199,7 +198,7 @@ void RS_ActionDrawText::coordinateEvent(Vector * e) } } -void RS_ActionDrawText::commandEvent(RS_CommandEvent * e) +void ActionDrawText::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -229,7 +228,7 @@ void RS_ActionDrawText::commandEvent(RS_CommandEvent * e) case SetText: setText(e->getCommand()); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true, true); graphicView->enableCoordinateInput(); @@ -241,7 +240,7 @@ void RS_ActionDrawText::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawText::getAvailableCommands() +QStringList ActionDrawText::getAvailableCommands() { QStringList cmd; @@ -251,25 +250,25 @@ QStringList RS_ActionDrawText::getAvailableCommands() return cmd; } -void RS_ActionDrawText::showOptions() +void ActionDrawText::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDrawText::hideOptions() +void ActionDrawText::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawText::updateMouseButtonHints() +void ActionDrawText::updateMouseButtonHints() { - if (RS_DIALOGFACTORY == NULL) + if (!RS_DIALOGFACTORY) return; switch (getStatus()) @@ -288,14 +287,14 @@ void RS_ActionDrawText::updateMouseButtonHints() } } -void RS_ActionDrawText::updateMouseCursor() +void ActionDrawText::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawText::updateToolBar() +void ActionDrawText::updateToolBar() { - if (RS_DIALOGFACTORY == NULL) + if (!RS_DIALOGFACTORY) return; switch (getStatus()) @@ -310,25 +309,24 @@ void RS_ActionDrawText::updateToolBar() } } -void RS_ActionDrawText::setText(const QString & t) +void ActionDrawText::setText(const QString & t) { data.text = t; textChanged = true; } -QString RS_ActionDrawText::getText() +QString ActionDrawText::getText() { return data.text; } -void RS_ActionDrawText::setAngle(double a) +void ActionDrawText::setAngle(double a) { data.angle = a; textChanged = true; } -double RS_ActionDrawText::getAngle() +double ActionDrawText::getAngle() { return data.angle; } -