X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawtext.cpp;h=e3b370b019dece892bc67a84294a560206f15834;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=2de93f39032d82cf8342961eeb40bb0338880cb5;hpb=48105dec9198cf5a81dd9286010d0d45e28f70c3;p=architektonas diff --git a/src/actions/actiondrawtext.cpp b/src/actions/actiondrawtext.cpp index 2de93f3..e3b370b 100644 --- a/src/actions/actiondrawtext.cpp +++ b/src/actions/actiondrawtext.cpp @@ -18,13 +18,13 @@ #include "actiondrawtext.h" -#include "rs_commandevent.h" -#include "rs_debug.h" -#include "rs_dialogfactory.h" +#include "commandevent.h" +#include "debug.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" +#include "preview.h" -ActionDrawText::ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Text", container, graphicView) +ActionDrawText::ActionDrawText(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Text", container, graphicView) { pos = Vector(false); textChanged = true; @@ -43,7 +43,7 @@ void ActionDrawText::init(int status) { ActionInterface::init(status); - if (RS_DIALOGFACTORY == NULL) + if (DIALOGFACTORY == NULL) return; switch (status) @@ -53,9 +53,9 @@ void ActionDrawText::init(int status) clearPreview(); reset(); - RS_Text tmp(NULL, data); + Text tmp(NULL, data); - if (RS_DIALOGFACTORY->requestTextDialog(&tmp)) + if (DIALOGFACTORY->requestTextDialog(&tmp)) { data = tmp.getData(); preparePreview(); @@ -75,7 +75,7 @@ void ActionDrawText::init(int status) break; case SetPos: - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); break; default: @@ -85,14 +85,14 @@ void ActionDrawText::init(int status) void ActionDrawText::reset() { - data = RS_TextData(Vector(0.0, 0.0), 1.0, 100.0, RS2::VAlignTop, + data = 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); } void ActionDrawText::trigger() { - RS_DEBUG->print("ActionDrawText::trigger()"); + DEBUG->print("ActionDrawText::trigger()"); if (pos.valid) { @@ -101,7 +101,7 @@ void ActionDrawText::trigger() clearPreview(); deleteSnapper(); - RS_Text * text = new RS_Text(container, data); + Text * text = new Text(container, data); text->update(); container->addEntity(text); @@ -124,7 +124,7 @@ void ActionDrawText::preparePreview() { /* clearPreview(); data.insertionPoint = Vector(0.0, 0.0); - RS_Text * text = new RS_Text(preview, data); + Text * text = new Text(preview, data); text->update(); preview->addEntity(text); textChanged = false;*/ @@ -132,7 +132,7 @@ void ActionDrawText::preparePreview() void ActionDrawText::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDrawText::mouseMoveEvent begin"); + DEBUG->print("ActionDrawText::mouseMoveEvent begin"); if (getStatus() == SetPos) { @@ -154,7 +154,7 @@ void ActionDrawText::mouseMoveEvent(QMouseEvent * e) drawPreview(); } - RS_DEBUG->print("ActionDrawText::mouseMoveEvent end"); + DEBUG->print("ActionDrawText::mouseMoveEvent end"); } void ActionDrawText::mouseReleaseEvent(QMouseEvent * e) @@ -201,14 +201,14 @@ void ActionDrawText::coordinateEvent(Vector * e) } } -void ActionDrawText::commandEvent(RS_CommandEvent * e) +void ActionDrawText::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + if (DIALOGFACTORY != NULL) + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -231,8 +231,8 @@ void ActionDrawText::commandEvent(RS_CommandEvent * e) case SetText: setText(e->getCommand()); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, true, true); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, true, true); graphicView->enableCoordinateInput(); setStatus(SetPos); @@ -257,35 +257,35 @@ void ActionDrawText::showOptions() { ActionInterface::showOptions(); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, true, true); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, true, true); } void ActionDrawText::hideOptions() { ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, false); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, false); } void ActionDrawText::updateMouseButtonHints() { - if (!RS_DIALOGFACTORY) + if (!DIALOGFACTORY) return; switch (getStatus()) { case SetPos: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify insertion point"), tr("Cancel")); + DIALOGFACTORY->updateMouseWidget(tr("Specify insertion point"), tr("Cancel")); break; case SetText: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter text:"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Enter text:"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -297,17 +297,17 @@ void ActionDrawText::updateMouseCursor() void ActionDrawText::updateToolBar() { - if (!RS_DIALOGFACTORY) + if (!DIALOGFACTORY) return; switch (getStatus()) { case SetPos: - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); break; default: - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); break; } }