From: Johan t Hart Date: Fri, 24 Apr 2009 22:27:29 +0000 (+0200) Subject: Continued work on BrowserRefsDlg X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=commitdiff_plain;h=f0ff2dc88799076e017d648dbcde50229f7c96c2;ds=sidebyside Continued work on BrowserRefsDlg --- diff --git a/src/TortoiseProc/BrowseRefsDlg.cpp b/src/TortoiseProc/BrowseRefsDlg.cpp index bf9ca63..fe33cc8 100644 --- a/src/TortoiseProc/BrowseRefsDlg.cpp +++ b/src/TortoiseProc/BrowseRefsDlg.cpp @@ -4,6 +4,7 @@ #include "stdafx.h" #include "TortoiseProc.h" #include "BrowseRefsDlg.h" +#include "LogDlg.h" // CBrowseRefsDlg dialog @@ -31,6 +32,7 @@ void CBrowseRefsDlg::DoDataExchange(CDataExchange* pDX) BEGIN_MESSAGE_MAP(CBrowseRefsDlg, CResizableStandAloneDialog) ON_BN_CLICKED(IDOK, &CBrowseRefsDlg::OnBnClickedOk) ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_REF, &CBrowseRefsDlg::OnTvnSelchangedTreeRef) + ON_NOTIFY(NM_RCLICK, IDC_LIST_REF_LEAFS, &CBrowseRefsDlg::OnNMRClickListRefLeafs) END_MESSAGE_MAP() @@ -257,3 +259,32 @@ void CBrowseRefsDlg::FillListCtrlForShadowTree(CShadowTree* pTree, CString refNa } } } + +void CBrowseRefsDlg::OnNMRClickListRefLeafs(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + *pResult = 0; + + CMenu popupMenu; + popupMenu.CreatePopupMenu(); + popupMenu.AppendMenu(MF_STRING,eCmd_ViewLog,L"View log"); + + CShadowTree* pTree = (CShadowTree*)m_ListRefLeafs.GetItemData(pNMHDR->idFrom); + if(pTree==NULL) + return; + + + const MSG* pCurrMsg=GetCurrentMessage(); + eCmd cmd=(eCmd)popupMenu.TrackPopupMenuEx(TPM_LEFTALIGN|TPM_RETURNCMD, pCurrMsg->pt.x, pCurrMsg->pt.y, this, 0); + switch(cmd) + { + case eCmd_ViewLog: + { + CLogDlg dlg; + theApp.m_pMainWnd = &dlg; + dlg.SetParams("", "", pTree->m_csRef, "", ""); + dlg.DoModal(); + } + break; + } +} diff --git a/src/TortoiseProc/BrowseRefsDlg.h b/src/TortoiseProc/BrowseRefsDlg.h index 28e7d9a..f90cce2 100644 --- a/src/TortoiseProc/BrowseRefsDlg.h +++ b/src/TortoiseProc/BrowseRefsDlg.h @@ -37,6 +37,11 @@ public: CBrowseRefsDlg(CWnd* pParent = NULL); // standard constructor virtual ~CBrowseRefsDlg(); + enum eCmd + { + eCmd_ViewLog = WM_APP + }; + // Dialog Data enum { IDD = IDD_DIALOG_BROWSE_REFS }; @@ -65,4 +70,6 @@ private: CTreeCtrl m_RefTreeCtrl; CListCtrl m_ListRefLeafs; afx_msg void OnTvnSelchangedTreeRef(NMHDR *pNMHDR, LRESULT *pResult); +public: + afx_msg void OnNMRClickListRefLeafs(NMHDR *pNMHDR, LRESULT *pResult); };