author | llornkcor <llornkcor> | 2002-11-10 23:46:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 23:46:23 (UTC) |
commit | 41c15dff26825ba13233d84583080e6bceee470f (patch) (unidiff) | |
tree | ee2d9de09d5903e970d3260edfb0f0aa8bd1f1e6 /libopie/oticker.h | |
parent | 9337c912158da3ad2fcda7ee1120c9357faddf8b (diff) | |
download | opie-41c15dff26825ba13233d84583080e6bceee470f.zip opie-41c15dff26825ba13233d84583080e6bceee470f.tar.gz opie-41c15dff26825ba13233d84583080e6bceee470f.tar.bz2 |
added scroll speed and scroll amount and changed to QLabel for richtext, but it doesnt work.. yet.. for whatever reason
-rw-r--r-- | libopie/oticker.h | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/libopie/oticker.h b/libopie/oticker.h index 92a4be4..b7499e3 100644 --- a/libopie/oticker.h +++ b/libopie/oticker.h | |||
@@ -1,4 +1,34 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
4 | =. | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | |||
29 | */ | ||
30 | |||
1 | #ifndef OTICKER_H | 31 | #ifndef OTICKER_H |
2 | #define OTICKER_H | 32 | #define OTICKER_H |
3 | 33 | ||
4 | #include <qwidget.h> | 34 | #include <qwidget.h> |
@@ -6,32 +36,36 @@ | |||
6 | #include <qdrawutil.h> | 36 | #include <qdrawutil.h> |
7 | #include <qpixmap.h> | 37 | #include <qpixmap.h> |
8 | #include <qstring.h> | 38 | #include <qstring.h> |
9 | #include <qslider.h> | 39 | #include <qslider.h> |
40 | #include <qlabel.h> | ||
10 | #include <qframe.h> | 41 | #include <qframe.h> |
11 | #include <qlineedit.h> | 42 | #include <qlineedit.h> |
12 | #include <qcolor.h> | 43 | #include <qcolor.h> |
13 | 44 | ||
14 | class OTicker : public QFrame { | 45 | class OTicker : public QLabel { |
46 | //class OTicker : public QFrame { | ||
15 | Q_OBJECT | 47 | Q_OBJECT |
16 | 48 | ||
17 | public: | 49 | public: |
18 | OTicker( QWidget* parent=0 ); | 50 | OTicker( QWidget* parent=0 ); |
19 | ~OTicker(); | 51 | ~OTicker(); |
20 | void setText( const QString& text ) ; | 52 | void setText( const QString& text ) ; |
21 | void setBackgroundColor(QColor color); | 53 | void setBackgroundColor(QColor color); //sets background |
22 | void setForegroundColor(QColor color); | 54 | void setForegroundColor(QColor color); //sets text color |
23 | void setFrame(int); | 55 | void setFrame(int); //sets frame style |
56 | void setUpdateTime(int); //sets timeout for redraws default is 50 ms | ||
57 | void setScrollLength(int); //sets amount of scrolling default is 1 | ||
24 | signals: | 58 | signals: |
25 | void mousePressed(); | 59 | void mousePressed(); // for mouse press events |
26 | protected: | 60 | protected: |
27 | void timerEvent( QTimerEvent * ); | 61 | void timerEvent( QTimerEvent * ); |
28 | void drawContents( QPainter *p ); | 62 | void drawContents( QPainter *p ); |
29 | void mouseReleaseEvent ( QMouseEvent *); | 63 | void mouseReleaseEvent ( QMouseEvent *); |
30 | private: | 64 | private: |
31 | QColor backgroundcolor, foregroundcolor; | 65 | QColor backgroundcolor, foregroundcolor; |
32 | QString scrollText; | 66 | QString scrollText; |
33 | QPixmap scrollTextPixmap; | 67 | QPixmap scrollTextPixmap; |
34 | int pos;//, pixelLen; | 68 | int pos, updateTimerTime, scrollLength; |
35 | }; | 69 | }; |
36 | 70 | ||
37 | #endif | 71 | #endif |