home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / advanced / collect / typtrmap.h < prev   
C/C++ Source or Header  |  1998-03-26  |  2KB  |  83 lines

  1. // typtrmap.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. /////////////////////////////////////////////////////////////////////////////
  14. // CTypedPtrMapView form view
  15.  
  16. #ifndef __AFXEXT_H__
  17. #include <afxext.h>
  18. #endif
  19.  
  20. class CTypedPtrMapView : public CFormView
  21. {
  22. public:
  23.     CTypedPtrMapView();           // protected constructor used by dynamic creation
  24.     DECLARE_DYNCREATE(CTypedPtrMapView)
  25.  
  26. // Form Data
  27. public:
  28.     //{{AFX_DATA(CTypedPtrMapView)
  29.     enum { IDD = IDD_TYPED_PTR_MAP };
  30.     CListBox    m_ctlList;
  31.     CString m_strKey;
  32.     int     m_int;
  33.     float   m_float;
  34.     CString m_str;
  35.     //}}AFX_DATA
  36.  
  37. // Attributes
  38. public:
  39.     CCollectDoc* GetDocument();
  40.  
  41. // Overrides
  42. public:
  43.     void OnInitialUpdate();
  44.  
  45. // Overrides
  46.     // ClassWizard generate virtual function overrides
  47.     //{{AFX_VIRTUAL(CTypedPtrMapView)
  48.     protected:
  49.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  50.     //}}AFX_VIRTUAL
  51.  
  52. // Implementation
  53. protected:
  54.     static CString FormatListBoxEntry(CString& strKey, CMyObject* pMyObject);
  55.     int FindKeyInListBox(CString& strKey);
  56.     void AddMapEntryToListBox(CString& strKey, CMyObject* pMyObject);
  57.     CMyObject* ConstructMyObjectFromView();
  58.     void UpdateViewFromMyObject(CMyObject* pMyObject);
  59.  
  60.     virtual ~CTypedPtrMapView();
  61. #ifdef _DEBUG
  62.     virtual void AssertValid() const;
  63.     virtual void Dump(CDumpContext& dc) const;
  64. #endif
  65.  
  66.     // Generated message map functions
  67.     //{{AFX_MSG(CTypedPtrMapView)
  68.     afx_msg void OnAddOrUpdate();
  69.     afx_msg void OnFind();
  70.     afx_msg void OnRemove();
  71.     afx_msg void OnRemoveAll();
  72.     afx_msg void OnSelChangeList();
  73.     //}}AFX_MSG
  74.     DECLARE_MESSAGE_MAP()
  75. };
  76.  
  77. #ifndef _DEBUG
  78. inline CCollectDoc* CTypedPtrMapView::GetDocument()
  79.    { return (CCollectDoc*)m_pDocument; }
  80. #endif
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83.