2
Oculars plug-in for Stellarium: graphical user interface widget
3
Copyright (C) 2011 Bogdan Marinov
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.
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.
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.
20
#ifndef OCULARSGUIPANEL_HPP
21
#define OCULARSGUIPANEL_HPP
23
#include <QGraphicsWidget>
27
class QGraphicsLinearLayout;
28
class QGraphicsProxyWidget;
33
//! A screen widget similar to InfoPanel. Contains controls and information.
34
class OcularsGuiPanel : public QGraphicsWidget
39
OcularsGuiPanel(Oculars* ocularsPlugin,
40
QGraphicsWidget * parent = 0,
41
Qt::WindowFlags wFlags = 0);
45
//! Show only the controls used with an ocular overlay.
47
//! Show only the controls used with a CCD overlay.
49
//! Hide the controls, leaving only the button bar.
53
//! Update the position of the widget within the parent.
54
//! Tied to the parent's geometryChanged() signal.
55
void updatePosition();
57
//! Updates the information shown when an ocular overlay is displayed
58
void updateOcularControls();
59
//! Updates the information shown when a sensor overlay is displayed
60
void updateCcdControls();
61
//! Updates the information that depends on the current telescope.
62
//! Called in both updateOcularControls() and updateCcdControls().
63
void updateTelescopeControls();
65
//! Sets the color scheme (day/night mode)
66
void setColorScheme(const QString& schemeName);
69
Oculars* ocularsPlugin;
71
//! This is actually SkyGui. Perhaps it should be more specific?
72
QGraphicsWidget* parentWidget;
74
QGraphicsLinearLayout* mainLayout;
76
QGraphicsPathItem* borderPath;
78
//! Mini-toolbar holding StelButtons
79
QGraphicsWidget* buttonBar;
80
QGraphicsWidget* ocularControls;
81
QGraphicsWidget* ccdControls;
82
QGraphicsWidget* telescopeControls;
85
StelButton* buttonOcular;
86
StelButton* buttonCrosshairs;
87
StelButton* buttonCcd;
88
StelButton* buttonTelrad;
89
StelButton* buttonConfiguration;
92
StelButton* prevOcularButton;
93
StelButton* nextOcularButton;
94
StelButton* prevTelescopeButton;
95
StelButton* nextTelescopeButton;
96
StelButton* prevCcdButton;
97
StelButton* nextCcdButton;
98
QGraphicsTextItem* fieldOcularName;
99
QGraphicsTextItem* fieldOcularFl;
100
QGraphicsTextItem* fieldOcularAfov;
101
QGraphicsTextItem* fieldCcdName;
102
QGraphicsTextItem* fieldCcdDimensions;
103
QGraphicsTextItem* fieldCcdRotation;
104
QGraphicsTextItem* fieldTelescopeName;
105
QGraphicsTextItem* fieldMagnification;
106
QGraphicsTextItem* fieldFov;
108
//Sensor frame rotation controls
109
StelButton* rotateCcdMinus15Button;
110
StelButton* rotateCcdMinus5Button;
111
StelButton* rotateCcdMinus1Button;
112
StelButton* resetCcdRotationButton;
113
StelButton* rotateCcdPlus1Button;
114
StelButton* rotateCcdPlus5Button;
115
StelButton* rotateCcdPlus15Button;
117
//! Sets the visibility of the ocular name label and the associated buttons.
118
void setOcularControlsVisible(bool show);
119
void setCcdControlsVisible(bool show);
120
void setTelescopeControlsVisible(bool show);
121
//! Updates the positions of the buttons inside the button bar.
122
void updateMainButtonsPositions();
124
void setControlsColor(const QColor& color);
125
void setControlsFont(const QFont& font);
126
//! Sets the night mode flag on all StelButton-s.
127
void setButtonsNightMode(bool nightMode);
129
static QPixmap createPixmapFromText(const QString& text,
133
const QColor& textColor,
134
const QColor& backgroundColor = QColor(0,0,0,0));
137
#endif // OCULARSGUIPANEL_HPP