#include <QtGui>
#include "rs_actioninterface.h"
-#include "rs_coordinateevent.h"
+#include "rs_commandevent.h"
+#include "rs_debug.h"
+#include "rs_dialogfactory.h"
+#include "rs_graphicview.h"
+#include "rs_math.h"
/**
* Constructor.
/**
* Called by RS_GraphicView
*/
-void RS_EventHandler::keyReleaseEvent(QKeyEvent* e)
+void RS_EventHandler::keyReleaseEvent(QKeyEvent * e)
{
- if (actionIndex >= 0 && currentActions[actionIndex] != NULL &&
- !currentActions[actionIndex]->isFinished())
+ if (actionIndex >= 0 && currentActions[actionIndex] != NULL
+ && !currentActions[actionIndex]->isFinished())
{
currentActions[actionIndex]->keyReleaseEvent(e);
}
else
{
if (defaultAction != NULL)
- {
defaultAction->keyReleaseEvent(e);
- }
else
- {
e->ignore();
- }
+
//RS_DEBUG->print("currently no action defined");
}
}
if (ok1 && ok2)
{
- RS_DEBUG->print("RS_EventHandler::commandEvent: 005");
- RS_CoordinateEvent ce(Vector(x, y));
+// RS_DEBUG->print("RS_EventHandler::commandEvent: 005");
+// RS_CoordinateEvent ce(Vector(x, y));
RS_DEBUG->print("RS_EventHandler::commandEvent: 006");
+// currentActions[actionIndex]->coordinateEvent(&ce);
+ Vector ce(x, y);
currentActions[actionIndex]->coordinateEvent(&ce);
}
else
if (actionIndex >= 0 && currentActions[actionIndex] != NULL
&& !currentActions[actionIndex]->isFinished())
{
-// int commaPos = cmd.find(',');
int commaPos = cmd.indexOf(',');
bool ok1, ok2;
double x = RS_Math::eval(cmd.mid(1, commaPos - 1), &ok1);
if (ok1 && ok2)
{
- RS_CoordinateEvent ce(Vector(x,y) +
- graphicView->getRelativeZero());
+// RS_CoordinateEvent ce(Vector(x,y) + graphicView->getRelativeZero());
+// currentActions[actionIndex]->coordinateEvent(&ce);
+ Vector ce(Vector(x,y) + graphicView->getRelativeZero());
currentActions[actionIndex]->coordinateEvent(&ce);
}
else
{
Vector pos;
pos.setPolar(r,RS_Math::deg2rad(a));
- RS_CoordinateEvent ce(pos);
- currentActions[actionIndex]->coordinateEvent(&ce);
+// RS_CoordinateEvent ce(pos);
+// currentActions[actionIndex]->coordinateEvent(&ce);
+ currentActions[actionIndex]->coordinateEvent(&pos);
}
else
{
{
Vector pos;
pos.setPolar(r,RS_Math::deg2rad(a));
- RS_CoordinateEvent ce(pos +
- graphicView->getRelativeZero());
+// RS_CoordinateEvent ce(pos + graphicView->getRelativeZero());
+// currentActions[actionIndex]->coordinateEvent(&ce);
+ Vector ce(pos + graphicView->getRelativeZero());
currentActions[actionIndex]->coordinateEvent(&ce);
}
else
else
{
if (defaultAction != NULL)
- {
defaultAction->commandEvent(e);
- //e->accept();
- }
}
}