home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c12 / lab01 / ex02 / palviewctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  2.4 KB  |  84 lines

  1. #if !defined(PALVIEWCTL_H__7F7767D1_365B_11D0_9C9D_00A0D100E3C8__INCLUDED_)
  2. #define PALVIEWCTL_H__7F7767D1_365B_11D0_9C9D_00A0D100E3C8__INCLUDED_
  3.  
  4. // PalViewCtl.h : Declaration of the CPalViewCtrl ActiveX Control class.
  5.  
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CPalViewCtrl : See PalViewCtl.cpp for implementation.
  8.  
  9. class CPalViewCtrl : public COleControl
  10. {
  11.     DECLARE_DYNCREATE(CPalViewCtrl)
  12.  
  13. // Constructor
  14. public:
  15.     CPalViewCtrl();
  16.  
  17. // Overrides
  18.     // ClassWizard generated virtual function overrides
  19.     //{{AFX_VIRTUAL(CPalViewCtrl)
  20.     public:
  21.     virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  22.     virtual void DoPropExchange(CPropExchange* pPX);
  23.     virtual void OnResetState();
  24.     //}}AFX_VIRTUAL
  25.  
  26. // Implementation
  27. protected:
  28.     void ExtractPalFromDIBFile(LPCTSTR lpszFileSpec);
  29.     CDIBPal * m_pDibPal;
  30.     ~CPalViewCtrl();
  31.  
  32.     DECLARE_OLECREATE_EX(CPalViewCtrl)    // Class factory and guid
  33.     DECLARE_OLETYPELIB(CPalViewCtrl)      // GetTypeInfo
  34.     DECLARE_PROPPAGEIDS(CPalViewCtrl)     // Property page IDs
  35.     DECLARE_OLECTLTYPE(CPalViewCtrl)        // Type name and misc status
  36.  
  37. // Message maps
  38.     //{{AFX_MSG(CPalViewCtrl)
  39.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  40.     //}}AFX_MSG
  41.     DECLARE_MESSAGE_MAP()
  42.  
  43. // Dispatch maps
  44.     //{{AFX_DISPATCH(CPalViewCtrl)
  45.     CString m_dibFileName;
  46.     afx_msg void OnDibFileNameChanged();
  47.     BOOL m_showColorSelection;
  48.     afx_msg void OnShowColorSelectionChanged();
  49.     BOOL m_show3D;
  50.     afx_msg void OnShow3DChanged();
  51.     afx_msg short GetSelectionIndex();
  52.     afx_msg void SetSelectionIndex(short nNewValue);
  53.     afx_msg long GetColorFromPalette(short nPalIndex);
  54.     //}}AFX_DISPATCH
  55.     DECLARE_DISPATCH_MAP()
  56.  
  57.     afx_msg void AboutBox();
  58.  
  59. // Event maps
  60.     //{{AFX_EVENT(CPalViewCtrl)
  61.     void FireSelChange(short nSelectionIndex)
  62.         {FireEvent(eventidSelChange,EVENT_PARAM(VTS_I2), nSelectionIndex);}
  63.     //}}AFX_EVENT
  64.     DECLARE_EVENT_MAP()
  65.  
  66. // Dispatch and event IDs
  67. public:
  68.     enum {
  69.     //{{AFX_DISP_ID(CPalViewCtrl)
  70.     dispidDibFileName = 1L,
  71.     dispidShowColorSelection = 2L,
  72.     dispidShow3D = 3L,
  73.     dispidSelectionIndex = 4L,
  74.     dispidGetColorFromPalette = 5L,
  75.     eventidSelChange = 1L,
  76.     //}}AFX_DISP_ID
  77.     };
  78. };
  79.  
  80. //{{AFX_INSERT_LOCATION}}
  81. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  82.  
  83. #endif // !defined(PALVIEWCTL_H__7F7767D1_365B_11D0_9C9D_00A0D100E3C8__INCLUDED)
  84.