]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionprintpreview.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionprintpreview.cpp
similarity index 55%
rename from src/actions/rs_actionprintpreview.cpp
rename to src/actions/actionprintpreview.cpp
index c3f274c8546fdacc44f556d98fe66f82802e49b6..d1c5fd111f482f36307ee44ccbc267ace4e581e9 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actionprintpreview.cpp
+// actionprintpreview.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
@@ -12,7 +12,7 @@
 // JLH  06/04/2010  Added this text. :-)
 //
 
-#include "rs_actionprintpreview.h"
+#include "actionprintpreview.h"
 
 #include "rs_dialogfactory.h"
 #include "drawing.h"
 /**
  * Constructor.
  */
-RS_ActionPrintPreview::RS_ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView):
-       RS_ActionInterface("Print Preview",
-               container, graphicView)
+ActionPrintPreview::ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView):
+       ActionInterface("Print Preview", container, graphicView)
 {
        showOptions();
 }
 
-RS_ActionPrintPreview::~RS_ActionPrintPreview()
+ActionPrintPreview::~ActionPrintPreview()
 {
 }
 
-/*virtual*/ RS2::ActionType RS_ActionPrintPreview::rtti()
+/*virtual*/ RS2::ActionType ActionPrintPreview::rtti()
 {
        return RS2::ActionPrintPreview;
 }
 
-void RS_ActionPrintPreview::init(int status)
+void ActionPrintPreview::init(int status)
 {
-       RS_ActionInterface::init(status);
+       ActionInterface::init(status);
        showOptions();
 }
 
-void RS_ActionPrintPreview::trigger()
+void ActionPrintPreview::trigger()
 {
 }
 
-void RS_ActionPrintPreview::mouseMoveEvent(QMouseEvent * e)
+void ActionPrintPreview::mouseMoveEvent(QMouseEvent * e)
 {
        switch (getStatus())
        {
        case Moving:
                v2 = graphicView->toGraph(e->x(), e->y());
 
-               if (graphic != NULL)
+               if (graphic)
                {
                        Vector pinsbase = graphic->getPaperInsertionBase();
-
                        double scale = graphic->getPaperScale();
-
                        graphic->setPaperInsertionBase(pinsbase - v2 * scale + v1 * scale);
                }
+
                v1 = v2;
                graphicView->redraw();
                break;
@@ -71,7 +69,7 @@ void RS_ActionPrintPreview::mouseMoveEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionPrintPreview::mousePressEvent(QMouseEvent * e)
+void ActionPrintPreview::mousePressEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
@@ -88,7 +86,7 @@ void RS_ActionPrintPreview::mousePressEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e)
+void ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e)
 {
        switch (getStatus())
        {
@@ -97,105 +95,104 @@ void RS_ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e)
                break;
 
        default:
-               //deleteSnapper();
                RS_DIALOGFACTORY->requestPreviousMenu();
                e->accept();
                break;
        }
 }
 
-void RS_ActionPrintPreview::coordinateEvent(Vector *)
+void ActionPrintPreview::coordinateEvent(Vector *)
 {
 }
 
-void RS_ActionPrintPreview::commandEvent(RS_CommandEvent *)
+void ActionPrintPreview::commandEvent(RS_CommandEvent *)
 {
 }
 
-QStringList RS_ActionPrintPreview::getAvailableCommands()
+QStringList ActionPrintPreview::getAvailableCommands()
 {
        QStringList cmd;
        return cmd;
 }
 
-void RS_ActionPrintPreview::showOptions()
+void ActionPrintPreview::showOptions()
 {
-       RS_ActionInterface::showOptions();
+       ActionInterface::showOptions();
 
        RS_DIALOGFACTORY->requestOptions(this, true);
 }
 
-void RS_ActionPrintPreview::hideOptions()
+void ActionPrintPreview::hideOptions()
 {
-       RS_ActionInterface::hideOptions();
+       ActionInterface::hideOptions();
 
        RS_DIALOGFACTORY->requestOptions(this, false);
 }
 
-void RS_ActionPrintPreview::updateMouseButtonHints()
+void ActionPrintPreview::updateMouseButtonHints()
 {
 }
 
-void RS_ActionPrintPreview::updateMouseCursor()
+void ActionPrintPreview::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::MovingHandCursor);
 }
 
-void RS_ActionPrintPreview::updateToolBar()
+void ActionPrintPreview::updateToolBar()
 {
 }
 
-void RS_ActionPrintPreview::center()
+void ActionPrintPreview::center()
 {
-       if (graphic != NULL)
+       if (graphic)
        {
                graphic->centerToPage();
                graphicView->redraw();
        }
 }
 
-void RS_ActionPrintPreview::fit()
+void ActionPrintPreview::fit()
 {
-       if (graphic != NULL)
+       if (graphic)
        {
                graphic->fitToPage();
                graphicView->redraw();
        }
 }
 
-void RS_ActionPrintPreview::setScale(double f)
+void ActionPrintPreview::setScale(double f)
 {
-       if (graphic != NULL)
+       if (graphic)
        {
                graphic->setPaperScale(f);
                graphicView->redraw();
        }
 }
 
-double RS_ActionPrintPreview::getScale()
+double ActionPrintPreview::getScale()
 {
        double ret = 1.0;
 
-       if (graphic != NULL)
+       if (graphic)
                ret = graphic->getPaperScale();
+
        return ret;
 }
 
-void RS_ActionPrintPreview::setBlackWhite(bool bw)
+void ActionPrintPreview::setBlackWhite(bool bw)
 {
        if (bw)
                graphicView->setDrawingMode(RS2::ModeBW);
        else
                graphicView->setDrawingMode(RS2::ModeFull);
+
        graphicView->redraw();
 }
 
-RS2::Unit RS_ActionPrintPreview::getUnit()
+RS2::Unit ActionPrintPreview::getUnit()
 {
-       if (graphic != NULL)
+       if (graphic)
                return graphic->getUnit();
-       else
-               return RS2::None;
-}
 
-// EOF
+       return RS2::None;
+}