Isis 3 Programmer Reference
PanTool.h
1 #ifndef PanTool_h
2 #define PanTool_h
3 
4 #include "Tool.h"
5 
6 
7 class QComboBox;
8 class QLineEdit;
9 
10 namespace Isis {
18  class PanTool : public Tool {
19  Q_OBJECT
20 
21  public:
22  PanTool(QWidget *parent);
23  void addTo(QMenu *);
24 
25  QString menuName() const {
26  return "&View";
27  }
28 
29  protected:
31  QWidget *createToolBarWidget(QStackedWidget *parent);
32 
33  protected slots:
34  void mouseButtonPress(QPoint p, Qt::MouseButton s);
35  void mouseMove(QPoint p);
36  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
37 
38  private slots:
39  void panRight() {
40  pan(panRate(true), 0);
41  };
42  void panLeft() {
43  pan(-panRate(true), 0);
44  };
45  void panUp() {
46  pan(0, -panRate(false));
47  };
48  void panDown() {
49  pan(0, panRate(false));
50  };
51  void setCustom();
52  void updateLineEdit();
53  void writeSettings();
54  void readSettings();
55 
56  private:
57  void pan(int x, int y);
58  int panRate(bool horz);
59 
60  QAction *p_panRight;
61  QAction *p_panLeft;
62  QAction *p_panUp;
63  QAction *p_panDown;
64 
65  QComboBox *p_panRateBox;
66  QLineEdit *p_lineEdit;
67 
68  bool p_dragPan;
69  QPoint p_lastPoint;
70  };
71 };
72 
73 #endif
QWidget * createToolBarWidget(QStackedWidget *parent)
Anytime a tool is created, you must add it to the tool bar.
Definition: PanTool.cpp:67
void addTo(QMenu *)
Definition: PanTool.cpp:60
QString menuName() const
Anytime a tool is created, you must give it a name for the menu.
Definition: PanTool.h:25
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
QAction * toolPadAction(ToolPad *pad)
Anytime a tool is created, you must setup a tool pad action with it.
Definition: PanTool.cpp:48