LeftView.h
上传用户:jorden
上传日期:2022-08-09
资源大小:83k
文件大小:3k
源码类别:

TreeView控件

开发平台:

Visual C++

  1. // LeftView.h : interface of the CLeftView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_LEFTVIEW_H__5E322C7A_83B5_4A37_9A46_AC62096865B5__INCLUDED_)
  5. #define AFX_LEFTVIEW_H__5E322C7A_83B5_4A37_9A46_AC62096865B5__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CExplorerDoc;
  10. class CLeftView : public CTreeView
  11. {
  12. protected: // create from serialization only
  13. CLeftView();
  14. DECLARE_DYNCREATE(CLeftView)
  15. // Attributes
  16. public:
  17. CExplorerDoc* GetDocument();
  18. CImageList* m_pImageList;
  19. CString m_LocalPath;
  20. // Operations
  21. public:
  22. BOOL HasSubdirectory(CString &strPathName);
  23. BOOL IsDriveNode(HTREEITEM hItem);
  24. void SetButtonState(HTREEITEM hItem, CString &strPathName);
  25. UINT AddDirectoryNodes(HTREEITEM hItem, CString &strPathName);
  26. BOOL IsMediaValid(CString &strPathName);
  27. HTREEITEM GetDriveNode(HTREEITEM hItem);
  28. UINT DeleteChildren(HTREEITEM hItem);
  29. BOOL IsPathValid(CString &strPathName);
  30. CString GetPathFromItem(HTREEITEM hItem);
  31. void AddDummyNode(HTREEITEM hItem);
  32. void InitTreeView(HTREEITEM hParent);
  33. BOOL AddDrives(CString strDrive, HTREEITEM hParent);
  34. // Overrides
  35. // ClassWizard generated virtual function overrides
  36. //{{AFX_VIRTUAL(CLeftView)
  37. public:
  38. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  39. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  40. protected:
  41. virtual void OnInitialUpdate(); // called first time after construct
  42. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  43. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  44. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  45. //}}AFX_VIRTUAL
  46. // Implementation
  47. public:
  48. virtual ~CLeftView();
  49. #ifdef _DEBUG
  50. virtual void AssertValid() const;
  51. virtual void Dump(CDumpContext& dc) const;
  52. #endif
  53. protected:
  54. // Generated message map functions
  55. protected:
  56. //{{AFX_MSG(CLeftView)
  57. afx_msg void OnDestroy();
  58. afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
  59. afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
  60. //}}AFX_MSG
  61. DECLARE_MESSAGE_MAP()
  62. };
  63. #ifndef _DEBUG  // debug version in LeftView.cpp
  64. inline CExplorerDoc* CLeftView::GetDocument()
  65.    { return (CExplorerDoc*)m_pDocument; }
  66. #endif
  67. /////////////////////////////////////////////////////////////////////////////
  68. //{{AFX_INSERT_LOCATION}}
  69. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  70. #endif // !defined(AFX_LEFTVIEW_H__5E322C7A_83B5_4A37_9A46_AC62096865B5__INCLUDED_)