From 1c14e99dd57b0ccea99d8efa4ce94ab5c6077276 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Apr 2014 18:51:57 +0000 Subject: minor patch for clicks in menu editor git-svn-id: http://svn.miranda-ng.org/main/trunk@8827 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/genmenuopt.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 60286a8a4c..cc2fb20666 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -477,11 +477,11 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) return 0; } -static void OnClickCheckbox(HWND hwndDlg, HWND hwndTree) +static void OnClickCheckbox(HWND hwndDlg, HWND hwndTree, HTREEITEM hItem) { TVITEM tvi; tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; - tvi.hItem = TreeView_GetSelection(hwndTree); + tvi.hItem = hItem; TreeView_GetItem(hwndTree, &tvi); tvi.iImage = tvi.iSelectedImage = !tvi.iImage; @@ -636,7 +636,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case TVN_KEYDOWN: if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_SPACE) - OnClickCheckbox(hwndDlg, hdr->hwndFrom); + OnClickCheckbox(hwndDlg, hdr->hwndFrom, TreeView_GetSelection(hdr->hwndFrom)); break; case NM_CLICK: @@ -647,7 +647,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ScreenToClient(hdr->hwndFrom, &hti.pt); if (TreeView_HitTest(hdr->hwndFrom, &hti)) { if (hti.flags & TVHT_ONITEMICON) - OnClickCheckbox(hwndDlg, hdr->hwndFrom); + OnClickCheckbox(hwndDlg, hdr->hwndFrom, hti.hItem); /*--------MultiSelection----------*/ if (hti.flags & TVHT_ONITEMLABEL) { -- cgit v1.2.3