#include "qg_actionhandler.h"
+#include "rs_commandevent.h"
#include "commands.h"
#include "rs_actionblocksadd.h"
#include "rs_actionblocksattributes.h"
#include "rs_actioninfodist2.h"
#include "rs_actioninfoinside.h"
#include "rs_actioninfototallength.h"
+#include "rs_actioninterface.h"
#include "rs_actionlayersadd.h"
#include "rs_actionlayersedit.h"
#include "rs_actionlayersfreezeall.h"
*/
void QG_ActionHandler::killSelectActions()
{
- RS_GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindow->getGraphicView();
if (gv != NULL)
gv->killSelectActions();
*/
RS_ActionInterface * QG_ActionHandler::getCurrentAction()
{
- RS_GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindow->getGraphicView();
- if (gv != NULL)
+ if (gv)
return gv->getCurrentAction();
- else
- return NULL;
+
+ return NULL;
}
#if 0
Instead of the following giant switch statement, you could something like the following:
RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS_ActionInterface * action)
{
- RS_GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindow->getGraphicView();
RS_Document * doc = mainWindow->getDocument();
// only global options are allowed without a document:
Hmmm.... We need gv & doc *before* we call this...
+What you'd do then is have the form of the thing worked ahead of time and the function
+itself would create the gv & doc. So for the EditUndo, we'd have:
+ FunctionCreateAction(bool);
+ FunctionCreateAction(void);
+
+Well... The problem is the action, they're all different...
#endif
/**
{
RS_DEBUG->print("QG_ActionHandler::setCurrentAction()");
- RS_GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindow->getGraphicView();
RS_Document * doc = mainWindow->getDocument();
RS_ActionInterface * a = NULL;
// pass keycode on to running action:
//RS_keycodeEvent e(cmd);
- //RS_GraphicView* gv = mainWindow->getGraphicView();
+ //GraphicView* gv = mainWindow->getGraphicView();
//if (gv!=NULL) {
// gv->keycodeEvent(&e);
//}
if (c == "\n")
{
- RS_GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindow->getGraphicView();
if (gv != NULL)
gv->back();
// pass command on to running action:
RS_CommandEvent e(cmd);
- RS_GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindow->getGraphicView();
if (gv != NULL)
{