00001
00002
00003 #ifndef RICHTEXTWIDGET_H
00004 #define RICHTEXTWIDGET_H
00005
00006 #include <klineedit.h>
00007 #include <qfont.h>
00008 #include <qcheckbox.h>
00009 #include <qcombobox.h>
00010 #include <qtextedit.h>
00011 #include <kcolorbutton.h>
00012 #include <kpopupmenu.h>
00013 #include "Worksheet.h"
00014 #include "Label.h"
00015
00016 class RichTextWidget: public QWidget
00017 {
00018 Q_OBJECT
00019 public:
00020 RichTextWidget(QWidget *parent, Label *label, const char *name, bool qwtplot=0);
00021 public slots:
00022 void setLabel(Label *label) { l = label; update(); }
00023 Label* getLabel() { apply(); return l; }
00024 Label* label() { return getLabel(); }
00025 void setPostionReadOnly(bool r=true) {xle->setReadOnly(r); yle->setReadOnly(r); }
00026 void update();
00027 private slots:
00028 void selectFont();
00029 void setTEColor();
00030 void toggleBold();
00031 void toggleItalic();
00032 void toggleUnderline();
00033 void toggleSuperscript();
00034 void toggleSubscript();
00035 void insertChar(int ch);
00036 void insertGChar(int ch);
00037 void boxedChanged(bool b) { l->setBoxed(b); }
00038 private:
00039 void apply();
00040 Label *l;
00041 QFont greek;
00042 QTextEdit *te;
00043 KLineEdit *xle, *yle, *titleFont, *rotle;
00044 QToolButton *bold, *italic, *underline, *superscript, *subscript;
00045 KPopupMenu *sgletters, *bgletters, *oletters;
00046 KColorButton *kcb, *bgcolor;
00047 QCheckBox *boxedcb, *texcb, *transcb;
00048 };
00049
00050 #endif //RICHTEXTWIDGET_H