OSDN Git Service

Continued work on BrowserRefsDlg
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / BrowseRefsDlg.h
1 #pragma once\r
2 \r
3 #include "Git.h"\r
4 #include <map>\r
5 #include "afxcmn.h"\r
6 #include "StandAloneDlg.h"\r
7 \r
8 class CShadowTree\r
9 {\r
10 public:\r
11         typedef std::map<CString,CShadowTree> TShadowTreeMap;\r
12 \r
13         CShadowTree():m_hTree(NULL){}\r
14         \r
15         CShadowTree*    GetNextSub(CString& nameLeft);\r
16 \r
17         bool                    IsLeaf()const {return m_ShadowTree.empty();}\r
18 \r
19 \r
20         CString                 m_csName;\r
21         CString                 m_csRef;\r
22         CString                 m_csDate;\r
23         CString                 m_csAuthor;\r
24         CString                 m_csSubject;\r
25 \r
26         HTREEITEM               m_hTree;\r
27 \r
28         TShadowTreeMap  m_ShadowTree;\r
29         CShadowTree*    m_pParent;\r
30 };\r
31 \r
32 class CBrowseRefsDlg : public CResizableStandAloneDialog\r
33 {\r
34         DECLARE_DYNAMIC(CBrowseRefsDlg)\r
35 \r
36 public:\r
37         CBrowseRefsDlg(CWnd* pParent = NULL);   // standard constructor\r
38         virtual ~CBrowseRefsDlg();\r
39 \r
40         enum eCmd\r
41         {\r
42                 eCmd_ViewLog = WM_APP\r
43         };\r
44 \r
45 // Dialog Data\r
46         enum { IDD = IDD_DIALOG_BROWSE_REFS };\r
47 \r
48 protected:\r
49         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
50 \r
51         DECLARE_MESSAGE_MAP()\r
52 public:\r
53         afx_msg void OnBnClickedOk();\r
54         virtual BOOL OnInitDialog();\r
55 \r
56         void                    Refresh();\r
57 \r
58         CShadowTree&    GetTreeNode(CString refName, CShadowTree* pTreePos=NULL);\r
59 \r
60         void                    FillListCtrlForTreeNode(HTREEITEM treeNode);\r
61 \r
62         void                    FillListCtrlForShadowTree(CShadowTree* pTree, CString refNamePrefix, bool isFirstLevel);\r
63 \r
64         bool                    SelectRef(CString refName);\r
65 \r
66 private:\r
67 //      MAP_HASH_NAME   m_RefMap;\r
68 \r
69         CShadowTree             m_TreeRoot;\r
70         CTreeCtrl               m_RefTreeCtrl;\r
71         CListCtrl               m_ListRefLeafs;\r
72         afx_msg void OnTvnSelchangedTreeRef(NMHDR *pNMHDR, LRESULT *pResult);\r
73 public:\r
74         afx_msg void OnNMRClickListRefLeafs(NMHDR *pNMHDR, LRESULT *pResult);\r
75 };\r