X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_eventhandler.cpp;h=260998a133aeefc59de93e64d784a2fb5c472f17;hb=3f46c180da0806c9c263e6d87d0f1404632402da;hp=29e03186f83c9ae02efed0a8c8679a5dcd31c053;hpb=89e127aa3dbd74d3158e6dbe0ca1703420c04395;p=architektonas diff --git a/src/base/rs_eventhandler.cpp b/src/base/rs_eventhandler.cpp index 29e0318..260998a 100644 --- a/src/base/rs_eventhandler.cpp +++ b/src/base/rs_eventhandler.cpp @@ -16,7 +16,11 @@ #include #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. @@ -218,23 +222,20 @@ void RS_EventHandler::keyPressEvent(QKeyEvent * e) /** * 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"); } } @@ -268,9 +269,11 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) 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 @@ -292,7 +295,6 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) 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); @@ -300,8 +302,9 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) 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 @@ -323,7 +326,6 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) if (actionIndex >= 0 && currentActions[actionIndex] != NULL && !currentActions[actionIndex]->isFinished()) { -// int commaPos = cmd.find('<'); int commaPos = cmd.indexOf('<'); bool ok1, ok2; double r = RS_Math::eval(cmd.left(commaPos), &ok1); @@ -333,8 +335,9 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) { 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 { @@ -365,8 +368,9 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) { 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 @@ -393,10 +397,7 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) else { if (defaultAction != NULL) - { defaultAction->commandEvent(e); - //e->accept(); - } } }