home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / general / propdlg / shapeobj.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  1KB  |  51 lines

  1. // shapeobj.h : interface of the CShape class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. enum SHAPE_STYLE
  14. {
  15.     rectangle,
  16.     rounded_rectangle,
  17.     ellipse,
  18. };
  19.  
  20. enum SHAPE_COLOR_ENUM
  21. {
  22.     black,
  23.     red,
  24.     green,
  25.     blue,
  26. };
  27.  
  28. struct SHAPE_COLOR
  29. {
  30.     SHAPE_COLOR_ENUM e;
  31.     operator COLORREF() const;
  32.     const SHAPE_COLOR& operator = (COLORREF colorref);
  33.     operator int() const;
  34.     const SHAPE_COLOR& operator = (int n);
  35. };
  36.  
  37. class CShape : public CObject
  38. {
  39. public:
  40.     CShape();
  41.     CShape(SHAPE_COLOR_ENUM colorenum, SHAPE_STYLE shapestyle, CRect& rect);
  42.     DECLARE_SERIAL(CShape)
  43.  
  44.     SHAPE_COLOR m_shapecolor;
  45.     SHAPE_STYLE m_shapestyle;
  46.     CRect       m_rect;
  47.  
  48.     void Draw(CDC* pDC, BOOL bSelected);
  49.     virtual void Serialize(CArchive& ar);
  50. };
  51.