TextDialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : TextDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, thzs*gmx.net
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     
00041 #include "ColorButton.h"
00042 #include "TextFormatButtons.h"
00043 
00045 class TextDialog : public QDialog
00046 { 
00047     Q_OBJECT
00048 
00049 public:
00051     enum TextType{
00052         TextMarker, 
00053         AxisTitle   
00054     };
00055 
00057 
00062     TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 );
00064     ~TextDialog(){};
00065 
00067 
00070     int alignment();
00072     int angle();
00073 
00074 public slots:
00076 
00082     void setBackgroundType(int bkg);
00084     void setAngle(int angle);
00086     void setBackgroundColor(QColor c);
00088     void setTextColor(QColor c);
00090     void setFont(const QFont& fnt);
00092     void setText(const QString & t);
00094 
00098     void setAlignment(int align);
00099 
00100 private slots:
00102     void customFont();
00104     void pickBackgroundColor();
00106     void pickTextColor();
00108     void accept();
00110     void apply();
00111     void setDefaultValues();
00112 
00113     void updateTransparency(int alpha);
00114 
00115 signals:
00117 
00125     void values(const QString& text, int angle, int bkg, const QFont& fnt, const QColor& textColor, const QColor& backgroundColor);
00126     
00128     void changeText(const QString &);
00130     void changeColor(const QColor &);
00132     void changeAlignment(int);
00134     void changeFont(const QFont &);
00135 
00136 protected:
00138     QFont selectedFont;
00139     TextType textType;
00140 
00141     ColorButton *colorBtn, *backgroundBtn;
00142     QPushButton *buttonFont;
00143     QComboBox *backgroundBox;
00144     QPushButton *buttonOk;
00145     QPushButton *buttonCancel;
00146     QPushButton *buttonApply;
00147     QPushButton *buttonDefault;
00148     QComboBox *rotateBox;
00149     QTextEdit *textEditBox;
00150     QGroupBox *groupBox1, *groupBox2;
00151     QComboBox *alignmentBox;
00152     TextFormatButtons *formatButtons;
00153     QSpinBox *boxBackgroundTransparency;
00154 };
00155 
00156 #endif // TEXTDLG_H

Generated on Mon Oct 15 06:11:42 2007 for QtiPlot by  doxygen 1.5.3