00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_CTRLSHAREDFOLDER_H__15350972_9EEB_47FD_896F_5644AA6546B8__INCLUDED_)
00023 #define AFX_CTRLSHAREDFOLDER_H__15350972_9EEB_47FD_896F_5644AA6546B8__INCLUDED_
00024
00025 #pragma once
00026
00027 class CLibraryFolder;
00028
00029
00030 class CLibraryFolderCtrl : public CTreeCtrl
00031 {
00032
00033 public:
00034 CLibraryFolderCtrl();
00035 virtual ~CLibraryFolderCtrl();
00036
00037
00038 protected:
00039 HTREEITEM m_hRoot;
00040 HTREEITEM m_hFirstSelected;
00041 BOOL m_bFirstClick;
00042 BOOL m_bMultiSelect;
00043 BOOL m_bSaveExpand;
00044
00045
00046 public:
00047 void SetMultiSelect(BOOL bMultiSelect);
00048 void SetSaveExpand(BOOL bSaveExpand);
00049 void Update(DWORD nUpdateCookie = 0);
00050 void SetSelectedCookie(DWORD nUpdateCookie, HTREEITEM hParent = NULL, BOOL bSelect = FALSE);
00051 POSITION GetSelectedFolderIterator() const;
00052 CLibraryFolder* GetNextSelectedFolder(POSITION& pos) const;
00053 BOOL ClearSelection(HTREEITEM hExcept = NULL, HTREEITEM hItem = NULL, BOOL bSelect = FALSE);
00054 BOOL SelectAll(HTREEITEM hExcept = NULL);
00055 BOOL SelectFolder(CLibraryFolder* pFolder, HTREEITEM hItem = NULL);
00056 protected:
00057 void Update(CLibraryFolder* pFolder, HTREEITEM hFolder, HTREEITEM hParent, DWORD nUpdateCookie, BOOL bRecurse);
00058 BOOL SelectItems(HTREEITEM hItemFrom, HTREEITEM hItemTo);
00059 HTREEITEM GetFirstSelectedItem() const;
00060 HTREEITEM GetNextSelectedItem(HTREEITEM hItem) const;
00061 void NotifySelectionChanged();
00062
00063
00064 public:
00065
00066 public:
00067 virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00068
00069
00070
00071 protected:
00072
00073 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00074 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00075 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00076 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00077 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00078 afx_msg void OnItemExpanded(NMHDR* pNMHDR, LRESULT* pResult);
00079 afx_msg void OnSelChanged(NMHDR* pNMHDR, LRESULT* pResult);
00080 afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
00081 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00082 afx_msg void OnNcPaint();
00083
00084
00085 DECLARE_MESSAGE_MAP()
00086 };
00087
00088
00089
00090 #endif // !defined(AFX_CTRLSHAREDFOLDER_H__15350972_9EEB_47FD_896F_5644AA6546B8__INCLUDED_)