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

  1. // ObjView.h : header file
  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. #if !defined(AFX_OBJLISTVIEW_H__7C3F7403_C7B1_11D0_8FAD_00A0C9034892__INCLUDED_)
  14. #define AFX_OBJLISTVIEW_H__7C3F7403_C7B1_11D0_8FAD_00A0C9034892__INCLUDED_
  15.  
  16. #if _MSC_VER >= 1000
  17. #pragma once
  18. #endif // _MSC_VER >= 1000
  19.  
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CObjListView view
  22. #define ITEM_HEIGHT 60
  23.  
  24. class CObjListView;
  25. struct CItemIcons
  26. {
  27.     CItemIcons(){}
  28.     ~CItemIcons(){}
  29.     CString m_Name;
  30.     HICON m_hIcon;
  31.     COleClientItem *m_pObject;
  32. };
  33.  
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CCustomList window
  37.  
  38. class CCustomList : public CListBox
  39. {
  40. // Construction
  41. public:
  42.     CCustomList();
  43.     CCustomList(CObjListView *pParent):m_pParent(pParent){}
  44.     void MeasureItem(LPMEASUREITEMSTRUCT lpm);
  45.     void DrawItem(LPDRAWITEMSTRUCT ldis);
  46.     CObjListView *m_pParent;
  47.  
  48. // Attributes
  49. public:
  50.  
  51. // Operations
  52. public:
  53.  
  54. // Overrides
  55.     // ClassWizard generated virtual function overrides
  56.     //{{AFX_VIRTUAL(CCustomList)
  57.     //}}AFX_VIRTUAL
  58.  
  59. // Implementation
  60. public:
  61.     virtual ~CCustomList();
  62.  
  63.     // Generated message map functions
  64. protected:
  65.     //{{AFX_MSG(CCustomList)
  66.     afx_msg void OnSelchange();
  67.     //}}AFX_MSG
  68.  
  69.     DECLARE_MESSAGE_MAP()
  70. };
  71.  
  72.  
  73. class CObjListView : public CView
  74. {
  75. protected:
  76.     CObjListView();           // protected constructor used by dynamic creation
  77.     DECLARE_DYNCREATE(CObjListView)
  78.     BOOL AddItem(COleClientItem* pObject, CString& name, HICON hIcon);
  79.     BOOL RemoveItem(COleClientItem* pItem);
  80.     void RemoveAllItems();
  81.     CCustomList m_listbox;
  82.  
  83. // Attributes
  84. public:
  85.  
  86. // Operations
  87. public:
  88.     CFont m_IconFont;
  89.     BOOL m_bFont;
  90.  
  91. // Overrides
  92.     // ClassWizard generated virtual function overrides
  93.     //{{AFX_VIRTUAL(CObjListView)
  94.     protected:
  95.     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
  96.     //}}AFX_VIRTUAL
  97.  
  98. // Implementation
  99. protected:
  100.     virtual ~CObjListView();
  101. #ifdef _DEBUG
  102.     virtual void AssertValid() const;
  103.     virtual void Dump(CDumpContext& dc) const;
  104. #endif
  105.  
  106.     // Generated message map functions
  107. protected:
  108.     //{{AFX_MSG(CObjListView)
  109.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  110.     afx_msg void OnSize(UINT nType, int cx, int cy);
  111.     afx_msg void OnDestroy();
  112.     //}}AFX_MSG
  113.     DECLARE_MESSAGE_MAP()
  114. };
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117.  
  118.  
  119. /////////////////////////////////////////////////////////////////////////////
  120. //{{AFX_INSERT_LOCATION}}
  121. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  122.  
  123. #endif // !defined(AFX_OBJLISTVIEW_H__7C3F7403_C7B1_11D0_8FAD_00A0C9034892__INCLUDED_)
  124.