home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Graphics Classes / RectShape.cpp < prev    next >
Encoding:
Text File  |  1997-07-20  |  1.5 KB  |  75 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved
  3.  
  4. #include "CLRectShape.h"
  5. #include "CLDrawSlate.h"
  6.  
  7. TRectShape::TRectShape( Rect bounds ):
  8.     mBounds( bounds )
  9. {
  10. }
  11.  
  12. TRectShape::TRectShape( short left, short top, short right, short bottom )
  13. {
  14.     mBounds.left= left;
  15.     mBounds.top= top;
  16.     mBounds.right= right;
  17.     mBounds.bottom= bottom;
  18. }
  19.  
  20. TFillRectShape::TFillRectShape( Rect bounds, TStyle *style ):
  21.     TRectShape( bounds ),
  22.     mStyle( style )
  23. {
  24. }
  25.  
  26. TFillRectShape::TFillRectShape( short left, short top, short right, short bottom, TStyle *style ):
  27.     TRectShape( left, top, right, bottom ),
  28.     mStyle( style )
  29. {
  30. }
  31.  
  32. void TFillRectShape::RenderOn( TDrawSlate *gr )
  33. {
  34.     gr->GetDrawFocus();
  35.     mStyle->Apply();
  36.     ::PaintRect( &mBounds );
  37.     gr->ReleaseDrawFocus();
  38. }
  39.  
  40. TFrameRectShape::TFrameRectShape( Rect bounds, TStyle *style ):
  41.     TRectShape( bounds ),
  42.     mStyle( style )
  43. {
  44. }
  45.  
  46. TFrameRectShape::TFrameRectShape( short left, short top, short right, short bottom, TStyle *style ):
  47.     TRectShape( left, top, right, bottom ),
  48.     mStyle( style )
  49. {
  50. }
  51.  
  52. void TFrameRectShape::RenderOn( TDrawSlate *gr )
  53. {
  54.     gr->GetDrawFocus();
  55.     mStyle->Apply();
  56.     ::FrameRect( &mBounds );
  57.     gr->ReleaseDrawFocus();
  58. }
  59.  
  60. TEraseRectShape::TEraseRectShape( Rect bounds ):
  61.     TRectShape( bounds )
  62. {
  63. }
  64.  
  65. TEraseRectShape::TEraseRectShape( short left, short top, short right, short bottom ):
  66.     TRectShape( left, top, right, bottom )
  67. {
  68. }
  69.  
  70. void TEraseRectShape::RenderOn( TDrawSlate *gr )
  71. {
  72.     gr->GetDrawFocus();
  73.     ::EraseRect( &mBounds );
  74.     gr->ReleaseDrawFocus();
  75. }