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

  1. // pushctl.h : Declaration of the CPushCtrl OLE control 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.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CPushCtrl : See pushctl.cpp for implementation.
  16.  
  17. class CPushCtrl : public COleControl
  18. {
  19.     DECLARE_DYNCREATE(CPushCtrl)
  20.  
  21. // Constructor
  22. public:
  23.     CPushCtrl();
  24.  
  25. // Overrides
  26.  
  27.     // Drawing function
  28.     virtual void OnDraw(
  29.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  30.  
  31.     // Persistence
  32.     virtual void DoPropExchange(CPropExchange* pPX);
  33.  
  34.     // Reset control state
  35.     virtual void OnResetState();
  36.  
  37. // Implementation
  38. protected:
  39.     ~CPushCtrl();
  40.  
  41.     DECLARE_OLECREATE_EX(CPushCtrl) // Class factory and guid
  42.     DECLARE_OLETYPELIB(CPushCtrl)       // GetTypeInfo
  43.     DECLARE_PROPPAGEIDS(CPushCtrl)      // Property page IDs
  44.     DECLARE_OLECTLTYPE(CPushCtrl)       // Type name and misc status
  45.  
  46.     // Subclassed control support
  47.     BOOL PreCreateWindow(CREATESTRUCT& cs);
  48.     BOOL IsSubclassedControl();
  49.     LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
  50.  
  51.  
  52.     LRESULT OnOcmDrawItem(WPARAM wParam, LPARAM lParam);
  53.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  54.  
  55. // Message maps
  56.     //{{AFX_MSG(CPushCtrl)
  57.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  58.     //}}AFX_MSG
  59.     DECLARE_MESSAGE_MAP()
  60.  
  61. // Dispatch maps
  62.     //{{AFX_DISPATCH(CPushCtrl)
  63.     //}}AFX_DISPATCH
  64.     DECLARE_DISPATCH_MAP()
  65.  
  66.     afx_msg void AboutBox();
  67.  
  68. // Event maps
  69.     //{{AFX_EVENT(CPushCtrl)
  70.     void FireCustomClick(LPCTSTR lpstrCaption, short cchCaption)
  71.         {FireEvent(eventidCustomClick,EVENT_PARAM(VTS_BSTR  VTS_I2), lpstrCaption, cchCaption);}
  72.     //}}AFX_EVENT
  73.     DECLARE_EVENT_MAP()
  74.  
  75. // Dispatch and event IDs
  76. public:
  77.     enum {
  78.     //{{AFX_DISP_ID(CPushCtrl)
  79.     eventidCustomClick = 1L,
  80.     //}}AFX_DISP_ID
  81.     };
  82.  
  83. };
  84.