Go to the documentation of this file.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
00031 #ifndef TEXWIDGETDIALOG_H
00032 #define TEXWIDGETDIALOG_H
00033
00034 #include <QDialog>
00035 #include <QProcess>
00036
00037 class QComboBox;
00038 class QGroupBox;
00039 class QHttp;
00040 class QLabel;
00041 class QPushButton;
00042 class QTextEdit;
00043 class QTabWidget;
00044 class QCheckBox;
00045 class QLineEdit;
00046 class QCheckBox;
00047 class QSpinBox;
00048 class QNetworkProxy;
00049
00050 class Graph;
00051 class FrameWidget;
00052 class LegendWidget;
00053 class ColorButton;
00054 class DoubleSpinBox;
00055 class PatternBox;
00056 class PenStyleBox;
00057 class RectangleWidget;
00058 class TextFormatButtons;
00059
00060 class EnrichmentDialog : public QDialog
00061 {
00062 Q_OBJECT
00063
00064 public:
00065 enum WidgetType{Frame, Text, Image, Tex, MDIWindow, Ellipse};
00066
00067 EnrichmentDialog(WidgetType wt, Graph *g, QWidget *parent = 0);
00068 ~EnrichmentDialog();
00069
00070 void setWidget(QWidget *w);
00071
00072 private slots:
00073 void clearForm();
00074 void fetchImage();
00075 void updateForm(bool error);
00076 void apply();
00077 void customButtons(QWidget *w);
00078 void chooseImageFile(const QString& fn = QString::null);
00079 void displayCoordinates(int unit);
00080 void adjustHeight(double width);
00081 void adjustWidth(double height);
00082 void saveImagesInternally(bool save);
00083 void setBestSize();
00084 void frameApplyTo();
00085 void patternApplyTo();
00086 void textFormatApplyTo();
00087 void customFont();
00088 void updateTransparency(int alpha);
00089 void setTextDefaultValues();
00090 void setFrameDefaultValues();
00091 void setRectangleDefaultValues();
00092 void finishedCompiling(int, QProcess::ExitStatus);
00093 void displayCompileError(QProcess::ProcessError error);
00094 void createImage();
00095 void updateCompilerInterface(int);
00096 void updateButtons();
00097
00098 private:
00099 void initTextPage();
00100 void initEditorPage();
00101 void initImagePage();
00102 void initFramePage();
00103 void initGeometryPage();
00104 void initPatternPage();
00105 void setCoordinates(int unit);
00106 void setFrameTo(FrameWidget *fw);
00107 void setPatternTo(FrameWidget *r);
00108 void setTextFormatTo(LegendWidget *l);
00109 void setText(QTextEdit *editor, const QString & t);
00110 QString createTempTexFile();
00111
00112 QHttp *http;
00113 QProcess *compileProcess, *dvipngProcess;
00114
00115 QLabel *outputLabel;
00116 QPushButton *clearButton;
00117 QPushButton *updateButton;
00118 QPushButton *cancelButton;
00119 QPushButton *bestSizeButton;
00120 QTextEdit *equationEditor, *textEditBox;
00121 QComboBox *frameBox;
00122 QTabWidget* tabWidget;
00123 QWidget *editPage, *framePage, *geometryPage, *imagePage, *patternPage, *textPage;
00124 ColorButton *frameColorBtn, *backgroundColorBtn, *patternColorBtn;
00125 QCheckBox *boxSaveImagesInternally;
00126 QLineEdit *imagePathBox;
00127 DoubleSpinBox *xBox, *yBox, *widthBox, *heightBox, *boxFrameWidth;
00128 QComboBox *unitBox;
00129 PenStyleBox *boxFrameLineStyle;
00130 QCheckBox *keepAspectBox, *useFrameColorBox;
00131 QSpinBox *boxTransparency, *boxTextAngle;
00132 PatternBox *patternBox;
00133 QPushButton *textApplyToBtn;
00134 QComboBox *frameApplyToBox, *patternApplyToBox, *textApplyToBox;
00135 ColorButton *textColorBtn, *textBackgroundBtn;
00136 QPushButton *textFontBtn;
00137 QSpinBox *boxBackgroundTransparency;
00138 TextFormatButtons *formatButtons, *texFormatButtons;
00139 QPushButton *textDefaultBtn, *frameDefaultBtn, *rectangleDefaultBtn;
00140 QCheckBox *autoUpdateTextBox, *texOutputBox;
00141 QComboBox *texCompilerBox;
00142 QComboBox* attachToBox;
00143
00144 QFont textFont;
00145
00146 Graph *d_plot;
00147 QWidget *d_widget;
00148 WidgetType d_widget_type;
00149 double aspect_ratio;
00150 };
00151
00152 #endif