QtiPlot  0.9.8.2
TextDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : TextDialog.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2004 - 2008 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Title/axis label options dialog
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
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. *
17  * *
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. *
22  * *
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 *
27  * *
28  ***************************************************************************/
29 
30 #ifndef TEXTDLG_H
31 #define TEXTDLG_H
32 
33 #include <QDialog>
34 class QGroupBox;
35 class QTextEdit;
36 class QTextCursor;
37 class QComboBox;
38 class QCheckBox;
39 class QLabel;
40 class QSpinBox;
41 class Graph;
42 class QwtScaleWidget;
43 class ColorButton;
44 class TextFormatButtons;
45 
47 class TextDialog : public QDialog
48 {
49  Q_OBJECT
50 
51 public:
53  enum TextType{
56  };
57 
59 
64  TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 );
65 
67 
70  int alignment();
71 
72 public slots:
74  void setText(const QString & t);
76 
80  void setAlignment(int align);
81  void setGraph(Graph *g);
82 
83 private slots:
85  void customFont();
87  void apply();
88 
89 private:
90  void formatLayerLabels(Graph *g);
91 
93  QFont selectedFont;
95 
97  QPushButton *buttonFont;
98  QComboBox *backgroundBox;
99  QPushButton *buttonCancel;
100  QPushButton *buttonApply;
101  QTextEdit *textEditBox;
102  QGroupBox *groupBox1, *groupBox2;
103  QComboBox *alignmentBox;
105  QComboBox *formatApplyToBox;
106  QSpinBox *distanceBox;
107  QCheckBox *invertTitleBox;
108 
110  QwtScaleWidget *d_scale;
111 };
112 
113 #endif // TEXTDLG_H
QPushButton * buttonApply
Definition: TextDialog.h:100
void setGraph(Graph *g)
Definition: TextDialog.cpp:139
QFont selectedFont
current font
Definition: TextDialog.h:93
QwtScaleWidget * d_scale
Definition: TextDialog.h:110
A 2D-plotting widget.
Definition: Graph.h:123
Definition: TextDialog.h:55
A customized QtColorPicker used for color selection.
Definition: ColorButton.h:39
ColorButton * colorBtn
Definition: TextDialog.h:96
QGroupBox * groupBox1
Definition: TextDialog.h:102
QPushButton * buttonFont
Definition: TextDialog.h:97
TextType d_text_type
Definition: TextDialog.h:94
Definition: TextDialog.h:54
QSpinBox * distanceBox
Definition: TextDialog.h:106
ColorButton * backgroundBtn
Definition: TextDialog.h:96
QComboBox * backgroundBox
Definition: TextDialog.h:98
QGroupBox * groupBox2
Definition: TextDialog.h:102
int alignment()
Return axis label alignment.
Definition: TextDialog.cpp:326
TextFormatButtons * formatButtons
Definition: TextDialog.h:104
void customFont()
Let the user select another font.
Definition: TextDialog.cpp:363
QCheckBox * invertTitleBox
Definition: TextDialog.h:107
void apply()
Apply changes.
Definition: TextDialog.cpp:203
Widget with text format buttons (connected to a QTextEdit)
Definition: TextFormatButtons.h:38
void setAlignment(int align)
Set axis label alignment.
Definition: TextDialog.cpp:346
QComboBox * formatApplyToBox
Definition: TextDialog.h:105
TextDialog(TextType type, QWidget *parent=0, Qt::WFlags fl=0)
Constructor.
Definition: TextDialog.cpp:53
Options dialog for text labels/axes labels.
Definition: TextDialog.h:47
QPushButton * buttonCancel
Definition: TextDialog.h:99
void formatLayerLabels(Graph *g)
Definition: TextDialog.cpp:291
QTextEdit * textEditBox
Definition: TextDialog.h:101
Graph * d_graph
Definition: TextDialog.h:109
TextType
Label types.
Definition: TextDialog.h:53
QComboBox * alignmentBox
Definition: TextDialog.h:103
void setText(const QString &t)
Set the contents of the text editor box.
Definition: TextDialog.cpp:376