EnrichmentDialog.h
Go to the documentation of this file.
/***************************************************************************
File : EnrichmentDialog.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2008 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : A general properties dialog for the FrameWidget, using article
"Using a Simple Web Service with Qt" in Qt Quaterly, Issue 23, Q3 2007
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef TEXWIDGETDIALOG_H
#define TEXWIDGETDIALOG_H
#include <QDialog>
#include <QProcess>
class QComboBox;
class QGroupBox;
class QHttp;
class QLabel;
class QPushButton;
class QTextEdit;
class QTabWidget;
class QCheckBox;
class QLineEdit;
class QCheckBox;
class QSpinBox;
class QSlider;
class QNetworkProxy;
class Graph;
class FrameWidget;
class LegendWidget;
class ColorButton;
class DoubleSpinBox;
class PatternBox;
class PenStyleBox;
class RectangleWidget;
class TextFormatButtons;
class ApplicationWindow;
class EnrichmentDialog : public QDialog
{
Q_OBJECT
public:
enum WidgetType{Frame, Text, Image, Tex, MDIWindow, Ellipse};
EnrichmentDialog(WidgetType wt, Graph *g, ApplicationWindow *app, QWidget *parent = 0);
~EnrichmentDialog();
void setWidget(QWidget *w);
void accept (){return apply();};
private slots:
void clearForm();
void fetchImage();
void updateForm(bool error);
void apply();
void customButtons(QWidget *w);
void chooseImageFile(const QString& fn = QString::null);
void displayCoordinates(int unit);
void adjustHeight(double width);
void adjustWidth(double height);
void saveImagesInternally(bool save);
void setBestSize();
void frameApplyTo();
void patternApplyTo();
void textFormatApplyTo();
void customFont();
void updateTransparency(int alpha);
void setTextDefaultValues();
void setFrameDefaultValues();
void setRectangleDefaultValues();
void finishedCompiling(int, QProcess::ExitStatus);
void displayCompileError(QProcess::ProcessError error);
void createImage();
void updateCompilerInterface(int);
void updateButtons();
private:
void initTextPage();
void initEditorPage();
void initImagePage();
void initFramePage();
void initGeometryPage();
void initPatternPage();
void setCoordinates(int unit);
void setFrameTo(FrameWidget *fw);
void setPatternTo(FrameWidget *r);
void setTextFormatTo(LegendWidget *l);
void setText(QTextEdit *editor, const QString & t);
QString createTempTexFile();
ApplicationWindow *d_app;
QHttp *http;
QProcess *compileProcess, *dvipngProcess;
QLabel *outputLabel;
QPushButton *clearButton;
QPushButton *updateButton;
QPushButton *cancelButton;
QPushButton *bestSizeButton;
QTextEdit *equationEditor, *textEditBox;
QComboBox *frameBox;
QTabWidget* tabWidget;
QWidget *editPage, *framePage, *geometryPage, *imagePage, *patternPage, *textPage;
ColorButton *frameColorBtn, *backgroundColorBtn, *patternColorBtn;
QCheckBox *boxSaveImagesInternally;
QLineEdit *imagePathBox;
DoubleSpinBox *xBox, *yBox, *widthBox, *heightBox, *boxFrameWidth;
QComboBox *unitBox;
PenStyleBox *boxFrameLineStyle;
QCheckBox *keepAspectBox, *useFrameColorBox;
QSpinBox *boxTransparency, *boxTextAngle;
PatternBox *patternBox;
QPushButton *textApplyToBtn;
QComboBox *frameApplyToBox, *patternApplyToBox, *textApplyToBox;
ColorButton *textColorBtn, *textBackgroundBtn;
QPushButton *textFontBtn;
QSpinBox *boxBackgroundTransparency;
QSlider *transparencySlider, *fillTransparencySlider;
TextFormatButtons *formatButtons, *texFormatButtons;
QPushButton *textDefaultBtn, *frameDefaultBtn, *rectangleDefaultBtn;
QCheckBox *autoUpdateTextBox, *texOutputBox;
QComboBox *texCompilerBox;
QComboBox* attachToBox;
QFont textFont;
Graph *d_plot;
QWidget *d_widget;
WidgetType d_widget_type;
double aspect_ratio;
};
#endif
EnrichmentDialog::patternApplyTo
void patternApplyTo()
Definition: EnrichmentDialog.cpp:1017
EnrichmentDialog::clearButton
QPushButton * clearButton
Definition: EnrichmentDialog.h:120
EnrichmentDialog::d_plot
Graph * d_plot
Definition: EnrichmentDialog.h:151
EnrichmentDialog::initEditorPage
void initEditorPage()
Definition: EnrichmentDialog.cpp:109
EnrichmentDialog::http
QHttp * http
Definition: EnrichmentDialog.h:116
EnrichmentDialog::boxFrameLineStyle
PenStyleBox * boxFrameLineStyle
Definition: EnrichmentDialog.h:133
EnrichmentDialog::createTempTexFile
QString createTempTexFile()
Definition: EnrichmentDialog.cpp:716
EnrichmentDialog::finishedCompiling
void finishedCompiling(int, QProcess::ExitStatus)
Definition: EnrichmentDialog.cpp:1280
EnrichmentDialog::setFrameTo
void setFrameTo(FrameWidget *fw)
Definition: EnrichmentDialog.cpp:1008
EnrichmentDialog::Tex
Definition: EnrichmentDialog.h:67
EnrichmentDialog::textApplyToBtn
QPushButton * textApplyToBtn
Definition: EnrichmentDialog.h:137
EnrichmentDialog::textDefaultBtn
QPushButton * textDefaultBtn
Definition: EnrichmentDialog.h:144
EnrichmentDialog::editPage
QWidget * editPage
Definition: EnrichmentDialog.h:127
EnrichmentDialog::initPatternPage
void initPatternPage()
Definition: EnrichmentDialog.cpp:373
EnrichmentDialog::texFormatButtons
TextFormatButtons * texFormatButtons
Definition: EnrichmentDialog.h:143
EnrichmentDialog::texOutputBox
QCheckBox * texOutputBox
Definition: EnrichmentDialog.h:145
EnrichmentDialog::rectangleDefaultBtn
QPushButton * rectangleDefaultBtn
Definition: EnrichmentDialog.h:144
EnrichmentDialog::accept
void accept()
Definition: EnrichmentDialog.h:73
EnrichmentDialog::patternApplyToBox
QComboBox * patternApplyToBox
Definition: EnrichmentDialog.h:138
EnrichmentDialog::outputLabel
QLabel * outputLabel
Definition: EnrichmentDialog.h:119
Graph
A 2D-plotting widget.
Definition: Graph.h:123
EnrichmentDialog::autoUpdateTextBox
QCheckBox * autoUpdateTextBox
Definition: EnrichmentDialog.h:145
EnrichmentDialog::frameDefaultBtn
QPushButton * frameDefaultBtn
Definition: EnrichmentDialog.h:144
EnrichmentDialog::apply
void apply()
Definition: EnrichmentDialog.cpp:687
EnrichmentDialog::attachToBox
QComboBox * attachToBox
Definition: EnrichmentDialog.h:147
EnrichmentDialog::setRectangleDefaultValues
void setRectangleDefaultValues()
Definition: EnrichmentDialog.cpp:1231
EnrichmentDialog::initTextPage
void initTextPage()
Definition: EnrichmentDialog.cpp:151
EnrichmentDialog::WidgetType
WidgetType
Definition: EnrichmentDialog.h:67
RectangleWidget
Definition: RectangleWidget.h:34
EnrichmentDialog::patternPage
QWidget * patternPage
Definition: EnrichmentDialog.h:127
EnrichmentDialog::Ellipse
Definition: EnrichmentDialog.h:67
ColorButton
A customized QtColorPicker used for color selection.
Definition: ColorButton.h:39
EnrichmentDialog::bestSizeButton
QPushButton * bestSizeButton
Definition: EnrichmentDialog.h:123
EnrichmentDialog::frameColorBtn
ColorButton * frameColorBtn
Definition: EnrichmentDialog.h:128
EnrichmentDialog::setTextFormatTo
void setTextFormatTo(LegendWidget *l)
Definition: EnrichmentDialog.cpp:1193
EnrichmentDialog::MDIWindow
Definition: EnrichmentDialog.h:67
EnrichmentDialog::setFrameDefaultValues
void setFrameDefaultValues()
Definition: EnrichmentDialog.cpp:1221
EnrichmentDialog::adjustWidth
void adjustWidth(double height)
Definition: EnrichmentDialog.cpp:923
EnrichmentDialog::boxSaveImagesInternally
QCheckBox * boxSaveImagesInternally
Definition: EnrichmentDialog.h:129
EnrichmentDialog::imagePage
QWidget * imagePage
Definition: EnrichmentDialog.h:127
EnrichmentDialog::yBox
DoubleSpinBox * yBox
Definition: EnrichmentDialog.h:131
EnrichmentDialog::updateForm
void updateForm(bool error)
Definition: EnrichmentDialog.cpp:786
EnrichmentDialog::initGeometryPage
void initGeometryPage()
Definition: EnrichmentDialog.cpp:450
EnrichmentDialog::textFont
QFont textFont
Definition: EnrichmentDialog.h:149
EnrichmentDialog
Definition: EnrichmentDialog.h:62
EnrichmentDialog::textBackgroundBtn
ColorButton * textBackgroundBtn
Definition: EnrichmentDialog.h:139
EnrichmentDialog::textEditBox
QTextEdit * textEditBox
Definition: EnrichmentDialog.h:124
EnrichmentDialog::fetchImage
void fetchImage()
Definition: EnrichmentDialog.cpp:740
EnrichmentDialog::boxTextAngle
QSpinBox * boxTextAngle
Definition: EnrichmentDialog.h:135
EnrichmentDialog::textPage
QWidget * textPage
Definition: EnrichmentDialog.h:127
EnrichmentDialog::textFontBtn
QPushButton * textFontBtn
Definition: EnrichmentDialog.h:140
EnrichmentDialog::tabWidget
QTabWidget * tabWidget
Definition: EnrichmentDialog.h:126
DoubleSpinBox
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
EnrichmentDialog::setWidget
void setWidget(QWidget *w)
Definition: EnrichmentDialog.cpp:562
EnrichmentDialog::boxTransparency
QSpinBox * boxTransparency
Definition: EnrichmentDialog.h:135
EnrichmentDialog::updateButtons
void updateButtons()
Definition: EnrichmentDialog.cpp:1382
EnrichmentDialog::keepAspectBox
QCheckBox * keepAspectBox
Definition: EnrichmentDialog.h:134
FrameWidget
Definition: FrameWidget.h:38
ApplicationWindow
QtiPlot's main window.
Definition: ApplicationWindow.h:133
EnrichmentDialog::customButtons
void customButtons(QWidget *w)
Definition: EnrichmentDialog.cpp:550
EnrichmentDialog::framePage
QWidget * framePage
Definition: EnrichmentDialog.h:127
EnrichmentDialog::setCoordinates
void setCoordinates(int unit)
Definition: EnrichmentDialog.cpp:856
EnrichmentDialog::chooseImageFile
void chooseImageFile(const QString &fn=QString::null)
Definition: EnrichmentDialog.cpp:813
EnrichmentDialog::widthBox
DoubleSpinBox * widthBox
Definition: EnrichmentDialog.h:131
EnrichmentDialog::saveImagesInternally
void saveImagesInternally(bool save)
Definition: EnrichmentDialog.cpp:837
EnrichmentDialog::setPatternTo
void setPatternTo(FrameWidget *r)
Definition: EnrichmentDialog.cpp:1073
EnrichmentDialog::dvipngProcess
QProcess * dvipngProcess
Definition: EnrichmentDialog.h:117
EnrichmentDialog::Text
Definition: EnrichmentDialog.h:67
EnrichmentDialog::texCompilerBox
QComboBox * texCompilerBox
Definition: EnrichmentDialog.h:146
LegendWidget
Definition: LegendWidget.h:42
EnrichmentDialog::adjustHeight
void adjustHeight(double width)
Definition: EnrichmentDialog.cpp:913
EnrichmentDialog::unitBox
QComboBox * unitBox
Definition: EnrichmentDialog.h:132
EnrichmentDialog::textFormatApplyTo
void textFormatApplyTo()
Definition: EnrichmentDialog.cpp:1128
EnrichmentDialog::d_app
ApplicationWindow * d_app
Definition: EnrichmentDialog.h:115
EnrichmentDialog::setText
void setText(QTextEdit *editor, const QString &t)
Definition: EnrichmentDialog.cpp:1087
EnrichmentDialog::xBox
DoubleSpinBox * xBox
Definition: EnrichmentDialog.h:131
EnrichmentDialog::cancelButton
QPushButton * cancelButton
Definition: EnrichmentDialog.h:122
EnrichmentDialog::textApplyToBox
QComboBox * textApplyToBox
Definition: EnrichmentDialog.h:138
EnrichmentDialog::compileProcess
QProcess * compileProcess
Definition: EnrichmentDialog.h:117
PatternBox
A modified QComboBox allowing to choose a Qt::BrushStyle style.
Definition: PatternBox.h:38
EnrichmentDialog::transparencySlider
QSlider * transparencySlider
Definition: EnrichmentDialog.h:142
EnrichmentDialog::heightBox
DoubleSpinBox * heightBox
Definition: EnrichmentDialog.h:131
EnrichmentDialog::formatButtons
TextFormatButtons * formatButtons
Definition: EnrichmentDialog.h:143
EnrichmentDialog::clearForm
void clearForm()
Definition: EnrichmentDialog.cpp:681
EnrichmentDialog::updateTransparency
void updateTransparency(int alpha)
Definition: EnrichmentDialog.cpp:1122
EnrichmentDialog::createImage
void createImage()
Definition: EnrichmentDialog.cpp:1248
EnrichmentDialog::textColorBtn
ColorButton * textColorBtn
Definition: EnrichmentDialog.h:139
EnrichmentDialog::setBestSize
void setBestSize()
Definition: EnrichmentDialog.cpp:933
EnrichmentDialog::imagePathBox
QLineEdit * imagePathBox
Definition: EnrichmentDialog.h:130
TextFormatButtons
Widget with text format buttons (connected to a QTextEdit)
Definition: TextFormatButtons.h:38
EnrichmentDialog::frameBox
QComboBox * frameBox
Definition: EnrichmentDialog.h:125
EnrichmentDialog::initImagePage
void initImagePage()
Definition: EnrichmentDialog.cpp:253
EnrichmentDialog::backgroundColorBtn
ColorButton * backgroundColorBtn
Definition: EnrichmentDialog.h:128
EnrichmentDialog::displayCoordinates
void displayCoordinates(int unit)
Definition: EnrichmentDialog.cpp:878
EnrichmentDialog::d_widget
QWidget * d_widget
Definition: EnrichmentDialog.h:152
EnrichmentDialog::updateButton
QPushButton * updateButton
Definition: EnrichmentDialog.h:121
EnrichmentDialog::updateCompilerInterface
void updateCompilerInterface(int)
Definition: EnrichmentDialog.cpp:1376
EnrichmentDialog::~EnrichmentDialog
~EnrichmentDialog()
Definition: EnrichmentDialog.cpp:1390
EnrichmentDialog::boxBackgroundTransparency
QSpinBox * boxBackgroundTransparency
Definition: EnrichmentDialog.h:141
EnrichmentDialog::boxFrameWidth
DoubleSpinBox * boxFrameWidth
Definition: EnrichmentDialog.h:131
EnrichmentDialog::aspect_ratio
double aspect_ratio
Definition: EnrichmentDialog.h:154
EnrichmentDialog::frameApplyToBox
QComboBox * frameApplyToBox
Definition: EnrichmentDialog.h:138
EnrichmentDialog::Frame
Definition: EnrichmentDialog.h:67
EnrichmentDialog::patternBox
PatternBox * patternBox
Definition: EnrichmentDialog.h:136
EnrichmentDialog::fillTransparencySlider
QSlider * fillTransparencySlider
Definition: EnrichmentDialog.h:142
EnrichmentDialog::setTextDefaultValues
void setTextDefaultValues()
Definition: EnrichmentDialog.cpp:1206
EnrichmentDialog::Image
Definition: EnrichmentDialog.h:67
EnrichmentDialog::customFont
void customFont()
Definition: EnrichmentDialog.cpp:1109
PenStyleBox
A modified QComboBox allowing to choose a Qt::PenStyle.
Definition: PenStyleBox.h:38
EnrichmentDialog::geometryPage
QWidget * geometryPage
Definition: EnrichmentDialog.h:127
EnrichmentDialog::d_widget_type
WidgetType d_widget_type
Definition: EnrichmentDialog.h:153
EnrichmentDialog::patternColorBtn
ColorButton * patternColorBtn
Definition: EnrichmentDialog.h:128
EnrichmentDialog::equationEditor
QTextEdit * equationEditor
Definition: EnrichmentDialog.h:124
EnrichmentDialog::useFrameColorBox
QCheckBox * useFrameColorBox
Definition: EnrichmentDialog.h:134
EnrichmentDialog::frameApplyTo
void frameApplyTo()
Definition: EnrichmentDialog.cpp:952
EnrichmentDialog::initFramePage
void initFramePage()
Definition: EnrichmentDialog.cpp:288
EnrichmentDialog::EnrichmentDialog
EnrichmentDialog(WidgetType wt, Graph *g, ApplicationWindow *app, QWidget *parent=0)
Definition: EnrichmentDialog.cpp:54
EnrichmentDialog::displayCompileError
void displayCompileError(QProcess::ProcessError error)
Definition: EnrichmentDialog.cpp:1320