Source code of Windows XP (NT5)
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.

131 lines
3.5 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. // ObjVw.h : interface of the CObjView class
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10. #if !defined(AFX_OBJVW_H__4419F1AC_692B_11D3_BD30_0080C8E60955__INCLUDED_)
  11. #define AFX_OBJVW_H__4419F1AC_692B_11D3_BD30_0080C8E60955__INCLUDED_
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif // _MSC_VER > 1000
  15. #define HINT_NEW_CHILD 100
  16. #define HINT_NEW_OP 101
  17. #define HINT_OP_SEL 102
  18. #define HINT_OBJ_SEL 103
  19. #define HINT_ROOT_SEL 104
  20. #include "OpWrap.h"
  21. class CObjView : public CListView
  22. {
  23. protected: // create from serialization only
  24. CObjView();
  25. DECLARE_DYNCREATE(CObjView)
  26. // Attributes
  27. public:
  28. CWMITestDoc *GetDocument();
  29. CListCtrl *m_pList;
  30. // Operations
  31. public:
  32. void Flush();
  33. // Overrides
  34. // ClassWizard generated virtual function overrides
  35. //{{AFX_ VIRTUAL(CObjView)
  36. public:
  37. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  38. protected:
  39. virtual void OnInitialUpdate(); // called first time after construct
  40. virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  41. //}}AFX_VIRTUAL
  42. // Implementation
  43. public:
  44. virtual ~CObjView();
  45. #ifdef _DEBUG
  46. virtual void AssertValid() const;
  47. virtual void Dump(CDumpContext& dc) const;
  48. #endif
  49. HTREEITEM GetSelectedItem();
  50. int GetSelectedItemIndex();
  51. BOOL GetSelectedObjPath(CString &strPath);
  52. BOOL GetSelectedClass(CString &strClass);
  53. CObjInfo *GetCurrentObj();
  54. void SaveColumns();
  55. BOOL GetCurrentProperty(CObjInfo **ppInfo, CPropInfo **ppProp,
  56. VARIANT *pVar);
  57. void EditCurrentSelection();
  58. static BOOL EditProperty(CObjInfo *pObj, CPropInfo *pProp, VARIANT *pVar);
  59. static BOOL AddProperty(CObjInfo *pObj, CString &strName);
  60. protected:
  61. HTREEITEM m_hitemLastChildUpdate,
  62. m_hitemLastParentUpdate;
  63. COpWrap *m_pWrap;
  64. int m_nCols,
  65. m_iItemImage,
  66. m_iColHint;
  67. CIntArray m_piDisplayCols;
  68. int m_cxPropertyCols[3],
  69. m_cxSingleCol;
  70. void RemoveColumns();
  71. void AddColumns(HTREEITEM hItem = NULL);
  72. void AddObjValues(HTREEITEM hItem);
  73. void AddObjValues(CObjInfo *pInfo);
  74. void AddChildItems(HTREEITEM hItem);
  75. void DoPopupMenu(UINT nMenuID);
  76. BOOL InPropertyMode() { return m_pWrap == NULL; }
  77. BOOL CanCopy();
  78. void BuildSelectedOpList(COpList &list);
  79. // Generated message map functions
  80. protected:
  81. //{{AFX_MSG(CObjView)
  82. afx_msg void OnSize(UINT nType, int cx, int cy);
  83. afx_msg void OnGetDispInfo(NMHDR* pNMHDR, LRESULT* pResult);
  84. afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
  85. afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
  86. afx_msg void OnModify();
  87. afx_msg void OnUpdateModify(CCmdUI* pCmdUI);
  88. afx_msg void OnNewProp();
  89. afx_msg void OnUpdateNewProp(CCmdUI* pCmdUI);
  90. afx_msg void OnDelete();
  91. afx_msg void OnProperties();
  92. afx_msg void OnUpdateProperties(CCmdUI* pCmdUI);
  93. afx_msg void OnEditCopy();
  94. afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  95. //}}AFX_MSG
  96. afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
  97. DECLARE_MESSAGE_MAP()
  98. };
  99. #ifndef _DEBUG // debug version in ObjVw.cpp
  100. inline CWMITestDoc* CObjView::GetDocument()
  101. { return (CWMITestDoc*)m_pDocument; }
  102. #endif
  103. /////////////////////////////////////////////////////////////////////////////
  104. //{{AFX_INSERT_LOCATION}}
  105. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  106. #endif // !defined(AFX_OBJVW_H__4419F1AC_692B_11D3_BD30_0080C8E60955__INCLUDED_)