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

« back to all changes in this revision

Viewing changes to kscd/bwlednum/bwlednum.cpp

  • 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
 *             BW_LED_Number a very very primitive LED
 
3
 * 
 
4
 * Copyright: Bernd Johannes Wuebben, wuebben@math.cornell.edu
 
5
 * 
 
6
 * $Id: bwlednum.cpp,v 1.2 1999/03/01 23:37:59 kulow Exp $
 
7
 * 
 
8
 * $Log: bwlednum.cpp,v $
 
9
 * Revision 1.2  1999/03/01 23:37:59  kulow
 
10
 * CVS_SILENT ported to Qt 2.0
 
11
 *
 
12
 * Revision 1.1.1.1.6.1  1999/02/22 22:28:44  kulow
 
13
 * CVS_SILENT replaced old qt header names with new ones
 
14
 *
 
15
 * Revision 1.1.1.1  1997/07/04 21:23:49  kulow
 
16
 * Coolo: added Bernd's kscd
 
17
 *
 
18
 * Revision 1.1  1997/06/21 23:10:11  wuebben
 
19
 * Initial revision
 
20
 *
 
21
 * Revision 1.2  1997/03/22 22:09:37  wuebben
 
22
 * Added support for visibe non-illuminated Segments
 
23
 *
 
24
 * Revision 1.1  1997/03/22 12:45:25  wuebben
 
25
 * Initial revision
 
26
 *
 
27
 *
 
28
 *
 
29
 * 
 
30
 */
 
31
 
 
32
 
 
33
#include "bwlednum.h"
 
34
#include <qbitarray.h>
 
35
#include <qpainter.h>
 
36
#include <stdio.h>
 
37
#include "bwlednum.moc"
 
38
 
 
39
#define NUM_OF_SEGMENTS 8
 
40
#define STOP_CHAR 25
 
41
 
 
42
 
 
43
static char segs[14][8] =
 
44
{ { 0, 1, 2, 4, 5, 6,25, 0},            // 0 
 
45
  { 2, 5,25, 0, 0, 0, 0, 0},            // 1
 
46
  { 1, 2, 3, 4, 6,25 ,0, 0},            // 2
 
47
  { 1, 2, 3, 5, 6,25, 0, 0},            // 3
 
48
  { 0, 3, 2, 5 ,25, 0, 0, 0},           // 4
 
49
  { 0, 1, 3, 5, 6,25, 0, 0},            // 5 
 
50
  { 0, 1, 3, 4, 5, 6,25, 0},            // 6
 
51
  { 1,2 , 5,25, 0, 0, 0, 0},            // 7
 
52
  { 0, 1, 2, 3, 4, 5, 6,25},            // 8
 
53
  { 0, 1, 2, 3, 5, 6,25, 0},            // 9 
 
54
  { 3,25, 0, 0, 0, 0, 0, 0},            // -
 
55
  { 7,25, 0, 0, 0, 0, 0, 0},            // .
 
56
  { 8, 9,25, 0, 0, 0, 0, 0},            // :
 
57
  {25, 0, 0, 0, 0, 0, 0, 0} };          // blank
 
58
 
 
59
 
 
60
BW_LED_Number::BW_LED_Number( QWidget *parent, const char *name )
 
61
  : QFrame( parent, name ){
 
62
    
 
63
 
 
64
    offcolor = QColor(100,0,0);
 
65
    showOffColon(FALSE);
 
66
    smallLED = false;
 
67
    current_symbol = ' ';
 
68
    old_symbol = ' ';
 
69
    old_segments = &segs[13][0];      // nothing
 
70
    current_segments = &segs[13][0];  // nothing
 
71
    setLEDColor(yellow,black);
 
72
    
 
73
}
 
74
 
 
75
void dump_segments(char * segs){
 
76
 
 
77
  printf("dumping segments:");
 
78
  for (int i = 0; i <=7; i++){
 
79
    printf("%d:",segs[i]);
 
80
  }
 
81
  printf("\n");
 
82
}
 
83
 
 
84
 
 
85
BW_LED_Number::~BW_LED_Number(){
 
86
 
 
87
}
 
88
 
 
89
void  BW_LED_Number::resizeEvent( QResizeEvent * ){
 
90
 
 
91
}
 
92
 
 
93
void BW_LED_Number::showOffColon(bool off){
 
94
 
 
95
  show_off_colon = off;
 
96
 
 
97
}
 
98
 
 
99
void BW_LED_Number::setLEDColor( const QColor& fgColor, const QColor& bgColor ){
 
100
 
 
101
  fgcolor = fgColor;
 
102
  bgcolor = bgColor;
 
103
 
 
104
  QColorGroup old_cg = this->colorGroup();
 
105
 
 
106
 
 
107
  QColorGroup new_cg( fgColor, bgColor,
 
108
                      fgColor, fgColor, fgColor, 
 
109
                      fgColor, fgColor );
 
110
 
 
111
        
 
112
  this->setPalette(QPalette(new_cg, new_cg, new_cg));
 
113
 
 
114
}
 
115
 
 
116
 
 
117
 
 
118
 
 
119
static char *getSegments( char s)       
 
120
                                        
 
121
{
 
122
  if (s >= '0' && s <= '9'){
 
123
    return segs[s - '0'];
 
124
  }
 
125
 
 
126
    int j;
 
127
 
 
128
    switch ( s ) {
 
129
    case '-':
 
130
      j = 10;  
 
131
      break;
 
132
    case 'O':
 
133
      j = 0;   
 
134
      break;
 
135
    case '.':
 
136
      j = 11;  
 
137
      break;
 
138
    case ':':
 
139
      j = 12;  
 
140
      break;
 
141
    default:
 
142
      j = 13;  
 
143
      break;
 
144
    }
 
145
 
 
146
    return segs[j];
 
147
}
 
148
 
 
149
void BW_LED_Number::drawContents( QPainter *p ){
 
150
 
 
151
  drawSymbol( p, current_symbol,TRUE );
 
152
 
 
153
}
 
154
 
 
155
 
 
156
void BW_LED_Number::display(int i ){
 
157
 
 
158
 if( (i<0) || (i> 9))
 
159
   return;
 
160
 display( (char)('0'+ i));
 
161
 
 
162
}
 
163
 
 
164
 
 
165
void BW_LED_Number::display(char s ){
 
166
  
 
167
  QPainter p;     
 
168
 
 
169
  p.begin( this );
 
170
  
 
171
  old_symbol = current_symbol;
 
172
  old_segments = current_segments;
 
173
  current_symbol = s;
 
174
  current_segments = getSegments(s);
 
175
 
 
176
  drawSymbol(&p,s,FALSE);
 
177
 
 
178
  p.end();
 
179
 
 
180
}
 
181
 
 
182
void BW_LED_Number::setSmallLED(bool a_boolean){
 
183
 
 
184
 smallLED = a_boolean;
 
185
 
 
186
}
 
187
 
 
188
 
 
189
void BW_LED_Number::drawSymbol( QPainter *p,char s,bool repaint ){
 
190
  
 
191
  //  printf("drawSymbol repaint = %d\n",repaint);
 
192
 
 
193
 QPoint  pos;
 
194
  
 
195
 int xSegment_Length, ySegment_Length, Segment_Length, xAdvance;   
 
196
 int Xoffset, Yoffset, space;
 
197
 
 
198
 space = 1;
 
199
 
 
200
 xSegment_Length  = width()*5/((5 + space) + space);
 
201
 ySegment_Length   = height()*5/12;
 
202
 Segment_Length   = ySegment_Length > xSegment_Length ? xSegment_Length : ySegment_Length;
 
203
 xAdvance = Segment_Length*( 5 + space )/5 +1 ; 
 
204
 Xoffset  = ( width() - xAdvance + Segment_Length/5 )/2;
 
205
 Yoffset  = ( height() - Segment_Length*2 )/2;
 
206
  
 
207
 pos = QPoint( Xoffset , Yoffset );     
 
208
 
 
209
 
 
210
 if(repaint){
 
211
 
 
212
   // this draw the non-illumintated segments
 
213
 
 
214
   if(show_off_colon){// we want to show the colon which is actually ugly and
 
215
                      // by default not shown.
 
216
 
 
217
     for(int l = 0; l <= NUM_OF_SEGMENTS +1; l++){
 
218
       drawSegment(pos,(char) l,*p,Segment_Length,TRUE);      //erase segment
 
219
     }
 
220
   }
 
221
   else{
 
222
     for(int l = 0; l <= NUM_OF_SEGMENTS -1; l++){
 
223
       drawSegment(pos,(char) l,*p,Segment_Length,TRUE);      //erase segment
 
224
     }
 
225
   }
 
226
 
 
227
   // now draw the illuminated segments
 
228
 
 
229
   for(int l = 0; l <= NUM_OF_SEGMENTS -1; l++){
 
230
     if(current_segments[l] != STOP_CHAR){
 
231
         drawSegment(pos,current_segments[l],*p,Segment_Length,FALSE);   // draw segment
 
232
     }
 
233
     else{
 
234
       break;
 
235
     }
 
236
   }
 
237
 }
 
238
 else{ // we are not repainting ourselves due to a repaint event but rather
 
239
       // genuinely changing the symbol that is to be displayed 
 
240
 
 
241
   for(int l = 0; l <= NUM_OF_SEGMENTS -1; l++){
 
242
 
 
243
     if(current_segments[l] != STOP_CHAR){
 
244
       if(!seg_contained_in(current_segments[l],old_segments)) 
 
245
         drawSegment(pos,current_segments[l],*p,Segment_Length,FALSE);   // draw segment
 
246
     }
 
247
     else{
 
248
       break;
 
249
     }
 
250
   }
 
251
 
 
252
 
 
253
   for(int k = 0; k <= NUM_OF_SEGMENTS -1; k++){
 
254
 
 
255
     if(old_segments[k] != STOP_CHAR){
 
256
       if(!seg_contained_in(old_segments[k],current_segments))
 
257
         drawSegment(pos,old_segments[k],*p,Segment_Length,TRUE);      //erase segment
 
258
     }
 
259
     else{
 
260
       break;
 
261
     }
 
262
   }
 
263
 }
 
264
}
 
265
 
 
266
 
 
267
 
 
268
bool BW_LED_Number::seg_contained_in( char c, char* seg){
 
269
 
 
270
  bool result = FALSE;
 
271
 
 
272
  while ( *seg != STOP_CHAR){
 
273
    //       printf("Comparing %d with %d\n",c,*seg);
 
274
    if ( c == *seg )
 
275
      result = TRUE;
 
276
    seg++;
 
277
  }
 
278
 
 
279
  return result;
 
280
}
 
281
 
 
282
void BW_LED_Number::setLEDoffColor(QColor color){
 
283
 
 
284
  offcolor = color;
 
285
}
 
286
 
 
287
 
 
288
void BW_LED_Number::drawSegment( const QPoint &pos, char seg_number, QPainter &p,
 
289
                              int Segment_Length, bool erase){
 
290
 
 
291
 
 
292
  QPoint pt = pos;
 
293
  QColorGroup g = colorGroup();
 
294
  QColor lightColor,darkColor;
 
295
  if ( erase ){
 
296
    
 
297
    lightColor = offcolor;
 
298
    darkColor  = offcolor;
 
299
    
 
300
  } else {
 
301
    lightColor = g.light();
 
302
    darkColor  = g.dark();
 
303
  }
 
304
  int Width = (int) Segment_Length/5;
 
305
  
 
306
  
 
307
  QBrush brush(g.light()); 
 
308
  QPointArray pts;
 
309
  
 
310
  
 
311
  pt.ry() += (QCOORD)Width/2;
 
312
  
 
313
  
 
314
  if (erase){
 
315
    
 
316
    p.setBrush(offcolor);
 
317
    brush.setColor(offcolor);
 
318
    
 
319
  }
 
320
  else
 
321
    p.setBrush(g.light());
 
322
  
 
323
  if(!smallLED){
 
324
    
 
325
    switch ( seg_number ) {
 
326
    case 0 :
 
327
      
 
328
      
 
329
      if (erase) 
 
330
        p.setPen(offcolor);
 
331
      
 
332
      pts.setPoints(3,pt.x(), pt.y() ,
 
333
                    pt.x(), pt.y()-Width +1,
 
334
                    pt.x() + Width-1, pt.y());
 
335
      p.drawPolygon(pts);
 
336
      pts.setPoints(3,pt.x(), pt.y() + Segment_Length -Width - Width/2 -1  ,
 
337
                    pt.x() + Width -1 , pt.y()  -Width +Segment_Length - Width/2 -1,
 
338
                    pt.x() , pt.y() + Segment_Length - 3*Width/4 -1);
 
339
      p.drawPolygon(pts);
 
340
      
 
341
      if (erase)
 
342
        p.setPen(g.light());
 
343
      
 
344
      p.fillRect(pt.x(),pt.y()+ Width/2 -1, Width , 
 
345
                 Segment_Length - Width -Width +1 ,brush);
 
346
      
 
347
      break;
 
348
    case 1 :
 
349
      
 
350
      p.fillRect(pt.x()+Width,pt.y()- Width , Segment_Length -2* Width, Width ,brush);
 
351
      
 
352
      if (erase) 
 
353
        p.setPen(offcolor);
 
354
      
 
355
      pts.setPoints(3,pt.x()+1, pt.y()-Width  ,
 
356
                    pt.x()+Width, pt.y()-Width  ,
 
357
                    pt.x() + Width, pt.y() -1 );
 
358
      p.drawPolygon(pts);
 
359
      
 
360
      pts.setPoints(3,pt.x()+ Segment_Length - Width , pt.y() - Width,
 
361
                    pt.x()+  Segment_Length  -1, pt.y() - Width,
 
362
                    pt.x() + Segment_Length - Width , pt.y() -1 );
 
363
      p.drawPolygon(pts);
 
364
      
 
365
      if (erase) 
 
366
        p.setPen(g.light());
 
367
      break;
 
368
    case 2 :
 
369
      pt.rx() += (QCOORD)(Segment_Length);
 
370
      
 
371
      
 
372
      if (erase) 
 
373
        p.setPen(offcolor);
 
374
      
 
375
      pts.setPoints(3,pt.x() , pt.y() ,
 
376
                    pt.x() , pt.y() - Width + 1,    // changes from 1 to 2 
 
377
                    pt.x() - Width +1, pt.y() );
 
378
      
 
379
      p.drawPolygon(pts);
 
380
      
 
381
      pts.setPoints(3,pt.x() , pt.y() + Segment_Length - Width - Width/2 -1,
 
382
                    pt.x() , pt.y() + Segment_Length - 3*Width/4 - 1,
 
383
                    pt.x() - Width +1, pt.y() + Segment_Length - Width - Width/2 -1);
 
384
 
 
385
      p.drawPolygon(pts);
 
386
      
 
387
      if (erase)
 
388
        p.setPen(g.light());
 
389
      
 
390
      p.fillRect(pt.x() - Width+1 ,pt.y() + Width/2- 1, Width , 
 
391
                 Segment_Length - Width - Width + 1 ,brush);
 
392
      
 
393
      break;
 
394
    case 3 :
 
395
      
 
396
      pt.ry() += (QCOORD)Segment_Length;
 
397
      
 
398
      p.setPen(g.background());
 
399
      
 
400
      pts.setPoints(3,pt.x()-1 , pt.y() - Width/2 -1,
 
401
                    pt.x() + Width+2, pt.y()-Width -1 ,//
 
402
                    pt.x() + Width+2, pt.y() );
 
403
      p.drawPolygon(pts);
 
404
      pts.setPoints(3,pt.x() + Segment_Length + 1, pt.y()  - Width/2 -1  ,
 
405
                    pt.x() + Segment_Length - Width - 2 , 
 
406
                    pt.y() - Width -1,
 
407
                    pt.x() + Segment_Length - Width - 2, pt.y() );
 
408
      p.drawPolygon(pts);
 
409
      
 
410
      p.setPen(g.light());
 
411
      p.fillRect(pt.x() + Width -1 ,pt.y() - Width, Segment_Length- 2* Width + 3, 
 
412
                       Width  ,brush);      
 
413
      
 
414
      break;
 
415
    case 4 :
 
416
      pt.ry() += (QCOORD)(Segment_Length +1);
 
417
      p.fillRect(pt.x(), pt.y(), Width , Segment_Length - Width - Width/2 ,brush);
 
418
      if (erase) 
 
419
        p.setPen(offcolor);
 
420
      
 
421
      pts.setPoints(3,pt.x(), pt.y(),
 
422
                    pt.x(), pt.y()-Width+1,
 
423
                    pt.x() + Width-1, pt.y());
 
424
      p.drawPolygon(pts);
 
425
      pts.setPoints(3,pt.x(), pt.y() + Segment_Length -Width - Width/2  -1 ,
 
426
                    pt.x() + Width -1 , pt.y()  -Width +Segment_Length - Width/2 -1 ,
 
427
                    pt.x() , pt.y() + Segment_Length - 3*Width/4 -1);
 
428
      p.drawPolygon(pts);
 
429
      
 
430
      if (erase)
 
431
        p.setPen(g.light());
 
432
      
 
433
      break;
 
434
    case 5 :
 
435
      pt.rx() += (QCOORD)(Segment_Length );
 
436
      pt.ry() += (QCOORD)(Segment_Length +1);
 
437
      p.fillRect(pt.x() - Width +1  ,pt.y(), Width , 
 
438
                 Segment_Length - Width - Width/2  ,brush);
 
439
      
 
440
      if (erase) 
 
441
        p.setPen(offcolor);
 
442
      
 
443
      pts.setPoints(3,pt.x() , pt.y(),
 
444
                    pt.x() , pt.y() - Width  +1,
 
445
                    pt.x() - Width +1, pt.y());
 
446
      
 
447
      p.drawPolygon(pts);
 
448
      
 
449
      pts.setPoints(3,pt.x() , pt.y() + Segment_Length - Width - Width/2 -1,
 
450
                    pt.x() , pt.y() + Segment_Length - 3*Width/4 -1,
 
451
                    pt.x() - Width +1, pt.y() + Segment_Length - Width - Width/2 -1);
 
452
 
 
453
      p.drawPolygon(pts);
 
454
      
 
455
      if (erase)
 
456
        p.setPen(g.light());
 
457
      
 
458
      break;
 
459
    case 6 :
 
460
      pt.ry() += (QCOORD)(Segment_Length*2 );
 
461
      p.fillRect(pt.x() + Width  ,pt.y() -Width , Segment_Length -2* Width , 
 
462
                 Width  ,brush);
 
463
      
 
464
      if (erase) 
 
465
        p.setPen(offcolor);
 
466
      
 
467
      pts.setPoints(3,pt.x()+1, pt.y()-1,
 
468
                    pt.x() + Width, pt.y() - Width,
 
469
                    pt.x() + Width, pt.y() - 1 );
 
470
      p.drawPolygon(pts);
 
471
      
 
472
      pts.setPoints(3, pt.x() + Segment_Length - 1, pt.y()-1,
 
473
                    pt.x() + Segment_Length - Width , pt.y() - Width, 
 
474
                    pt.x() + Segment_Length - Width , pt.y() - 1 );
 
475
             
 
476
      p.drawPolygon(pts);
 
477
      
 
478
      if (erase) 
 
479
        p.setPen(g.light());
 
480
      
 
481
      
 
482
      
 
483
      break;
 
484
    case 7 :
 
485
      pt.rx() += (QCOORD)(Segment_Length/2);
 
486
      pt.ry() += (QCOORD)(Segment_Length*2);
 
487
      p.fillRect(pt.x()  ,pt.y() - Width , Width , Width  ,brush);
 
488
      break;
 
489
    case 8 :
 
490
      pt.ry() += (QCOORD)(Segment_Length/2 + Width/2);
 
491
      pt.rx() += (QCOORD)(Segment_Length/2 - Width/2 + 1);
 
492
      
 
493
      if (!show_off_colon && erase) {
 
494
        p.setBrush(bgcolor);
 
495
        brush.setColor(bgcolor);
 
496
      }
 
497
 
 
498
      p.fillRect(pt.x()  ,pt.y() - Width  , Width , Width  ,brush);
 
499
      p.moveTo(pt);
 
500
      
 
501
      if (!show_off_colon && erase) {
 
502
        p.setBrush(fgcolor);
 
503
        brush.setColor(fgcolor);
 
504
      }
 
505
 
 
506
      break;
 
507
    case 9 :
 
508
      pt.ry() += (QCOORD)(3*Segment_Length/2 + Width/2);
 
509
      pt.rx() += (QCOORD)(Segment_Length/2 - Width/2 + 1);
 
510
 
 
511
      if (!show_off_colon && erase) {
 
512
        p.setBrush(bgcolor);
 
513
        brush.setColor(bgcolor);
 
514
      }
 
515
      p.fillRect(pt.x() ,pt.y() - Width  , Width , Width  ,brush);
 
516
 
 
517
      if (!show_off_colon && erase) {
 
518
        p.setBrush(fgcolor);
 
519
        brush.setColor(fgcolor);
 
520
      }
 
521
      break;
 
522
    }
 
523
    
 
524
  } /*  if (!smallLED) */
 
525
  
 
526
  else{
 
527
    
 
528
    pt.ry() += (QCOORD)Width/2;
 
529
    
 
530
    switch ( seg_number ) {
 
531
    case 0 :
 
532
      p.fillRect(pt.x(),pt.y()+ Width /2, Width , Segment_Length - Width -Width/2 ,brush);
 
533
      break;
 
534
    case 1 :
 
535
      p.fillRect(pt.x()+Width,pt.y()- Width , Segment_Length -2* Width, Width ,brush);
 
536
      break;
 
537
    case 2 :
 
538
      pt.rx() += (QCOORD)(Segment_Length);
 
539
      p.fillRect(pt.x()-Width,pt.y()+ Width/2, Width , 
 
540
                 Segment_Length - Width -Width/2 ,brush);
 
541
      break;
 
542
    case 3 :
 
543
      pt.ry() += (QCOORD)Segment_Length;
 
544
      p.fillRect(pt.x() + Width ,pt.y() - Width, Segment_Length- 2* Width, Width  ,brush);
 
545
      break;
 
546
    case 4 :
 
547
      pt.ry() += (QCOORD)(Segment_Length );
 
548
      p.fillRect(pt.x(), pt.y(), Width , Segment_Length - Width - Width/2 ,brush);
 
549
      break;
 
550
    case 5 :
 
551
      pt.rx() += (QCOORD)(Segment_Length );
 
552
      pt.ry() += (QCOORD)(Segment_Length );
 
553
      p.fillRect(pt.x() - Width ,pt.y(), Width , 
 
554
                 Segment_Length - Width - Width/2  ,brush);
 
555
      break;
 
556
    case 6 :
 
557
      pt.ry() += (QCOORD)(Segment_Length*2);
 
558
      p.fillRect(pt.x() + Width  ,pt.y() -Width , Segment_Length -2* Width , 
 
559
                 Width  ,brush);
 
560
      break;
 
561
    case 7 :
 
562
      pt.rx() += (QCOORD)(Segment_Length/2);
 
563
      pt.ry() += (QCOORD)(Segment_Length*2);
 
564
      p.fillRect(pt.x()  ,pt.y() - Width , Width , Width  ,brush);
 
565
      break;
 
566
    case 8 :
 
567
      pt.ry() += (QCOORD)(Segment_Length/2 + Width/2);
 
568
      pt.rx() += (QCOORD)(Segment_Length/2 - Width/2 + 1);
 
569
      if (!show_off_colon && erase) {
 
570
        p.setBrush(bgcolor);
 
571
        brush.setColor(bgcolor);
 
572
      }
 
573
 
 
574
      p.fillRect(pt.x()  ,pt.y() - Width  , Width , Width  ,brush);
 
575
      p.moveTo(pt);
 
576
      if (!show_off_colon && erase) {
 
577
        p.setBrush(fgcolor);
 
578
        brush.setColor(fgcolor);
 
579
      }
 
580
 
 
581
      break;
 
582
    case 9 :
 
583
      pt.ry() += (QCOORD)(3*Segment_Length/2 + Width/2);
 
584
      pt.rx() += (QCOORD)(Segment_Length/2 - Width/2 + 1);
 
585
     
 
586
      if (!show_off_colon && erase) {
 
587
        p.setBrush(bgcolor);
 
588
        brush.setColor(bgcolor);
 
589
      }
 
590
      p.fillRect(pt.x() ,pt.y() - Width  , Width , Width  ,brush);
 
591
      if (!show_off_colon && erase) {
 
592
        p.setBrush(fgcolor);
 
593
        brush.setColor(fgcolor);
 
594
      }
 
595
      
 
596
      break;
 
597
    }   
 
598
 
 
599
  } /* end smallLED */
 
600
 
 
601
 
 
602
}