00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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