home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c07 / treelist / treeview.h < prev   
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.7 KB  |  66 lines

  1. // SimpleTreeView.h : header file
  2. //
  3.  
  4. /////////////////////////////////////////////////////////////////////////////
  5. // CSimpleTreeView view
  6. class CTreeDoc;
  7.  
  8. class CSimpleTreeView : public CTreeView
  9. {
  10. protected:
  11.     CSimpleTreeView();           // protected constructor used by dynamic creation
  12.     DECLARE_DYNCREATE(CSimpleTreeView)
  13.  
  14. // Attributes
  15. public:
  16.     CTreeDoc* GetDocument();
  17.  
  18. protected:
  19.  
  20. // Operations
  21. public:
  22.     void PopulateTree();
  23.     BOOL LocateAndInsert(const CAnimalInfo &, const POSITION);
  24.     void DeleteSelection();
  25.     void EditSelection();
  26.     void ModifySelection();
  27.  
  28. // Overrides
  29.     // ClassWizard generated virtual function overrides
  30.     //{{AFX_VIRTUAL(CSimpleTreeView)
  31.     public:
  32.     virtual void OnInitialUpdate();
  33.     //}}AFX_VIRTUAL
  34.  
  35. // Implementation
  36. protected:
  37.     virtual ~CSimpleTreeView();
  38.  
  39.     void InsertRootNodes();
  40.     void InsertDataNodes();
  41.  
  42. #ifdef _DEBUG
  43.     virtual void AssertValid() const;
  44.     virtual void Dump(CDumpContext& dc) const;
  45. #endif
  46.  
  47.     // Generated message map functions
  48. protected:
  49.     //{{AFX_MSG(CSimpleTreeView)
  50.     afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
  51.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  52.     //}}AFX_MSG
  53.     HTREEITEM FindNode(const HTREEITEM, const CString &) const;
  54.     HTREEITEM InsertNode(const HTREEITEM, const CString &str, const DWORD);
  55.     void ModifyAnimal(const HTREEITEM selectedNode, const DWORD itemData);
  56.     void ModifyType(const HTREEITEM selectedNode, const DWORD itemData);
  57.     
  58.     DECLARE_MESSAGE_MAP()
  59. };
  60.  
  61. /////////////////////////////////////////////////////////////////////////////
  62. #ifndef _DEBUG  // debug version in SimpleTreeView.cpp
  63. inline CTreeDoc* CSimpleTreeView::GetDocument()
  64.    { return (CTreeDoc*)m_pDocument; }
  65. #endif
  66.