TextFormatButtons.h
Go to the documentation of this file.
/***************************************************************************
File : TextFormatButtons.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen
Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
Description : Widget with text format buttons (connected to a QTextEdit)
***************************************************************************/
/***************************************************************************
* *
* 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 TEXTFORMATBUTTONS_H
#define TEXTFORMATBUTTONS_H
#include <QWidget>
class QTextEdit;
class QPushButton;
class TextFormatButtons : public QWidget
{
Q_OBJECT
public:
enum Buttons{Plot3D, AxisLabel, Legend, Equation, TexLegend};
TextFormatButtons(QTextEdit * textEdit, Buttons buttons = Plot3D, QWidget * parent=0);
void setButtons(Buttons btns);
private:
QTextEdit *connectedTextEdit;
Buttons d_buttons;
void formatText(const QString & prefix, const QString & postfix);
void init(Buttons btns);
private slots:
void addFraction();
void addSquareRoot();
void addSubscript();
void addSuperscript();
void addUnderline();
void addItalics();
void addBold();
void addCurve();
void showLowerGreek();
void showUpperGreek();
void showMathSymbols();
void showArrowSymbols();
void addSymbol(const QString& letter);
};
#endif // TEXTFORMATBUTTONS_H
TextFormatButtons::formatText
void formatText(const QString &prefix, const QString &postfix)
Internal function: format selected text with prefix and postfix.
Definition: TextFormatButtons.cpp:528
TextFormatButtons::addCurve
void addCurve()
Insert curve marker into the text.
Definition: TextFormatButtons.cpp:480
TextFormatButtons::AxisLabel
Definition: TextFormatButtons.h:43
TextFormatButtons::Legend
Definition: TextFormatButtons.h:43
TextFormatButtons::TexLegend
Definition: TextFormatButtons.h:43
TextFormatButtons::showUpperGreek
void showUpperGreek()
Let the user insert capital greek letters.
Definition: TextFormatButtons.cpp:177
TextFormatButtons::showMathSymbols
void showMathSymbols()
Let the user insert mathematical symbols.
Definition: TextFormatButtons.cpp:189
TextFormatButtons::addUnderline
void addUnderline()
Format seleted text to underlined.
Definition: TextFormatButtons.cpp:485
TextFormatButtons::Plot3D
Definition: TextFormatButtons.h:43
TextFormatButtons::Buttons
Buttons
Definition: TextFormatButtons.h:43
TextFormatButtons::addSquareRoot
void addSquareRoot()
Format seleted text to square root.
Definition: TextFormatButtons.cpp:522
TextFormatButtons::addBold
void addBold()
Format seleted text to bold.
Definition: TextFormatButtons.cpp:495
TextFormatButtons::addItalics
void addItalics()
Format seleted text to italics.
Definition: TextFormatButtons.cpp:490
TextFormatButtons::d_buttons
Buttons d_buttons
Definition: TextFormatButtons.h:55
TextFormatButtons::Equation
Definition: TextFormatButtons.h:43
TextFormatButtons::addSymbol
void addSymbol(const QString &letter)
Insert 'letter' into the text.
Definition: TextFormatButtons.cpp:222
TextFormatButtons::TextFormatButtons
TextFormatButtons(QTextEdit *textEdit, Buttons buttons=Plot3D, QWidget *parent=0)
Constructor.
Definition: TextFormatButtons.cpp:37
TextFormatButtons
Widget with text format buttons (connected to a QTextEdit)
Definition: TextFormatButtons.h:38
TextFormatButtons::addSuperscript
void addSuperscript()
Format seleted text to superscript.
Definition: TextFormatButtons.cpp:508
TextFormatButtons::connectedTextEdit
QTextEdit * connectedTextEdit
Definition: TextFormatButtons.h:54
TextFormatButtons::init
void init(Buttons btns)
Definition: TextFormatButtons.cpp:49
TextFormatButtons::setButtons
void setButtons(Buttons btns)
Definition: TextFormatButtons.cpp:547
TextFormatButtons::showArrowSymbols
void showArrowSymbols()
Let the user insert arrow symbols.
Definition: TextFormatButtons.cpp:205
TextFormatButtons::showLowerGreek
void showLowerGreek()
Let the user insert lower case greek letters.
Definition: TextFormatButtons.cpp:165
TextFormatButtons::addFraction
void addFraction()
Format seleted text to fraction.
Definition: TextFormatButtons.cpp:516
TextFormatButtons::addSubscript
void addSubscript()
Format seleted text to subscript.
Definition: TextFormatButtons.cpp:500