6 #include "StandAloneDlg.h"
11 typedef std::map
<CString
,CShadowTree
> TShadowTreeMap
;
13 CShadowTree():m_hTree(NULL
),m_pParent(NULL
){}
15 CShadowTree
* GetNextSub(CString
& nameLeft
, bool bCreateIfNotExist
);
17 bool IsLeaf()const {return m_ShadowTree
.empty();}
18 CString
GetRefName()const
22 return m_pParent
->GetRefName()+"/"+m_csRefName
;
24 bool IsFrom(const wchar_t* from
)const
26 return wcsncmp(GetRefName(),from
,wcslen(from
))==0;
37 TShadowTreeMap m_ShadowTree
;
38 CShadowTree
* m_pParent
;
40 typedef std::vector
<CShadowTree
*> VectorPShadowTree
;
42 class CBrowseRefsDlg
: public CResizableStandAloneDialog
44 DECLARE_DYNAMIC(CBrowseRefsDlg
)
47 CBrowseRefsDlg(CString cmdPath
, CWnd
* pParent
= NULL
); // standard constructor
48 virtual ~CBrowseRefsDlg();
52 eCmd_ViewLog
= WM_APP
,
62 enum { IDD
= IDD_DIALOG_BROWSE_REFS
};
65 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
69 afx_msg
void OnBnClickedOk();
70 virtual BOOL
OnInitDialog();
72 void Refresh(bool bSelectCurHead
=false);
74 CShadowTree
& GetTreeNode(CString refName
, CShadowTree
* pTreePos
=NULL
, bool bCreateIfNotExist
=false);
76 void FillListCtrlForTreeNode(HTREEITEM treeNode
);
78 void FillListCtrlForShadowTree(CShadowTree
* pTree
, CString refNamePrefix
, bool isFirstLevel
);
80 bool SelectRef(CString refName
);
82 bool ConfirmDeleteRef(CString completeRefName
);
83 bool DoDeleteRef(CString completeRefName
, bool bForce
);
88 CShadowTree m_TreeRoot
;
89 CTreeCtrl m_RefTreeCtrl
;
90 CListCtrl m_ListRefLeafs
;
91 afx_msg
void OnTvnSelchangedTreeRef(NMHDR
*pNMHDR
, LRESULT
*pResult
);
94 afx_msg
void OnContextMenu(CWnd
* pWndFrom
, CPoint point
);
96 void OnContextMenu_ListRefLeafs(CPoint point
);
97 void OnContextMenu_RefTreeCtrl(CPoint point
);
99 void ShowContextMenu(CPoint point
, HTREEITEM hTreePos
, VectorPShadowTree
& selectedLeafs
);
100 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);