summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libqtaux/oticker.cpp45
1 files changed, 26 insertions, 19 deletions
diff --git a/libqtaux/oticker.cpp b/libqtaux/oticker.cpp
index c05c2a8..2d8397e 100644
--- a/libqtaux/oticker.cpp
+++ b/libqtaux/oticker.cpp
@@ -30,12 +30,10 @@
30 30
31#include <qpe/config.h>
32
33#include <stdlib.h>
34#include <stdio.h>
35
36#include "oticker.h" 31#include "oticker.h"
37 32
33/* OPIE */
34#include <qpe/config.h>
35
38OTicker::OTicker( QWidget* parent ) 36OTicker::OTicker( QWidget* parent )
39 : QLabel( parent ) { 37 : QLabel( parent )
40 // : QFrame( parent ) { 38{
41 setTextFormat(Qt::RichText); 39 setTextFormat(Qt::RichText);
@@ -49,6 +47,7 @@ OTicker::OTicker( QWidget* parent )
49 47
50OTicker::~OTicker() { 48OTicker::~OTicker()
51} 49{}
52 50
53void OTicker::setBackgroundColor(const QColor& backcolor) { 51void OTicker::setBackgroundColor( const QColor& backcolor )
52{
54 backgroundcolor = backcolor; 53 backgroundcolor = backcolor;
@@ -57,3 +56,4 @@ void OTicker::setBackgroundColor(const QColor& backcolor) {
57 56
58void OTicker::setForegroundColor(const QColor& backcolor) { 57void OTicker::setForegroundColor( const QColor& backcolor )
58{
59 foregroundcolor = backcolor; 59 foregroundcolor = backcolor;
@@ -62,3 +62,4 @@ void OTicker::setForegroundColor(const QColor& backcolor) {
62 62
63void OTicker::setFrame(int frameStyle) { 63void OTicker::setFrame( int frameStyle )
64{
64 setFrameStyle( frameStyle/*WinPanel | Sunken */); 65 setFrameStyle( frameStyle/*WinPanel | Sunken */);
@@ -67,3 +68,4 @@ void OTicker::setFrame(int frameStyle) {
67 68
68void OTicker::setText( const QString& text ) { 69void OTicker::setText( const QString& text )
70{
69 pos = 0; // reset it everytime the text is changed 71 pos = 0; // reset it everytime the text is changed
@@ -77,3 +79,3 @@ qDebug(scrollText);
77 int pixelTextLen = fontMetrics().width( text ); 79 int pixelTextLen = fontMetrics().width( text );
78 printf("<<<<<<<height %d, width %d, text width %d %d\n", contHeight, contWidth, pixelTextLen, scrollText.length()); 80 qDebug( "<<<<<<<height %d, width %d, text width %d %d\n", contHeight, contWidth, pixelTextLen, scrollText.length() );
79 if( pixelTextLen < contWidth) 81 if( pixelTextLen < contWidth)
@@ -105,3 +107,4 @@ qDebug(scrollText);
105 107
106void OTicker::timerEvent( QTimerEvent * ) { 108void OTicker::timerEvent( QTimerEvent * )
109{
107 pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - scrollLength;//1; 110 pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - scrollLength;//1;
@@ -110,3 +113,4 @@ void OTicker::timerEvent( QTimerEvent * ) {
110 113
111void OTicker::drawContents( QPainter *p ) { 114void OTicker::drawContents( QPainter *p )
115{
112 int pixelLen = scrollTextPixmap.width(); 116 int pixelLen = scrollTextPixmap.width();
@@ -117,3 +121,4 @@ void OTicker::drawContents( QPainter *p ) {
117 121
118void OTicker::mouseReleaseEvent( QMouseEvent * ) { 122void OTicker::mouseReleaseEvent( QMouseEvent * )
123{
119// qDebug("<<<<<<<>>>>>>>>>"); 124// qDebug("<<<<<<<>>>>>>>>>");
@@ -122,3 +127,4 @@ void OTicker::mouseReleaseEvent( QMouseEvent * ) {
122 127
123void OTicker::setUpdateTime(int time) { 128void OTicker::setUpdateTime( int time )
129{
124 updateTimerTime=time; 130 updateTimerTime=time;
@@ -126,3 +132,4 @@ void OTicker::setUpdateTime(int time) {
126 132
127void OTicker::setScrollLength(int len) { 133void OTicker::setScrollLength( int len )
134{
128scrollLength=len; 135scrollLength=len;