Stellarium 0.14.3
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* fieldCcdRotation;
111  QGraphicsTextItem* fieldTelescopeName;
112  QGraphicsTextItem* fieldMagnification;
113  QGraphicsTextItem* fieldFov;
114 
115  //Sensor frame rotation controls
116  StelButton* rotateCcdMinus15Button;
117  StelButton* rotateCcdMinus5Button;
118  StelButton* rotateCcdMinus1Button;
119  StelButton* resetCcdRotationButton;
120  StelButton* rotateCcdPlus1Button;
121  StelButton* rotateCcdPlus5Button;
122  StelButton* rotateCcdPlus15Button;
123 
125  void setOcularControlsVisible(bool show);
126  void setCcdControlsVisible(bool show);
127  void setTelescopeControlsVisible(bool show);
128  void setLensControlsVisible(bool show);
130  void updateMainButtonsPositions();
131 
132  void setControlsColor(const QColor& color);
133  void setControlsFont(const QFont& font);
134 
135  static QPixmap createPixmapFromText(const QString& text,
136  int width,
137  int height,
138  const QFont& font,
139  const QColor& textColor,
140  const QColor& backgroundColor = QColor(0,0,0,0));
141 };
142 
143 #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.
void foldGui()
Hide the controls, leaving only the button bar.
Main class of the Oculars plug-in.
Definition: Oculars.hpp:75