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

« back to all changes in this revision

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