QtiPlot 0.9.8.2
|
00001 /*************************************************************************** 00002 File : TextDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2004 - 2008 by Ion Vasilief 00006 Email (use @ for *) : ion_vasilief*yahoo.fr 00007 Description : Title/axis label options dialog 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 * This program is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU General Public License * 00024 * along with this program; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00026 * Boston, MA 02110-1301 USA * 00027 * * 00028 ***************************************************************************/ 00029 00030 #ifndef TEXTDLG_H 00031 #define TEXTDLG_H 00032 00033 #include <QDialog> 00034 class QGroupBox; 00035 class QTextEdit; 00036 class QTextCursor; 00037 class QComboBox; 00038 class QCheckBox; 00039 class QLabel; 00040 class QSpinBox; 00041 class Graph; 00042 class QwtScaleWidget; 00043 class ColorButton; 00044 class TextFormatButtons; 00045 00047 class TextDialog : public QDialog 00048 { 00049 Q_OBJECT 00050 00051 public: 00053 enum TextType{ 00054 AxisTitle, 00055 LayerTitle 00056 }; 00057 00059 00064 TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 ); 00065 00067 00070 int alignment(); 00071 00072 public slots: 00074 void setText(const QString & t); 00076 00080 void setAlignment(int align); 00081 void setGraph(Graph *g); 00082 00083 private slots: 00085 void customFont(); 00087 void apply(); 00088 00089 private: 00090 void formatLayerLabels(Graph *g); 00091 00093 QFont selectedFont; 00094 TextType d_text_type; 00095 00096 ColorButton *colorBtn, *backgroundBtn; 00097 QPushButton *buttonFont; 00098 QComboBox *backgroundBox; 00099 QPushButton *buttonCancel; 00100 QPushButton *buttonApply; 00101 QTextEdit *textEditBox; 00102 QGroupBox *groupBox1, *groupBox2; 00103 QComboBox *alignmentBox; 00104 TextFormatButtons *formatButtons; 00105 QComboBox *formatApplyToBox; 00106 QSpinBox *distanceBox; 00107 QCheckBox *invertTitleBox; 00108 00109 Graph *d_graph; 00110 QwtScaleWidget *d_scale; 00111 }; 00112 00113 #endif // TEXTDLG_H