~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kscd/bwlednum/bwlednum.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 *
 
3
 *             BW_LED_Number a very very primitive LED
 
4
 * 
 
5
 * Copyright: Bernd Johannes Wuebben, wuebben@math.cornell.edu
 
6
 * 
 
7
 *
 
8
 * $Id: bwlednum.h,v 1.2 1999/03/01 23:38:00 kulow Exp $
 
9
 * 
 
10
 * $Log: bwlednum.h,v $
 
11
 * Revision 1.2  1999/03/01 23:38:00  kulow
 
12
 * CVS_SILENT ported to Qt 2.0
 
13
 *
 
14
 * Revision 1.1.1.1.6.1  1999/02/22 22:28:46  kulow
 
15
 * CVS_SILENT replaced old qt header names with new ones
 
16
 *
 
17
 * Revision 1.1.1.1  1997/07/04 21:23:49  kulow
 
18
 * Coolo: added Bernd's kscd
 
19
 *
 
20
 * Revision 1.1  1997/06/21 23:10:11  wuebben
 
21
 * Initial revision
 
22
 *
 
23
 * Revision 1.2  1997/03/22 22:09:37  wuebben
 
24
 * Added support for visibe non-illuminated Segments
 
25
 *
 
26
 * Revision 1.1  1997/03/22 12:45:25  wuebben
 
27
 * Initial revision
 
28
 *
 
29
 *
 
30
 * 
 
31
 *
 
32
 */
 
33
 
 
34
 
 
35
#ifndef BW_LED_NUM_H
 
36
#define BW_LED_NUM_H
 
37
 
 
38
#include <qframe.h>
 
39
#include <qbitarray.h>
 
40
 
 
41
 
 
42
class BW_LED_Number : public QFrame     
 
43
{
 
44
    Q_OBJECT
 
45
 
 
46
public:
 
47
 
 
48
    BW_LED_Number( QWidget *parent=0, const char *name=0 );
 
49
   ~BW_LED_Number();
 
50
 
 
51
    void    setSmallLED(bool ); // if you LED is small it might look better
 
52
                                // if you call setSmallLED(TRUE)
 
53
   
 
54
            // this sets the fore and  background color of the LED
 
55
            // the forground defaults to yellow, the background defaults
 
56
            // to black 
 
57
   
 
58
    void    setLEDColor( const QColor& foregroundColor, const QColor& backgroundColor );
 
59
   
 
60
   
 
61
            // this sets the color of the segments that are not iluminated
 
62
            // the default is a rather dark red. 
 
63
   
 
64
    void    setLEDoffColor(QColor color);
 
65
 
 
66
            // calling showOffColon(TRUE) will show the colon if not illuminated
 
67
            // this is rather ugly -- the default is that they are not shown.
 
68
 
 
69
    void    showOffColon(bool off);
 
70
 
 
71
public slots:
 
72
 
 
73
            // display one of the characters " 0 1 2 3 4 5 6 7 8 9 . : - "
 
74
    void    display( char c );
 
75
  
 
76
            // display on e of the numbers   " 0 1 2 3 4 5 6 7 8 9"
 
77
    void    display( int i );
 
78
 
 
79
protected:
 
80
 
 
81
    void    resizeEvent( QResizeEvent * );
 
82
    void    drawContents( QPainter * );
 
83
 
 
84
private:
 
85
 
 
86
    bool    seg_contained_in( char c, char* seg);
 
87
    void    drawSegment( const QPoint &, char, QPainter &, int, bool = FALSE );
 
88
    void    drawSymbol( QPainter *p,char s ,bool repaint);
 
89
 
 
90
    char* old_segments;
 
91
    char* current_segments;
 
92
 
 
93
    char    current_symbol;
 
94
    char    old_symbol;
 
95
    QColor  offcolor;
 
96
    QColor  fgcolor;
 
97
    QColor  bgcolor;
 
98
    
 
99
 
 
100
    bool    smallLED;
 
101
    bool    show_off_colon;
 
102
 
 
103
private:        // Disabled copy constructor and operator=
 
104
 
 
105
    BW_LED_Number( const BW_LED_Number & ) {}
 
106
    BW_LED_Number &operator=( const BW_LED_Number & ) { return *this; }
 
107
 
 
108
};
 
109
 
 
110
 
 
111
#endif // BW_LED_NUM_H