diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch) | |
tree | 9047cf9e6b5c43878d5bf82660adae77ceee097a /kscd/bwlednum.h | |
download | tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kscd/bwlednum.h')
-rw-r--r-- | kscd/bwlednum.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/kscd/bwlednum.h b/kscd/bwlednum.h new file mode 100644 index 00000000..f3d66f8e --- /dev/null +++ b/kscd/bwlednum.h @@ -0,0 +1,93 @@ +/* + * + * BW_LED_Number a very very primitive LED + * + * Copyright: Bernd Johannes Wuebben, [email protected] + * + * + * $Id$ + * + */ + + +#ifndef BW_LED_NUM_H +#define BW_LED_NUM_H + +#include "qframe.h" +#include "qbitarray.h" + + +class BW_LED_Number : public QFrame +{ + Q_OBJECT + +public: + + BW_LED_Number( QWidget *parent=0, const char *name=0 ); + ~BW_LED_Number(); + + void setSmallLED(bool ); // if you LED is small it might look better + // if you call setSmallLED(TRUE) + + // this sets the fore and background color of the LED + // the forground defaults to yellow, the background defaults + // to black + + void setLEDColor( const QColor& foregroundColor, const QColor& backgroundColor ); + + + // this sets the color of the segments that are not iluminated + // the default is a rather dark red. + + void setLEDoffColor(QColor color); + + // calling showOffColon(TRUE) will show the colon if not illuminated + // this is rather ugly -- the default is that they are not shown. + + void showOffColon(bool off); + +signals: + void clicked(); + +public slots: + + // display one of the characters " 0 1 2 3 4 5 6 7 8 9 . : - " + void display( char c ); + + // display on e of the numbers " 0 1 2 3 4 5 6 7 8 9" + void display( int i ); + +protected: + + void resizeEvent( QResizeEvent * ); + void mouseReleaseEvent ( QMouseEvent * e ); + void drawContents( QPainter * ); + +private: + + bool seg_contained_in( char c, char* seg); + void drawSegment( const QPoint &, char, QPainter &, int, bool = FALSE ); + void drawSymbol( QPainter *p,char s ,bool repaint); + + char* old_segments; + char* current_segments; + + char current_symbol; + char old_symbol; + QColor offcolor; + QColor fgcolor; + QColor bgcolor; + + + bool smallLED; + bool show_off_colon; + +private: // Disabled copy constructor and operator= + + BW_LED_Number( const BW_LED_Number & ); + BW_LED_Number &operator=( const BW_LED_Number & ); + +}; + + +#endif // BW_LED_NUM_H |