#include "rs_actionzoomin.h"
+#include "graphicview.h"
+
/**
* Default constructor.
*
* @param direction In for zooming in, Out for zooming out.
* @param axis Axis that are affected by the zoom (OnlyX, OnlyY or Both)
*/
-RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer& container,
- RS_GraphicView& graphicView, RS2::ZoomDirection direction,
- RS2::Axis axis, const Vector& center):
+RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction, RS2::Axis axis, const Vector & center):
RS_ActionInterface("Zoom in", container, graphicView)
{
this->direction = direction;
this->center = center;
}
-QAction * RS_ActionZoomIn::createGUIAction(RS2::ActionType type, QObject * /*parent*/)
+RS_ActionZoomIn::~RS_ActionZoomIn()
{
- QAction * action;
-
- if (type == RS2::ActionZoomIn)
- {
- action = new QAction(QIcon(":/res/zoomin.png"), tr("Zoom &In"), 0);
-// action = new QAction(tr("Zoom in"), QPixmap::fromMimeSource("zoomin.png"),
-// tr("Zoom &In"), QKeySequence(), NULL);
- action->setStatusTip(tr("Zooms in"));
- }
- else
- {
- action = new QAction(QIcon(":/res/zoomout.png"), tr("Zoom &Out"), 0);
-// action = new QAction(tr("Zoom out"), QPixmap::fromMimeSource("zoomout.png"),
-// tr("Zoom &Out"), QKeySequence(), NULL);
- action->setStatusTip(tr("Zooms out"));
- }
-
- return action;
}
void RS_ActionZoomIn::init(int status)
switch (axis)
{
case RS2::OnlyX:
+
if (direction == RS2::In)
- {
graphicView->zoomInX();
- }
else
- {
graphicView->zoomOutX();
- }
break;
case RS2::OnlyY:
+
if (direction == RS2::In)
- {
graphicView->zoomInY();
- }
else
- {
graphicView->zoomOutY();
- }
break;
case RS2::Both:
+
if (direction == RS2::In)
- {
graphicView->zoomIn(1.25, center);
- }
else
- {
graphicView->zoomOut(1.25, center);
- }
break;
}