Stellarium 0.15.2
OcularsGuiPanel.hpp
1 /*
2 Oculars plug-in for Stellarium: graphical user interface widget
3 Copyright (C) 2011 Bogdan Marinov
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18 */
19 
20 #ifndef OCULARSGUIPANEL_HPP
21 #define OCULARSGUIPANEL_HPP
22 
23 #include <QGraphicsWidget>
24 
25 class Oculars;
26 class StelButton;
27 class QGraphicsLinearLayout;
28 class QGraphicsProxyWidget;
29 class QLabel;
30 class QPushButton;
31 class QWidget;
32 
35 class OcularsGuiPanel : public QGraphicsWidget
36 {
37  Q_OBJECT
38 
39 public:
40  OcularsGuiPanel(Oculars* ocularsPlugin,
41  QGraphicsWidget * parent = 0,
42  Qt::WindowFlags wFlags = 0);
43  ~OcularsGuiPanel();
44 
45 public slots:
47  void showOcularGui();
49  void showCcdGui();
51  void foldGui();
52 
53 private slots:
56  void updatePosition();
57 
59  void updateOcularControls();
61  void updateCcdControls();
64  void updateTelescopeControls();
66  void updateLensControls();
68  void setColorScheme(const QString& schemeName);
69 
70 private:
71  Oculars* ocularsPlugin;
72 
74  QGraphicsWidget* parentWidget;
75 
76  QGraphicsLinearLayout* mainLayout;
77 
78  QGraphicsPathItem* borderPath;
79 
81  QGraphicsWidget* buttonBar;
82  QGraphicsWidget* ocularControls;
83  QGraphicsWidget* lensControls;
84  QGraphicsWidget* ccdControls;
85  QGraphicsWidget* telescopeControls;
86 
87  //Mini-toolbar
88  StelButton* buttonOcular;
89  StelButton* buttonCrosshairs;
90  StelButton* buttonCcd;
91  StelButton* buttonTelrad;
92  StelButton* buttonConfiguration;
93 
94  //Information display
95  StelButton* prevOcularButton;
96  StelButton* nextOcularButton;
97  StelButton* prevTelescopeButton;
98  StelButton* nextTelescopeButton;
99  StelButton* prevCcdButton;
100  StelButton* nextCcdButton;
101  StelButton* prevLensButton;
102  StelButton* nextLensButton;
103  QGraphicsTextItem* fieldLensName;
104  QGraphicsTextItem* fieldLensMultipler;
105  QGraphicsTextItem* fieldOcularName;
106  QGraphicsTextItem* fieldOcularFl;
107  QGraphicsTextItem* fieldOcularAfov;
108  QGraphicsTextItem* fieldCcdName;
109  QGraphicsTextItem* fieldCcdDimensions;
110  QGraphicsTextItem* fieldCcdHScale;
111  QGraphicsTextItem* fieldCcdVScale;
112  QGraphicsTextItem* fieldCcdRotation;
113  QGraphicsTextItem* fieldTelescopeName;
114  QGraphicsTextItem* fieldMagnification;
115  QGraphicsTextItem* fieldExitPupil;
116  QGraphicsTextItem* fieldFov;
117 
118  //Sensor frame rotation controls
119  StelButton* rotateCcdMinus15Button;
120  StelButton* rotateCcdMinus5Button;
121  StelButton* rotateCcdMinus1Button;
122  StelButton* resetCcdRotationButton;
123  StelButton* rotateCcdPlus1Button;
124  StelButton* rotateCcdPlus5Button;
125  StelButton* rotateCcdPlus15Button;
126 
128  void setOcularControlsVisible(bool show);
129  void setCcdControlsVisible(bool show);
130  void setTelescopeControlsVisible(bool show);
131  void setLensControlsVisible(bool show);
133  void updateMainButtonsPositions();
134 
135  void setControlsColor(const QColor& color);
136  void setControlsFont(const QFont& font);
137 
138  static QPixmap createPixmapFromText(const QString& text,
139  int width,
140  int height,
141  const QFont& font,
142  const QColor& textColor,
143  const QColor& backgroundColor = QColor(0,0,0,0));
144 };
145 
146 #endif // OCULARSGUIPANEL_HPP
void showCcdGui()
Show only the controls used with a CCD overlay.
void showOcularGui()
Show only the controls used with an ocular overlay.
A screen widget similar to InfoPanel.
A Button Graphicsitem for use in Stellarium&#39;s graphic widgets.
void foldGui()
Hide the controls, leaving only the button bar.
Main class of the Oculars plug-in.
Definition: Oculars.hpp:75