mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
Added context menu on right click in treeviews
svn path=/trunk/; revision=29384
This commit is contained in:
parent
62cb1ae6bf
commit
7d65442299
2 changed files with 39 additions and 0 deletions
|
@ -172,3 +172,26 @@ Index: treeview.c
|
|||
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
|
||||
infoPtr->cdmode =
|
||||
TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect);
|
||||
@@ -4160,6 +4158,22 @@
|
||||
static LRESULT
|
||||
TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt)
|
||||
{
|
||||
+ TVHITTESTINFO ht;
|
||||
+
|
||||
+ ht.pt = *pPt;
|
||||
+
|
||||
+ TREEVIEW_HitTest(infoPtr, &ht);
|
||||
+
|
||||
+ if (ht.hItem)
|
||||
+ {
|
||||
+ /* Change to screen coordinate for WM_CONTEXTMENU */
|
||||
+ ClientToScreen(infoPtr->hwnd, &ht.pt);
|
||||
+
|
||||
+ /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
|
||||
+ SendMessageW(infoPtr->hwnd, WM_CONTEXTMENU,
|
||||
+ (WPARAM)infoPtr->hwnd, MAKELPARAM(ht.pt.x, ht.pt.y));
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -4158,6 +4158,22 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
|
|||
static LRESULT
|
||||
TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt)
|
||||
{
|
||||
TVHITTESTINFO ht;
|
||||
|
||||
ht.pt = *pPt;
|
||||
|
||||
TREEVIEW_HitTest(infoPtr, &ht);
|
||||
|
||||
if (ht.hItem)
|
||||
{
|
||||
/* Change to screen coordinate for WM_CONTEXTMENU */
|
||||
ClientToScreen(infoPtr->hwnd, &ht.pt);
|
||||
|
||||
/* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
|
||||
SendMessageW(infoPtr->hwnd, WM_CONTEXTMENU,
|
||||
(WPARAM)infoPtr->hwnd, MAKELPARAM(ht.pt.x, ht.pt.y));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue