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

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