• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • superkaramba
 

superkaramba

  • superkaramba
  • src
textlabel.h
1/***************************************************************************
2 * Copyright (C) 2003 by Hans Karlsson *
3 * karlsson.h@home.se *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
10#ifndef TEXTLABEL_H
11#define TEXTLABEL_H
12#include "meter.h"
13#include <tqstring.h>
14#include <tqpainter.h>
15#include <tqcolor.h>
16#include <tqfont.h>
17#include <tqfontmetrics.h>
18#include <tqstringlist.h>
19#include <tqrect.h>
20
21#include "textfield.h"
22
23class TextLabel : public Meter
24{
25TQ_OBJECT
26
27public:
28 enum ScrollType { ScrollNone, ScrollNormal,
29 ScrollBackAndForth, ScrollOnePass };
30
31 TextLabel(karamba *k, int x,int y,int w,int h);
32 TextLabel(karamba *k);
33 ~TextLabel();
34
35 void setTextProps( TextField* );
36 void setValue( TQString );
37 void setValue( long );
38 //virtual TQString getStringValue() const { return value.join("\n"); };
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 * );
47
48 virtual void show();
49 virtual void hide();
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);
58
59 void attachClickArea(TQString leftMouseButton, TQString middleMouseButton,
60 TQString rightMouseButton);
61
62 virtual bool click(TQMouseEvent*);
63
64private:
65 int alignment;
66 int clip;
67 TQStringList value;
68 TQFont font;
69 TQColor bgColor;
70 int lineHeight;
71 TQSize textSize;
72 int shadow;
73 TextField text;
74 TQPoint scrollSpeed;
75 TQPoint scrollPos;
76 int scrollGap;
77 int scrollPause;
78 int pauseCounter;
79 ScrollType scrollType;
80
81 int drawText(TQPainter *p, int x, int y, int width, int height,
82 TQString text);
83 bool calculateScrollCoords(TQRect meterRect, TQRect &textRect,
84 TQPoint &next, int &x, int &y);
85 void calculateTextSize();
86};
87
88#endif // TEXTLABEL_H
TextField
Ralph M.
Definition: textfield.h:22

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

superkaramba

Skip menu "superkaramba"
  • kcalc
  •   knumber
  • superkaramba
Generated for superkaramba by doxygen 1.9.4
This website is maintained by Timothy Pearson.