14 #include <tqpainter.h> 17 #include <tqfontmetrics.h> 18 #include <tqstringlist.h> 21 #include "textfield.h" 23 class TextLabel :
public Meter
28 enum ScrollType { ScrollNone, ScrollNormal,
29 ScrollBackAndForth, ScrollOnePass };
31 TextLabel(karamba *k,
int x,
int y,
int w,
int h);
32 TextLabel(karamba *k);
36 void setValue( TQString );
37 void setValue(
long );
39 TQString getStringValue()
const {
return value.join(
"\n"); };
40 void setFontSize(
int );
41 void setBGColor(TQColor clr);
42 void setFont( TQString );
43 void setAlignment( TQString );
44 void setFixedPitch(
bool );
45 void setShadow(
int );
46 void mUpdate( TQPainter * );
50 int getFontSize()
const;
51 TQColor getBGColor()
const;
52 TQString getFont()
const;
53 TQString getAlignment()
const;
54 bool getFixedPitch()
const;
55 int getShadow()
const;
56 void setScroll(ScrollType type, TQPoint speed,
int gap,
int pause);
57 void setScroll(
char* type, TQPoint speed,
int gap,
int pause);
59 void attachClickArea(TQString leftMouseButton, TQString middleMouseButton,
60 TQString rightMouseButton);
62 virtual bool click(TQMouseEvent*);
79 ScrollType scrollType;
81 int drawText(TQPainter *p,
int x,
int y,
int width,
int height,
83 bool calculateScrollCoords(TQRect meterRect, TQRect &textRect,
84 TQPoint &next,
int &x,
int &y);
85 void calculateTextSize();