home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / OWLINC.PAK / CELARRAY.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.5 KB  |  51 lines

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