PaneLibrary.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:3k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // PaneLibrary.h: interface for the CPaneLibrary class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_PANELIBRARY_H__6C481840_FE83_4798_9524_1A01F1FB13DB__INCLUDED_)
  5. #define AFX_PANELIBRARY_H__6C481840_FE83_4798_9524_1A01F1FB13DB__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CTreeLibrary : public CTreeCtrl
  10. {
  11. protected:
  12. LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam);
  13. protected:
  14. //{{AFX_MSG(CTreeLibrary)
  15. //}}AFX_MSG
  16. DECLARE_MESSAGE_MAP()
  17. };
  18. enum TreeType
  19. {
  20. treeRoot,
  21. treeCategory,
  22. treeAction
  23. };
  24. class CPaneLibrary : public CPaneHolder 
  25. {
  26. public:
  27. CPaneLibrary();
  28. virtual ~CPaneLibrary();
  29. public:
  30. TreeType GetItemType(HTREEITEM hItem);
  31. //{{AFX_MSG(CPaneLibrary)
  32. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  33. afx_msg void OnSize(UINT nType, int cx, int cy);
  34. //}}AFX_MSG
  35. afx_msg void OnTreeSelChange(NMHDR*, LRESULT*);
  36. afx_msg void OnTreeSetFocus(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/);
  37. afx_msg void OnTreeRightClick(NMHDR*, LRESULT*);
  38. afx_msg void OnTreeBeginLabelEdit(NMHDR* pHdr, LRESULT*);
  39. afx_msg void OnTreeEndLabelEdit(NMHDR* pHdr, LRESULT*);
  40. afx_msg void OnTreeBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
  41. afx_msg void OnTreeCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
  42. afx_msg void OnLibraryNew();
  43. afx_msg void OnLibraryOpen();
  44. afx_msg void OnLibrarySave();
  45. afx_msg void OnSetFocus(CWnd*);
  46. DECLARE_MESSAGE_MAP()
  47. void CreateStandardActions();
  48. void AddAction(int nID, LPCTSTR lpszKey, LPCTSTR lpszCategory);
  49. CImageList m_ilTreeIcons;
  50. HTREEITEM AddCategory(CString strCategory);
  51. void ExchangeCategories(CXTPPropExchange* pPX);
  52. void RefreshItem(HTREEITEM hItem);
  53. CObject* RefreshPropertyGrid(CXTPPropertyGrid* pPropertyGrid);
  54. BOOL OnPropertyGridValueChanged(CObject* pActiveObject, CXTPPropertyGridItem* pItem);
  55. int FindLastId();
  56. int GetTreeChildCount(HTREEITEM hItem);
  57. void FillActions();
  58. protected:
  59. class CActions : public CXTPControlActions
  60. {
  61. public:
  62. CActions()
  63. : CXTPControlActions(NULL)
  64. {
  65. }
  66. public:
  67. void ReplaceActionId(CXTPControlAction* pAction, int nID);
  68. void DeleteAction(CXTPControlAction* pAction);
  69. };
  70. CActions* m_pActions;
  71. CXTPToolBar m_wndToolBar;
  72. CTreeLibrary m_wndTreeCtrl;
  73. public:
  74. CXTPControlAction* m_pDragAction;
  75. CXTPImageManager* m_pIcons;
  76. static CLIPFORMAT m_cfItem;
  77. };
  78. #endif // !defined(AFX_PANELIBRARY_H__6C481840_FE83_4798_9524_1A01F1FB13DB__INCLUDED_)