• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • @topname@
  • Sitemap
  • Contact Us
 

superkaramba

textlabel.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Hans Karlsson                                   *
00003  *   karlsson.h@home.se                                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 #ifndef TEXTLABEL_H
00011 #define TEXTLABEL_H
00012 #include "meter.h"
00013 #include <tqstring.h>
00014 #include <tqpainter.h>
00015 #include <tqcolor.h>
00016 #include <tqfont.h>
00017 #include <tqfontmetrics.h>
00018 #include <tqstringlist.h>
00019 #include <tqrect.h>
00020 
00021 #include "textfield.h"
00022 
00023 class TextLabel : public Meter
00024 {
00025 Q_OBJECT
00026 public:
00027     enum ScrollType { ScrollNone, ScrollNormal,
00028                       ScrollBackAndForth, ScrollOnePass };
00029 
00030     TextLabel(karamba *k, int x,int y,int w,int h);
00031     TextLabel(karamba *k);
00032     ~TextLabel();
00033 
00034     void setTextProps( TextField* );
00035     void setValue( TQString );
00036     void setValue( long );
00037     //virtual TQString getStringValue() const { return value.join("\n"); };
00038     TQString getStringValue() const { return value.join("\n"); };
00039     void setFontSize( int );
00040     void setBGColor(TQColor clr);
00041     void setFont( TQString );
00042     void setAlignment( TQString );
00043     void setFixedPitch( bool );
00044     void setShadow( int );
00045     void mUpdate( TQPainter * );
00046 
00047     virtual void show();
00048     virtual void hide();
00049     int getFontSize() const;
00050     TQColor getBGColor() const;
00051     TQString getFont() const;
00052     TQString getAlignment() const;
00053     bool getFixedPitch() const;
00054     int getShadow() const;
00055     void setScroll(ScrollType type, TQPoint speed, int gap, int pause);
00056     void setScroll(char* type, TQPoint speed, int gap, int pause);
00057 
00058     void attachClickArea(TQString leftMouseButton, TQString middleMouseButton,
00059                          TQString rightMouseButton);
00060 
00061     virtual bool click(TQMouseEvent*);
00062 
00063 private:
00064     int alignment;
00065     int clip;
00066     TQStringList value;
00067     TQFont font;
00068     TQColor bgColor;
00069     int lineHeight;
00070     TQSize textSize;
00071     int shadow;
00072     TextField text;
00073     TQPoint scrollSpeed;
00074     TQPoint scrollPos;
00075     int scrollGap;
00076     int scrollPause;
00077     int pauseCounter;
00078     ScrollType scrollType;
00079 
00080     int drawText(TQPainter *p, int x, int y, int width, int height,
00081                  TQString text);
00082     bool calculateScrollCoords(TQRect meterRect, TQRect &textRect,
00083                                TQPoint &next, int &x, int &y);
00084     void calculateTextSize();
00085 };
00086 
00087 #endif // TEXTLABEL_H

superkaramba

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

@topname@

Skip menu "@topname@"
  • kcalc
  •   knumber
  • superkaramba
Generated for @topname@ by doxygen 1.5.6
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal