casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ColorPreferences.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 #ifndef HISTOGRAM_COLOR_PREFERENCES_QO_H_2
26 #define HISTOGRAM_COLOR_PREFERENCES_QO_H_2
27 
28 #include <QDialog>
29 
30 #include <guitools/Histogram/ColorPreferences.ui.h>
31 
32 class QSettings;
33 
34 namespace casa {
35 
41 class ColorPreferences : public QDialog {
42  Q_OBJECT
43 
44 public:
45  ColorPreferences(QWidget *parent = 0);
46  void setFitColorsVisible( bool visible );
47  void setMultipleHistogramColorsVisible( bool visible );
48  QColor getHistogramColor() const;
49  QColor getFitEstimateColor() const;
50  QColor getFitCurveColor() const;
51  QList<QColor> getMultipleHistogramColors() const;
53 
54 signals:
55  void colorsChanged();
56 
57 private slots:
58  void colorsAccepted();
59  void colorsRejected();
60  void selectHistogramColor();
61  void selectFitCurveColor();
63  void addHistogramColor();
64  void deleteHistogramColor();
65 
66 private:
67  void initializeUserColors();
68  QString readCustomColor( QSettings& settings, const QString& identifier, const QString& colorDefaultName);
69  void readCustomColorList( QSettings& settings );
70  void setButtonColor( QPushButton* button, QColor color );
71  void addColorToList( QColor color );
72  QColor getButtonColor( QPushButton* button ) const;
73  void showColorDialog( QPushButton* source );
74  void persistColorList( QSettings& settings );
75  void persistColors();
76  void resetColors();
77 
80  QColor fitCurveColor;
81  QList<QString> multipleHistogramColors;
82  Ui::ColorPreferencesClass ui;
83  static const QString APPLICATION;
84  static const QString ORGANIZATION;
85  static const QString HISTOGRAM_COLOR;
86  static const QString FIT_ESTIMATE_COLOR;
87  static const QString FIT_CURVE_COLOR;
88  static const QString MULTIPLE_HISTOGRAM_COLORS;
89 };
90 }
91 #endif // PREFERENCESCOLOR_QO_H
QList< QString > multipleHistogramColors
QString readCustomColor(QSettings &settings, const QString &identifier, const QString &colorDefaultName)
Allows user specification of the colors used in drawing the histogram and pluggable functionality...
void setMultipleHistogramColorsVisible(bool visible)
ColorPreferences(QWidget *parent=0)
void readCustomColorList(QSettings &settings)
QList< QColor > getMultipleHistogramColors() const
static const QString FIT_ESTIMATE_COLOR
static const QString MULTIPLE_HISTOGRAM_COLORS
QColor getFitCurveColor() const
static const QString APPLICATION
QColor getButtonColor(QPushButton *button) const
void setButtonColor(QPushButton *button, QColor color)
static const QString ORGANIZATION
static const QString FIT_CURVE_COLOR
QColor getFitEstimateColor() const
void showColorDialog(QPushButton *source)
static const QString HISTOGRAM_COLOR
void addColorToList(QColor color)
void setFitColorsVisible(bool visible)
void persistColorList(QSettings &settings)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
QColor getHistogramColor() const
Ui::ColorPreferencesClass ui