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 : Text label/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 QLabel; 00039 class QSpinBox; 00040 class QCheckBox; 00041 class LegendWidget; 00042 class Graph; 00043 class QwtScaleWidget; 00044 00045 #include "ColorButton.h" 00046 #include "TextFormatButtons.h" 00047 00049 class TextDialog : public QDialog 00050 { 00051 Q_OBJECT 00052 00053 public: 00055 enum TextType{ 00056 TextMarker, 00057 AxisTitle, 00058 LayerTitle 00059 }; 00060 00062 00067 TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 ); 00068 00070 00073 int alignment(); 00074 00075 public slots: 00077 void setText(const QString & t); 00079 00083 void setAlignment(int align); 00084 void setGraph(Graph *g); 00085 void setLegendWidget(LegendWidget *); 00086 00087 private slots: 00089 void customFont(); 00091 void accept(); 00093 void apply(); 00094 void setDefaultValues(); 00095 00096 void updateTransparency(int alpha); 00097 00098 protected: 00099 void formatAllLabels(); 00100 00102 QFont selectedFont; 00103 TextType textType; 00104 00105 ColorButton *colorBtn, *backgroundBtn; 00106 QPushButton *buttonFont; 00107 QComboBox *backgroundBox; 00108 QPushButton *buttonOk; 00109 QPushButton *buttonCancel; 00110 QPushButton *buttonApply; 00111 QPushButton *buttonDefault; 00112 QComboBox *rotateBox; 00113 QTextEdit *textEditBox; 00114 QGroupBox *groupBox1, *groupBox2; 00115 QComboBox *alignmentBox; 00116 TextFormatButtons *formatButtons; 00117 QSpinBox *boxBackgroundTransparency; 00118 QCheckBox *boxApplyToAll; 00119 00120 LegendWidget *d_legend; 00121 Graph *d_graph; 00122 QwtScaleWidget *d_scale; 00123 }; 00124 00125 #endif // TEXTDLG_H