Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.3 KiB

  1. /*******************************************************************************
  2. *
  3. * basetree.h
  4. *
  5. * - declarations for the CBaseTreeView class
  6. * - the CBaseTreeView class is the class which the tree views are
  7. * - derived from.
  8. * - derived from CTreeView
  9. *
  10. * copyright notice: Copyright 1997, Citrix Systems Inc.
  11. * Copyright (c) 1998 - 1999 Microsoft Corporation
  12. *
  13. * $Author: donm $ Don Messerli
  14. *
  15. * $Log: N:\nt\private\utils\citrix\winutils\tsadmin\VCS\basetree.h $
  16. *
  17. * Rev 1.4 19 Feb 1998 17:40:04 donm
  18. * removed latest extension DLL support
  19. *
  20. * Rev 1.2 19 Jan 1998 16:46:04 donm
  21. * new ui behavior for domains and servers
  22. *
  23. * Rev 1.1 03 Nov 1997 15:23:08 donm
  24. * update
  25. *
  26. * Rev 1.0 13 Oct 1997 22:32:48 donm
  27. * Initial revision.
  28. *
  29. *******************************************************************************/
  30. #ifndef _BASETREE_H
  31. #define _BASETREE_H
  32. #include "afxcview.h"
  33. ///////////////////////
  34. // CLASS: CBaseTreeView
  35. //
  36. class CBaseTreeView : public CTreeView
  37. {
  38. friend class CTreeTabCtrl;
  39. friend class CLeftPane;
  40. protected:
  41. CBaseTreeView(); // protected constructor used by dynamic creation
  42. DECLARE_DYNCREATE(CBaseTreeView)
  43. // Attributes
  44. protected:
  45. CImageList m_ImageList; // image list associated with the tree control
  46. CCriticalSection m_TreeControlCriticalSection;
  47. BOOL m_bInitialExpand; // we haven't done an initial Expand on the tree because
  48. // there aren't any nodes beneath the root
  49. // Operations
  50. public:
  51. HTREEITEM GetNextItem( HTREEITEM hItem);
  52. protected:
  53. DWORD_PTR GetCurrentNode();
  54. // Adds an icon's image to the image list and returns the image's index
  55. int AddIconToImageList(int);
  56. // Adds an item to the tree
  57. HTREEITEM AddItemToTree(HTREEITEM, CString, HTREEITEM, int, LPARAM);
  58. // Locks the tree control for exclusive use and returns a reference
  59. // to the tree control
  60. CTreeCtrl& LockTreeControl() {
  61. m_TreeControlCriticalSection.Lock();
  62. return GetTreeCtrl();
  63. }
  64. // Unlocks the tree control
  65. void UnlockTreeControl() { m_TreeControlCriticalSection.Unlock(); }
  66. void ForceSelChange();
  67. private:
  68. // Builds the image list
  69. virtual void BuildImageList();
  70. // Collapses a tree item
  71. void Collapse(HTREEITEM hItem);
  72. // Overrides
  73. // ClassWizard generated virtual function overrides
  74. //{{AFX_VIRTUAL(CBaseTreeView)
  75. public:
  76. virtual void OnInitialUpdate();
  77. protected:
  78. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  79. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  80. //}}AFX_VIRTUAL
  81. // Implementation
  82. protected:
  83. virtual ~CBaseTreeView();
  84. #ifdef _DEBUG
  85. virtual void AssertValid() const;
  86. virtual void Dump(CDumpContext& dc) const;
  87. #endif
  88. // Generated message map functions
  89. protected:
  90. //{{AFX_MSG(CBaseTreeView)
  91. afx_msg LRESULT OnExpandAll(WPARAM wParam, LPARAM lParam);
  92. afx_msg LRESULT OnCollapseAll(WPARAM wParam, LPARAM lParam);
  93. afx_msg LRESULT OnCollapseToThirdLevel(WPARAM wParam, LPARAM lParam);
  94. afx_msg LRESULT OnCollapseToRootChildren(WPARAM wParam, LPARAM lParam);
  95. afx_msg LRESULT OnAdminRemoveWinStation(WPARAM wParam, LPARAM lParam);
  96. afx_msg void OnSelChange(NMHDR* pNMHDR, LRESULT* pResult);
  97. afx_msg void OnDestroy();
  98. //}}AFX_MSG
  99. DECLARE_MESSAGE_MAP()
  100. }; // end class CBaseTreeView
  101. #endif // _BASETREE_H