home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / CELARRAY.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  1KB  |  52 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   Definition of a bitmap Cel array class.
  6. //----------------------------------------------------------------------------
  7. #if !defined(OWL_CELARRAY_H)
  8. #define OWL_CELARRAY_H
  9.  
  10. #if !defined(OWL_GDIOBJCT_H)
  11. # include <owl/gdiobjec.h>
  12. #endif
  13.  
  14.  
  15. class _OWLCLASS TCelArray {
  16.   public:
  17.     // Constructors
  18.     TCelArray(TBitmap* bmp, int numCels, TSize celSize = 0,
  19.               TPoint offset = 0, TAutoDelete = AutoDelete);
  20.     TCelArray(TDib& dib, int numCels);
  21.     TCelArray(const TCelArray& src);
  22.  
  23.     virtual   ~TCelArray();
  24.  
  25.     TCelArray& operator =(const TCelArray&);
  26.     operator   TBitmap&() {return *Bitmap;}
  27.  
  28.     TPoint     Offset() const {return Offs;}
  29.  
  30.     int        NumCels() const {return NCels;}
  31.     TSize      CelSize() const {return CSize;}
  32.     TPoint     CelOffset(int cel) const;
  33.     TRect      CelRect(int cel) const;
  34.     TRect      operator [](int cel) const {return CelRect(cel);}
  35.  
  36.     void       SetNumCels(int numCels) {NCels = numCels < 1 ? 1 : numCels;}
  37.     void       SetCelSize(TSize size) {CSize = size;}
  38.     void       SetOffset(TPoint offs) {Offs = offs;}
  39.  
  40.   protected:
  41.     TBitmap*  Bitmap;
  42.     bool      ShouldDelete;
  43.  
  44.     TPoint    Offs;
  45.     int       NCels;
  46.     TSize     CSize;
  47.  
  48.   private:
  49. };
  50.  
  51. #endif  // OWL_CELARRAY_H
  52.