3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/28/2010 Added this text. :-)
15 #include "rs_actionzoomin.h"
18 * Default constructor.
20 * @param direction In for zooming in, Out for zooming out.
21 * @param axis Axis that are affected by the zoom (OnlyX, OnlyY or Both)
23 RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer& container,
24 RS_GraphicView& graphicView, RS2::ZoomDirection direction,
25 RS2::Axis axis, const Vector& center):
26 RS_ActionInterface("Zoom in", container, graphicView)
28 this->direction = direction;
30 this->center = center;
33 QAction * RS_ActionZoomIn::createGUIAction(RS2::ActionType type, QObject * /*parent*/)
37 if (type == RS2::ActionZoomIn)
39 action = new QAction(QIcon(":/res/zoomin.png"), tr("Zoom &In"), 0);
40 // action = new QAction(tr("Zoom in"), QPixmap::fromMimeSource("zoomin.png"),
41 // tr("Zoom &In"), QKeySequence(), NULL);
42 action->setStatusTip(tr("Zooms in"));
46 action = new QAction(QIcon(":/res/zoomout.png"), tr("Zoom &Out"), 0);
47 // action = new QAction(tr("Zoom out"), QPixmap::fromMimeSource("zoomout.png"),
48 // tr("Zoom &Out"), QKeySequence(), NULL);
49 action->setStatusTip(tr("Zooms out"));
55 void RS_ActionZoomIn::init(int status)
57 RS_ActionInterface::init(status);
61 void RS_ActionZoomIn::trigger()
66 if (direction == RS2::In)
68 graphicView->zoomInX();
72 graphicView->zoomOutX();
77 if (direction == RS2::In)
79 graphicView->zoomInY();
83 graphicView->zoomOutY();
88 if (direction == RS2::In)
90 graphicView->zoomIn(1.25, center);
94 graphicView->zoomOut(1.25, center);