diff options
author | assarbad <none@none> | 2004-11-12 12:27:01 +0300 |
---|---|---|
committer | assarbad <none@none> | 2004-11-12 12:27:01 +0300 |
commit | 5f55ebc5837cad4990176ff1ca2df011966c5be0 (patch) | |
tree | 61ed37b01e77d2bf96e0fd4aae4cccbbb300ce0e /windirstat/dirstatview.cpp | |
parent | 53b5aabdbe620e9dc039e2c6bec87c58eac9a2b9 (diff) |
- Implemented ExplorerStyle option which will not be accessible through the options dialog.
It handles where the context menu is being shown.
Diffstat (limited to 'windirstat/dirstatview.cpp')
-rw-r--r-- | windirstat/dirstatview.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/windirstat/dirstatview.cpp b/windirstat/dirstatview.cpp index 79f419e..d179d8a 100644 --- a/windirstat/dirstatview.cpp +++ b/windirstat/dirstatview.cpp @@ -66,8 +66,16 @@ void CMyTreeListControl::OnContextMenu(CWnd* /*pWnd*/, CPoint ptscreen) CRect rc= GetWholeSubitemRect(i, 0); CRect rcTitle= item->GetTitleRect() + rc.TopLeft(); -// CPoint ptmenu(rcTitle.right, rcTitle.top + rcTitle.Height() / 2); -// ClientToScreen(&ptmenu); + CPoint ptmenu(rcTitle.right, rcTitle.top + rcTitle.Height() / 2); + // Decide wether the context menu should be shown at the cursor (explorer style) + // or right to the name of the item (classic WinDirStat style) + // This can be set by the "ExplorerStyle" value of REG_DWORD treated as bool + if (!GetOptions()->IsExplorerStyle()) + // We take WDS style + ClientToScreen(&ptmenu); + else + // We use Explorer style + ptmenu = ptscreen; CMenu menu; menu.LoadMenu(IDR_POPUPLIST); @@ -76,8 +84,8 @@ void CMyTreeListControl::OnContextMenu(CWnd* /*pWnd*/, CPoint ptscreen) PrepareDefaultMenu(sub, (CItem *)item); GetMainFrame()->AppendUserDefinedCleanups(sub); - sub->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, ptscreen.x, ptscreen.y, AfxGetMainWnd()); -// sub->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, ptmenu.x, ptmenu.y, AfxGetMainWnd()); + // Show popup menu and act accordingly. + sub->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, ptmenu.x, ptmenu.y, AfxGetMainWnd()); } void CMyTreeListControl::OnItemDoubleClick(int i) @@ -390,6 +398,10 @@ void CDirstatView::Dump(CDumpContext& dc) const // $Log$ +// Revision 1.11 2004/11/12 09:27:01 assarbad +// - Implemented ExplorerStyle option which will not be accessible through the options dialog. +// It handles where the context menu is being shown. +// // Revision 1.10 2004/11/09 22:30:40 assarbad // - Context menu at the actual position after right-click in the tree (may be reverted) // |