Public Types | Public Member Functions | Private Slots | Private Member Functions | Private Attributes

TextFormatButtons Class Reference

Widget with text format buttons (connected to a QTextEdit). More...

#include <TextFormatButtons.h>

List of all members.

Public Types

enum  Buttons {
  Plot3D, AxisLabel, Legend, Equation,
  TexLegend
}

Public Member Functions

void setButtons (Buttons btns)
 TextFormatButtons (QTextEdit *textEdit, Buttons buttons=Plot3D, QWidget *parent=0)
 Constructor.

Private Slots

void addBold ()
 Format seleted text to bold.
void addCurve ()
 Insert curve marker into the text.
void addFraction ()
 Format seleted text to fraction.
void addItalics ()
 Format seleted text to italics.
void addSquareRoot ()
 Format seleted text to square root.
void addSubscript ()
 Format seleted text to subscript.
void addSuperscript ()
 Format seleted text to superscript.
void addSymbol (const QString &letter)
 Insert 'letter' into the text.
void addUnderline ()
 Format seleted text to underlined.
void showArrowSymbols ()
 Let the user insert arrow symbols.
void showLowerGreek ()
 Let the user insert lower case greek letters.
void showMathSymbols ()
 Let the user insert mathematical symbols.
void showUpperGreek ()
 Let the user insert capital greek letters.

Private Member Functions

void formatText (const QString &prefix, const QString &postfix)
 Internal function: format selected text with prefix and postfix.
void init (Buttons btns)

Private Attributes

QTextEdit * connectedTextEdit
Buttons d_buttons

Detailed Description

Widget with text format buttons (connected to a QTextEdit).


Member Enumeration Documentation

Enumerator:
Plot3D 
AxisLabel 
Legend 
Equation 
TexLegend 

Constructor & Destructor Documentation

TextFormatButtons::TextFormatButtons ( QTextEdit *  textEdit,
Buttons  buttons = Plot3D,
QWidget *  parent = 0 
)

Constructor.

Parameters:
textEdit the QTextEdit that the buttons shall affect
parent parent widget

References init().


Member Function Documentation

void TextFormatButtons::addBold (  )  [private, slot]

Format seleted text to bold.

References formatText().

Referenced by init().

void TextFormatButtons::addCurve (  )  [private, slot]

Insert curve marker into the text.

References formatText().

Referenced by init().

void TextFormatButtons::addFraction (  )  [private, slot]

Format seleted text to fraction.

References d_buttons, Equation, formatText(), and TexLegend.

Referenced by init().

void TextFormatButtons::addItalics (  )  [private, slot]

Format seleted text to italics.

References formatText().

Referenced by init().

void TextFormatButtons::addSquareRoot (  )  [private, slot]

Format seleted text to square root.

References d_buttons, Equation, formatText(), and TexLegend.

Referenced by init().

void TextFormatButtons::addSubscript (  )  [private, slot]

Format seleted text to subscript.

References d_buttons, Equation, formatText(), Plot3D, and TexLegend.

Referenced by init().

void TextFormatButtons::addSuperscript (  )  [private, slot]

Format seleted text to superscript.

References d_buttons, Equation, formatText(), Plot3D, and TexLegend.

Referenced by init().

void TextFormatButtons::addSymbol ( const QString &  letter  )  [private, slot]

Insert 'letter' into the text.

References connectedTextEdit, d_buttons, Equation, and TexLegend.

Referenced by showArrowSymbols(), showLowerGreek(), showMathSymbols(), and showUpperGreek().

void TextFormatButtons::addUnderline (  )  [private, slot]

Format seleted text to underlined.

References formatText().

Referenced by init().

void TextFormatButtons::formatText ( const QString &  prefix,
const QString &  postfix 
) [private]

Internal function: format selected text with prefix and postfix.

References connectedTextEdit.

Referenced by addBold(), addCurve(), addFraction(), addItalics(), addSquareRoot(), addSubscript(), addSuperscript(), and addUnderline().

void TextFormatButtons::init ( Buttons  btns  )  [private]
void TextFormatButtons::setButtons ( Buttons  btns  ) 

References d_buttons, and init().

Referenced by EnrichmentDialog::updateButtons().

void TextFormatButtons::showArrowSymbols (  )  [private, slot]

Let the user insert arrow symbols.

References addSymbol(), connectedTextEdit, d_buttons, Equation, and TexLegend.

Referenced by init().

void TextFormatButtons::showLowerGreek (  )  [private, slot]

Let the user insert lower case greek letters.

References addSymbol(), connectedTextEdit, and SymbolDialog::lowerGreek.

Referenced by init().

void TextFormatButtons::showMathSymbols (  )  [private, slot]

Let the user insert mathematical symbols.

References addSymbol(), connectedTextEdit, d_buttons, Equation, and TexLegend.

Referenced by init().

void TextFormatButtons::showUpperGreek (  )  [private, slot]

Let the user insert capital greek letters.

References addSymbol(), connectedTextEdit, and SymbolDialog::upperGreek.

Referenced by init().


Member Data Documentation


The documentation for this class was generated from the following files: