#include "actiondrawlineparallelthrough.h"
-#include "rs_commandevent.h"
-#include "rs_creation.h"
-#include "rs_debug.h"
-#include "rs_dialogfactory.h"
+#include "commandevent.h"
+#include "creation.h"
+#include "debug.h"
+#include "dialogfactory.h"
#include "graphicview.h"
-#include "rs_preview.h"
+#include "preview.h"
ActionDrawLineParallelThrough::ActionDrawLineParallelThrough(
- RS_EntityContainer & container, GraphicView & graphicView):
+ EntityContainer & container, GraphicView & graphicView):
ActionInterface("Draw Parallels", container, graphicView)
{
parallel = NULL;
if (entity)
{
- RS_Creation creation(container, graphicView);
- RS_Entity * e = creation.createParallelThrough(coord, number, entity);
+ Creation creation(container, graphicView);
+ Entity * e = creation.createParallelThrough(coord, number, entity);
if (!e)
- RS_DEBUG->print("ActionDrawLineParallelThrough::trigger:"
+ DEBUG->print("ActionDrawLineParallelThrough::trigger:"
" No parallels added\n");
}
}
void ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent begin");
+ DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent begin");
switch (getStatus())
{
deletePreview();
clearPreview();
-// RS_Creation creation(preview, NULL, false);
+// Creation creation(preview, NULL, false);
// creation.createParallelThrough(coord, number, entity);
drawPreview();
break;
}
- RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent end");
+ DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent end");
}
void ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e)
switch (getStatus())
{
case SetEntity:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Select entity"), tr("Cancel"));
+ DIALOGFACTORY->updateMouseWidget(tr("Select entity"), tr("Cancel"));
break;
case SetPos:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify through point"), tr("Back"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify through point"), tr("Back"));
break;
case SetNumber:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Number:"), tr("Back"));
+ DIALOGFACTORY->updateMouseWidget(tr("Number:"), tr("Back"));
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionDrawLineParallelThrough::showOptions()
{
ActionInterface::showOptions();
- RS_DIALOGFACTORY->requestOptions(this, true);
+ DIALOGFACTORY->requestOptions(this, true);
updateMouseButtonHints();
}
void ActionDrawLineParallelThrough::hideOptions()
{
ActionInterface::hideOptions();
- RS_DIALOGFACTORY->requestOptions(this, false);
+ DIALOGFACTORY->requestOptions(this, false);
}
-void ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineParallelThrough::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
}
if (n > 0 && n < 100)
number = n;
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid number. "
+ DIALOGFACTORY->commandMessage(tr("Not a valid number. "
"Try 1..99"));
}
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
void ActionDrawLineParallelThrough::updateToolBar()
{
if (getStatus() == SetPos && !isFinished())
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
else
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
}
int ActionDrawLineParallelThrough::getNumber()