home *** CD-ROM | disk | FTP | other *** search
/ Mastering Microsoft Visual C++ 4 (2nd Edition) / VisualC4.ISO / cpp / cblock.h next >
Encoding:
C/C++ Source or Header  |  1994-09-26  |  604 b   |  33 lines

  1. // CBlock.h: CBlock header file
  2.  
  3. #include "crect1.h"
  4. #include <stdlib.h>
  5.  
  6. void Fill (int X, int Y, int Color); 
  7.  
  8. class CBlock : public CRectangle
  9. {
  10. protected:
  11.    int FillColor;
  12.  
  13. public:
  14.    CBlock () 
  15.       {
  16.       FillColor = 0;
  17.       }
  18.    CBlock (int L, int T, int R, int B, int Color)
  19.       : CRectangle (L, T, R, B)
  20.       {
  21.       SetColor (Color);
  22.       }
  23.    void Draw (void)
  24.       {
  25.       CRectangle::Draw ();
  26.       Fill ((Left + Right) / 2, (Top + Bottom) / 2, FillColor);  
  27.       }
  28.    void SetColor (int Color)
  29.       {
  30.       FillColor = __max (0, Color);
  31.       }
  32. };
  33.