1
/***************************************************************************
4
--------------------------------------------------------------------
5
Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6
Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7
Description : Text label/axis label options dialog
9
***************************************************************************/
11
/***************************************************************************
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
18
* This program is distributed in the hope that it will be useful, *
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21
* GNU General Public License for more details. *
23
* You should have received a copy of the GNU General Public License *
24
* along with this program; if not, write to the Free Software *
25
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26
* Boston, MA 02110-1301 USA *
28
***************************************************************************/
41
#include "ColorButton.h"
42
#include "TextFormatButtons.h"
44
//! Options dialog for text labels/axes labels
45
class TextDialog : public QDialog
52
TextMarker, /*!< normal text label */
53
AxisTitle /*!< axis label */
58
* \param type text type (TextMarker | AxisTitle)
59
* \param parent parent widget
60
* \param fl window flags
62
TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 );
66
//! Return axis label alignment
71
//! Return rotation angle (not yet implemented)
75
//! Set label background type
77
* \param bkg label background type
78
* 0 -> plain, no border
80
* 2 -> border + shadow
82
void setBackgroundType(int bkg);
83
//! Set rotation angle (not yet implemented)
84
void setAngle(int angle);
85
//! Set the background color to 'c'
86
void setBackgroundColor(QColor c);
87
//! Set the text color to 'c'
88
void setTextColor(QColor c);
89
//! Set the current font to 'fnt'
90
void setFont(const QFont& fnt);
91
//! Set the contents of the text editor box
92
void setText(const QString & t);
93
//! Set axis label alignment
95
* \param align alignment (can be -1 for invalid,
96
* Qt::AlignHCenter, Qt::AlignLeft, or Qt::AlignRight)
98
void setAlignment(int align);
101
//! Let the user select another font
103
//! Let the user pick the background color
104
void pickBackgroundColor();
105
//! Let the user pick the text color
106
void pickTextColor();
107
//! Accept changes and close dialog
111
void setDefaultValues();
113
void updateTransparency(int alpha);
116
//! Emit all current values
118
* \param text the label text
119
* \param angle the rotation angle
120
* \param bkg the background type
121
* \param fnt the text font
122
* \param textColor the text color
123
* \param backgroundColor the backgroundcolor
125
void values(const QString& text, int angle, int bkg, const QFont& fnt, const QColor& textColor, const QColor& backgroundColor);
127
//! Signal for axes labels: change text
128
void changeText(const QString &);
129
//! Signal for axes labels: change text color
130
void changeColor(const QColor &);
131
//! Signal for axes labels: change text alignment
132
void changeAlignment(int);
133
//! Signal for axes labels: change font
134
void changeFont(const QFont &);
141
ColorButton *colorBtn, *backgroundBtn;
142
QPushButton *buttonFont;
143
QComboBox *backgroundBox;
144
QPushButton *buttonOk;
145
QPushButton *buttonCancel;
146
QPushButton *buttonApply;
147
QPushButton *buttonDefault;
148
QComboBox *rotateBox;
149
QTextEdit *textEditBox;
150
QGroupBox *groupBox1, *groupBox2;
151
QComboBox *alignmentBox;
152
TextFormatButtons *formatButtons;
153
QSpinBox *boxBackgroundTransparency;