home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / drawcli / cntritem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.7 KB  |  58 lines

  1. // cntritem.h : interface of the CDrawItem 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. class CDrawDoc;
  14. class CDrawView;
  15.  
  16. class CDrawItem : public COleClientItem
  17. {
  18.     DECLARE_SERIAL(CDrawItem)
  19.  
  20. // Constructors
  21. public:
  22.     CDrawItem(CDrawDoc* pContainer = NULL, CDrawOleObj* pDrawObj = NULL);
  23.         // Note: pContainer is allowed to be NULL to enable IMPLEMENT_SERIALIZE
  24.         //  IMPLEMENT_SERIALIZE requires the class have a constructor with
  25.         //  zero arguments.  Normally, OLE items are constructed with a
  26.         //  non-NULL document pointer.
  27.  
  28. // Attributes
  29. public:
  30.     CDrawDoc* GetDocument()
  31.         { return (CDrawDoc*)COleClientItem::GetDocument(); }
  32.     CDrawView* GetActiveView()
  33.         { return (CDrawView*)COleClientItem::GetActiveView(); }
  34.  
  35.     CDrawOleObj* m_pDrawObj;    // back pointer to OLE draw object
  36.  
  37. // Operations
  38.     BOOL UpdateExtent();
  39.  
  40. // Implementation
  41. public:
  42.     ~CDrawItem();
  43. #ifdef _DEBUG
  44.     virtual void AssertValid() const;
  45.     virtual void Dump(CDumpContext& dc) const;
  46. #endif
  47.     virtual void Serialize(CArchive& ar);
  48.     virtual void OnGetItemPosition(CRect& rPosition);
  49.  
  50. protected:
  51.     virtual void OnChange(OLE_NOTIFICATION wNotification, DWORD dwParam);
  52.     virtual BOOL OnChangeItemPosition(const CRect& rectPos);
  53.     virtual void OnDeactivateUI(BOOL bUndoable);
  54.     virtual void OnActivate();
  55. };
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58.