BrowseRefsDlg: Added F5 shortcut for refresh
[TortoiseGit.git] / src / TortoiseProc / BrowseRefsDlg.h
blob4606494ef7edd5a8f8effa2a8dfb5990e5b3cbdb
1 #pragma once
3 #include "Git.h"
4 #include <map>
5 #include "afxcmn.h"
6 #include "StandAloneDlg.h"
8 class CShadowTree
10 public:
11 typedef std::map<CString,CShadowTree> TShadowTreeMap;
13 CShadowTree():m_hTree(NULL),m_pParent(NULL){}
15 CShadowTree* GetNextSub(CString& nameLeft);
17 bool IsLeaf()const {return m_ShadowTree.empty();}
18 CString GetRefName()const
20 if(m_pParent==NULL)
21 return m_csRefName;
22 return m_pParent->GetRefName()+"/"+m_csRefName;
24 bool IsFrom(const wchar_t* from)const
26 return wcsncmp(GetRefName(),from,wcslen(from))==0;
29 CString m_csRefName;
30 CString m_csRefHash;
31 CString m_csDate;
32 CString m_csAuthor;
33 CString m_csSubject;
35 HTREEITEM m_hTree;
37 TShadowTreeMap m_ShadowTree;
38 CShadowTree* m_pParent;
41 class CBrowseRefsDlg : public CResizableStandAloneDialog
43 DECLARE_DYNAMIC(CBrowseRefsDlg)
45 public:
46 CBrowseRefsDlg(CWnd* pParent = NULL); // standard constructor
47 virtual ~CBrowseRefsDlg();
49 enum eCmd
51 eCmd_ViewLog = WM_APP,
52 eCmd_AddRemote,
53 eCmd_CreateBranch,
54 eCmd_CreateTag
57 // Dialog Data
58 enum { IDD = IDD_DIALOG_BROWSE_REFS };
60 protected:
61 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
63 DECLARE_MESSAGE_MAP()
64 public:
65 afx_msg void OnBnClickedOk();
66 virtual BOOL OnInitDialog();
68 void Refresh();
70 CShadowTree& GetTreeNode(CString refName, CShadowTree* pTreePos=NULL);
72 void FillListCtrlForTreeNode(HTREEITEM treeNode);
74 void FillListCtrlForShadowTree(CShadowTree* pTree, CString refNamePrefix, bool isFirstLevel);
76 bool SelectRef(CString refName);
78 private:
80 CShadowTree m_TreeRoot;
81 CTreeCtrl m_RefTreeCtrl;
82 CListCtrl m_ListRefLeafs;
83 afx_msg void OnTvnSelchangedTreeRef(NMHDR *pNMHDR, LRESULT *pResult);
84 public:
86 afx_msg void OnContextMenu(CWnd* pWndFrom, CPoint point);
88 void OnContextMenu_ListRefLeafs(CPoint point);
89 void OnContextMenu_RefTreeCtrl(CPoint point);
90 virtual BOOL PreTranslateMessage(MSG* pMsg);