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

« back to all changes in this revision

Viewing changes to kmidi/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.4 1999/06/27 17:57:34 kulow Exp $
 
9
 * 
 
10
 * $Log: bwlednum.h,v $
 
11
 * Revision 1.4  1999/06/27 17:57:34  kulow
 
12
 * fixes for --enable-final and other problems :)
 
13
 *
 
14
 * Revision 1.3  1999/03/01 23:37:24  kulow
 
15
 * CVS_SILENT ported to Qt 2.0
 
16
 *
 
17
 * Revision 1.2.6.1  1999/02/22 22:28:05  kulow
 
18
 * CVS_SILENT replaced old qt header names with new ones
 
19
 *
 
20
 * Revision 1.2  1998/04/06 18:44:11  wuebben
 
21
 * Bernd: layout changes
 
22
 *
 
23
 * Revision 1.3  1997/10/25 15:15:35  wuebben
 
24
 * Bernd: fixed the segfault error if you had no permiision to access the cdrom
 
25
 * drive
 
26
 *
 
27
 * Revision 1.2  1997/08/15 22:51:26  wuebben
 
28
 * *** empty log message ***
 
29
 *
 
30
 * Revision 1.2  1997/08/15 22:42:54  wuebben
 
31
 * Bernd -- Version 0.4
 
32
 * o Support for cdda on Solaris
 
33
 * o Support for Irix
 
34
 * o New interactive configuration script
 
35
 * o  lot of header, define and configuration changes. -- Keep your
 
36
 *   fingers crossed .... ;-)
 
37
 *
 
38
 * Revision 1.1  1997/08/14 23:51:07  wuebben
 
39
 * Initial revision
 
40
 *
 
41
 * Revision 1.1  1997/06/21 23:09:10  wuebben
 
42
 * Initial revision
 
43
 *
 
44
 * Revision 1.2  1997/03/22 22:09:37  wuebben
 
45
 * Added support for visibe non-illuminated Segments
 
46
 *
 
47
 * Revision 1.1  1997/03/22 12:45:25  wuebben
 
48
 * Initial revision
 
49
 *
 
50
 *
 
51
 * 
 
52
 *
 
53
 */
 
54
 
 
55
 
 
56
#ifndef BW_LED_NUM_H
 
57
#define BW_LED_NUM_H
 
58
 
 
59
#include "qframe.h"
 
60
#include "qbitarray.h"
 
61
 
 
62
 
 
63
class BW_LED_Number : public QFrame     
 
64
{
 
65
    Q_OBJECT
 
66
 
 
67
public:
 
68
 
 
69
    BW_LED_Number( QWidget *parent=0, const char *name=0 );
 
70
   ~BW_LED_Number();
 
71
 
 
72
    void    setSmallLED(bool ); // if you LED is small it might look better
 
73
                                // if you call setSmallLED(TRUE)
 
74
   
 
75
            // this sets the fore and  background color of the LED
 
76
            // the forground defaults to yellow, the background defaults
 
77
            // to black 
 
78
   
 
79
    void    setLEDColor( const QColor& foregroundColor, const QColor& backgroundColor );
 
80
   
 
81
   
 
82
            // this sets the color of the segments that are not iluminated
 
83
            // the default is a rather dark red. 
 
84
   
 
85
    void    setLEDoffColor(QColor color);
 
86
 
 
87
            // calling showOffColon(TRUE) will show the colon if not illuminated
 
88
            // this is rather ugly -- the default is that they are not shown.
 
89
 
 
90
    void    showOffColon(bool off);
 
91
 
 
92
public slots:
 
93
 
 
94
            // display one of the characters " 0 1 2 3 4 5 6 7 8 9 . : - "
 
95
    void    display( char c );
 
96
  
 
97
            // display on e of the numbers   " 0 1 2 3 4 5 6 7 8 9"
 
98
    void    display( int i );
 
99
 
 
100
protected:
 
101
 
 
102
    void    resizeEvent( QResizeEvent * );
 
103
    void    drawContents( QPainter * );
 
104
 
 
105
private:
 
106
 
 
107
    bool    seg_contained_in( char c, char* seg);
 
108
    void    drawSegment( const QPoint &, char, QPainter &, int, bool = FALSE );
 
109
    void    drawSymbol( QPainter *p,char s ,bool repaint);
 
110
 
 
111
    char* old_segments;
 
112
    char* current_segments;
 
113
 
 
114
    char    current_symbol;
 
115
    char    old_symbol;
 
116
    QColor  offcolor;
 
117
    QColor  fgcolor;
 
118
    QColor  bgcolor;
 
119
    
 
120
 
 
121
    bool    smallLED;
 
122
    bool    show_off_colon;
 
123
 
 
124
private:        // Disabled copy constructor and operator=
 
125
 
 
126
    BW_LED_Number( const BW_LED_Number & );
 
127
    BW_LED_Number &operator=( const BW_LED_Number & );
 
128
 
 
129
};
 
130
 
 
131
 
 
132
#endif // BW_LED_NUM_H