TextDialog.h
Go to the documentation of this file.
/***************************************************************************
File : TextDialog.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2004 - 2008 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Title/axis label options dialog
***************************************************************************/
/***************************************************************************
* *
* 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 TEXTDLG_H
#define TEXTDLG_H
#include <QDialog>
class QGroupBox;
class QTextEdit;
class QTextCursor;
class QComboBox;
class QCheckBox;
class QLabel;
class QSpinBox;
class Graph;
class QwtScaleWidget;
class ColorButton;
class TextFormatButtons;
class TextDialog : public QDialog
{
Q_OBJECT
public:
enum TextType{
AxisTitle,
LayerTitle
};
TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 );
int alignment();
public slots:
void setText(const QString & t);
void setAlignment(int align);
void setGraph(Graph *g);
private slots:
void customFont();
void apply();
private:
void formatLayerLabels(Graph *g);
QFont selectedFont;
TextType d_text_type;
ColorButton *colorBtn, *backgroundBtn;
QPushButton *buttonFont;
QComboBox *backgroundBox;
QPushButton *buttonCancel;
QPushButton *buttonApply;
QTextEdit *textEditBox;
QGroupBox *groupBox1, *groupBox2;
QComboBox *alignmentBox;
TextFormatButtons *formatButtons;
QComboBox *formatApplyToBox;
QSpinBox *distanceBox;
QCheckBox *invertTitleBox;
Graph *d_graph;
QwtScaleWidget *d_scale;
};
#endif // TEXTDLG_H
TextDialog::buttonApply
QPushButton * buttonApply
Definition: TextDialog.h:100
TextDialog::setGraph
void setGraph(Graph *g)
Definition: TextDialog.cpp:139
TextDialog::selectedFont
QFont selectedFont
current font
Definition: TextDialog.h:93
TextDialog::d_scale
QwtScaleWidget * d_scale
Definition: TextDialog.h:110
Graph
A 2D-plotting widget.
Definition: Graph.h:123
TextDialog::LayerTitle
Definition: TextDialog.h:55
ColorButton
A customized QtColorPicker used for color selection.
Definition: ColorButton.h:39
TextDialog::colorBtn
ColorButton * colorBtn
Definition: TextDialog.h:96
TextDialog::groupBox1
QGroupBox * groupBox1
Definition: TextDialog.h:102
TextDialog::buttonFont
QPushButton * buttonFont
Definition: TextDialog.h:97
TextDialog::d_text_type
TextType d_text_type
Definition: TextDialog.h:94
TextDialog::AxisTitle
Definition: TextDialog.h:54
TextDialog::distanceBox
QSpinBox * distanceBox
Definition: TextDialog.h:106
TextDialog::backgroundBtn
ColorButton * backgroundBtn
Definition: TextDialog.h:96
TextDialog::backgroundBox
QComboBox * backgroundBox
Definition: TextDialog.h:98
TextDialog::groupBox2
QGroupBox * groupBox2
Definition: TextDialog.h:102
TextDialog::alignment
int alignment()
Return axis label alignment.
Definition: TextDialog.cpp:326
TextDialog::formatButtons
TextFormatButtons * formatButtons
Definition: TextDialog.h:104
TextDialog::customFont
void customFont()
Let the user select another font.
Definition: TextDialog.cpp:363
TextDialog::invertTitleBox
QCheckBox * invertTitleBox
Definition: TextDialog.h:107
TextDialog::apply
void apply()
Apply changes.
Definition: TextDialog.cpp:203
TextFormatButtons
Widget with text format buttons (connected to a QTextEdit)
Definition: TextFormatButtons.h:38
TextDialog::setAlignment
void setAlignment(int align)
Set axis label alignment.
Definition: TextDialog.cpp:346
TextDialog::formatApplyToBox
QComboBox * formatApplyToBox
Definition: TextDialog.h:105
TextDialog::TextDialog
TextDialog(TextType type, QWidget *parent=0, Qt::WFlags fl=0)
Constructor.
Definition: TextDialog.cpp:53
TextDialog
Options dialog for text labels/axes labels.
Definition: TextDialog.h:47
TextDialog::buttonCancel
QPushButton * buttonCancel
Definition: TextDialog.h:99
TextDialog::formatLayerLabels
void formatLayerLabels(Graph *g)
Definition: TextDialog.cpp:291
TextDialog::textEditBox
QTextEdit * textEditBox
Definition: TextDialog.h:101
TextDialog::d_graph
Graph * d_graph
Definition: TextDialog.h:109
TextDialog::TextType
TextType
Label types.
Definition: TextDialog.h:53
TextDialog::alignmentBox
QComboBox * alignmentBox
Definition: TextDialog.h:103
TextDialog::setText
void setText(const QString &t)
Set the contents of the text editor box.
Definition: TextDialog.cpp:376