OSDN Git Service

Continued work on BrowserRefsDlg
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / BrowseRefsDlg.cpp
index bf9ca63..fe33cc8 100644 (file)
@@ -4,6 +4,7 @@
 #include "stdafx.h"\r
 #include "TortoiseProc.h"\r
 #include "BrowseRefsDlg.h"\r
+#include "LogDlg.h"\r
 \r
 \r
 // CBrowseRefsDlg dialog\r
@@ -31,6 +32,7 @@ void CBrowseRefsDlg::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CBrowseRefsDlg, CResizableStandAloneDialog)\r
        ON_BN_CLICKED(IDOK, &CBrowseRefsDlg::OnBnClickedOk)\r
        ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_REF, &CBrowseRefsDlg::OnTvnSelchangedTreeRef)\r
+       ON_NOTIFY(NM_RCLICK, IDC_LIST_REF_LEAFS, &CBrowseRefsDlg::OnNMRClickListRefLeafs)\r
 END_MESSAGE_MAP()\r
 \r
 \r
@@ -257,3 +259,32 @@ void CBrowseRefsDlg::FillListCtrlForShadowTree(CShadowTree* pTree, CString refNa
                }\r
        }\r
 }\r
+\r
+void CBrowseRefsDlg::OnNMRClickListRefLeafs(NMHDR *pNMHDR, LRESULT *pResult)\r
+{\r
+       LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);\r
+       *pResult = 0;\r
+\r
+       CMenu popupMenu;\r
+       popupMenu.CreatePopupMenu();\r
+       popupMenu.AppendMenu(MF_STRING,eCmd_ViewLog,L"View log");\r
+\r
+       CShadowTree* pTree = (CShadowTree*)m_ListRefLeafs.GetItemData(pNMHDR->idFrom);\r
+       if(pTree==NULL)\r
+               return;\r
+\r
+\r
+       const MSG* pCurrMsg=GetCurrentMessage();\r
+       eCmd cmd=(eCmd)popupMenu.TrackPopupMenuEx(TPM_LEFTALIGN|TPM_RETURNCMD, pCurrMsg->pt.x, pCurrMsg->pt.y, this, 0);\r
+       switch(cmd)\r
+       {\r
+       case eCmd_ViewLog:\r
+               {\r
+                       CLogDlg dlg;\r
+                       theApp.m_pMainWnd = &dlg;\r
+                       dlg.SetParams("", "", pTree->m_csRef, "", "");\r
+                       dlg.DoModal();\r
+               }\r
+               break;\r
+       }\r
+}\r