// Who When What
// --- ---------- -----------------------------------------------------------
// JLH 06/03/2010 Added this text. :-)
-// JLH 06/03/2010 Scrubbed out all occurances of RS_CoordinateEvent
+// JLH 06/03/2010 Scrubbed out all occurances of CoordinateEvent
//
#include "actionblocksinsert.h"
/**
* Constructor.
*/
-ActionBlocksInsert::ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView):
+ActionBlocksInsert::ActionBlocksInsert(EntityContainer & container, GraphicView & graphicView):
ActionInterface("Blocks Insert", container, graphicView)
{
}
void ActionBlocksInsert::reset()
{
- data = RS_InsertData("", Vector(0.0, 0.0), Vector(1.0, 1.0), 0.0, 1, 1,
+ data = InsertData("", Vector(0.0, 0.0), Vector(1.0, 1.0), 0.0, 1, 1,
Vector(1.0, 1.0), NULL, RS2::Update);
}
// deletePreview();
// clearPreview();
- //RS_Modification m(*container, graphicView);
+ //Modification m(*container, graphicView);
//m.paste(data.insertionPoint);
- //std::cout << *RS_Clipboard::instance();
+ //std::cout << *Clipboard::instance();
if (block)
{
- RS_Creation creation(container, graphicView);
+ Creation creation(container, graphicView);
data.updateMode = RS2::Update;
creation.createInsert(data);
}
// clearPreview();
//preview->addAllFrom(*block);
//preview->move(data.insertionPoint);
-// RS_Creation creation(preview, NULL, false);
- RS_Creation creation(&(graphicView->preview), NULL, false);
+// Creation creation(preview, NULL, false);
+ Creation creation(&(graphicView->preview), NULL, false);
// Create insert as preview only
data.updateMode = RS2::PreviewUpdate;
creation.createInsert(data);
trigger();
}
-void ActionBlocksInsert::commandEvent(RS_CommandEvent * e)
+void ActionBlocksInsert::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
}
case SetAngle:
{
bool ok;
- double a = RS_Math::eval(c, &ok);
+ double a = Math::eval(c, &ok);
if (ok)
- data.angle = RS_Math::deg2rad(a);
+ data.angle = Math::deg2rad(a);
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
case SetFactor:
{
bool ok;
- double f = RS_Math::eval(c, &ok);
+ double f = Math::eval(c, &ok);
if (ok)
setFactor(f);
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
case SetColumns:
{
bool ok;
- int cols = (int)RS_Math::eval(c, &ok);
+ int cols = (int)Math::eval(c, &ok);
if (ok)
data.cols = cols;
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
case SetRows:
{
bool ok;
- int rows = (int)RS_Math::eval(c, &ok);
+ int rows = (int)Math::eval(c, &ok);
if (ok)
data.rows = rows;
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
case SetColumnSpacing:
{
bool ok;
- double cs = (int)RS_Math::eval(c, &ok);
+ double cs = (int)Math::eval(c, &ok);
if (ok)
data.spacing.x = cs;
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
case SetRowSpacing:
{
bool ok;
- int rs = (int)RS_Math::eval(c, &ok);
+ int rs = (int)Math::eval(c, &ok);
if (ok)
data.spacing.y = rs;
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
void ActionBlocksInsert::showOptions()
{
ActionInterface::showOptions();
- RS_DIALOGFACTORY->requestOptions(this, true);
+ DIALOGFACTORY->requestOptions(this, true);
}
void ActionBlocksInsert::hideOptions()
{
ActionInterface::hideOptions();
- RS_DIALOGFACTORY->requestOptions(this, false);
+ DIALOGFACTORY->requestOptions(this, false);
}
void ActionBlocksInsert::updateMouseButtonHints()
switch (getStatus())
{
case SetTargetPoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel"));
break;
case SetAngle:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), "");
break;
case SetFactor:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), "");
break;
case SetColumns:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter columns:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter columns:"), "");
break;
case SetRows:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter rows:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter rows:"), "");
break;
case SetColumnSpacing:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter column spacing:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter column spacing:"), "");
break;
case SetRowSpacing:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter row spacing:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter row spacing:"), "");
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionBlocksInsert::updateToolBar()
{
if (!isFinished())
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
else
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
double ActionBlocksInsert::getAngle()