diff options
Diffstat (limited to 'examples/textedit/textedit.h')
-rw-r--r-- | examples/textedit/textedit.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/examples/textedit/textedit.h b/examples/textedit/textedit.h new file mode 100644 index 000000000..7b2031f03 --- /dev/null +++ b/examples/textedit/textedit.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for TQt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#ifndef TEXTEDIT_H +#define TEXTEDIT_H + +#include <qmainwindow.h> +#include <qmap.h> + +class TQAction; +class TQComboBox; +class TQTabWidget; +class TQTextEdit; + +class TextEdit : public TQMainWindow +{ + Q_OBJECT + +public: + TextEdit( TQWidget *parent = 0, const char *name = 0 ); + +private: + void setupFileActions(); + void setupEditActions(); + void setupTextActions(); + void load( const TQString &f ); + TQTextEdit *currentEditor() const; + void doConnections( TQTextEdit *e ); + +private slots: + void fileNew(); + void fileOpen(); + void fileSave(); + void fileSaveAs(); + void filePrint(); + void fileClose(); + void fileExit(); + + void editUndo(); + void editRedo(); + void editCut(); + void editCopy(); + void editPaste(); + + void textBold(); + void textUnderline(); + void textItalic(); + void textFamily( const TQString &f ); + void textSize( const TQString &p ); + void textColor(); + void textAlign( TQAction *a ); + + void fontChanged( const TQFont &f ); + void colorChanged( const TQColor &c ); + void alignmentChanged( int a ); + void editorChanged( TQWidget * ); + +private: + TQAction *actionTextBold, + *actionTextUnderline, + *actionTextItalic, + *actionTextColor, + *actionAlignLeft, + *actionAlignCenter, + *actionAlignRight, + *actionAlignJustify; + TQComboBox + *comboFont, + *comboSize; + TQTabWidget *tabWidget; + TQMap<TQTextEdit*, TQString> filenames; + +}; + + +#endif |