00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef RICHTEXTLABEL_H
00012 #define RICHTEXTLABEL_H
00013
00014 #include "meter.h"
00015 #include <tqstring.h>
00016 #include <tqsimplerichtext.h>
00017 #include <tqpainter.h>
00018 #include <tqfont.h>
00019 #include <tqfontmetrics.h>
00020 #include <tqrect.h>
00021 #include <tqsize.h>
00022 #include "karamba.h"
00023
00024 class RichTextLabel : public Meter
00025 {
00026 Q_OBJECT
00027 TQ_OBJECT
00028 public:
00029 RichTextLabel(karamba*);
00030 RichTextLabel(karamba* k, int x, int y, int w, int h);
00031 ~RichTextLabel();
00032
00033 void setText(TQString text, bool linkUnderline = false);
00034 void setValue(TQString text);
00035 void setValue(long v);
00036 TQString getStringValue() { return source; };
00037
00038 void setFont(TQString font);
00039 TQString getFont() const;
00040 void setFontSize(int);
00041 int getFontSize() const;
00042 void setFixedPitch(bool);
00043 bool getFixedPitch() const;
00044 void setTextProps( TextField* t );
00045 void setColorGroup(const TQColorGroup &colorg);
00046 const TQColorGroup &getColorGroup() const;
00047 void setWidth(int width);
00048
00049 virtual bool insideActiveArea(int, int);
00050
00051 virtual bool click(TQMouseEvent*);
00052 virtual void mUpdate(TQPainter*);
00053
00054 TQString anchorAt(int, int);
00055
00056 private:
00057 TQSimpleRichText* text;
00058 TQString source;
00059 TQFont font;
00060 TQColorGroup colorGrp;
00061 bool underlineLinks;
00062 TQSize originalSize;
00063 };
00064
00065 #endif