Commit b18e1586 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

- Send NM_LDOWN notification.

- NM_RDBLCLK only needs to send a NMHDR structure. - On mouse notifications returning 0 DefWndProc should be called.
parent ead9e564
...@@ -5386,6 +5386,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -5386,6 +5386,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
POINT pt; POINT pt;
INT nHit; INT nHit;
NMTOOLBARA nmtb; NMTOOLBARA nmtb;
NMMOUSE nmmouse;
BOOL bDragKeyPressed; BOOL bDragKeyPressed;
TRACE("\n"); TRACE("\n");
...@@ -5506,6 +5507,23 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -5506,6 +5507,23 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_SendNotify((NMHDR *)&nmtb, infoPtr, TBN_BEGINDRAG); TOOLBAR_SendNotify((NMHDR *)&nmtb, infoPtr, TBN_BEGINDRAG);
} }
nmmouse.dwHitInfo = nHit;
/* !!! Undocumented - sends NM_LDOWN with the NMMOUSE structure. */
if (nmmouse.dwHitInfo < 0)
nmmouse.dwItemSpec = -1;
else
{
nmmouse.dwItemSpec = infoPtr->buttons[nmmouse.dwHitInfo].idCommand;
nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData;
}
ClientToScreen(hwnd, &pt);
nmmouse.pt = pt;
if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_LDOWN))
return DefWindowProcW(hwnd, WM_LBUTTONDOWN, wParam, lParam);
return 0; return 0;
} }
...@@ -5653,16 +5671,27 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -5653,16 +5671,27 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
SendMessageA (infoPtr->hwndNotify, WM_COMMAND, SendMessageA (infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(infoPtr->buttons[nHit].idCommand, 0), (LPARAM)hwnd); MAKEWPARAM(infoPtr->buttons[nHit].idCommand, 0), (LPARAM)hwnd);
}
}
/* !!! Undocumented - toolbar at 4.71 level and above sends /* !!! Undocumented - toolbar at 4.71 level and above sends
* either NM_RCLICK or NM_CLICK with the NMMOUSE structure. * NM_CLICK with the NMMOUSE structure. */
* Only NM_RCLICK is documented. nmmouse.dwHitInfo = nHit;
*/
nmmouse.dwItemSpec = btnPtr->idCommand; if (nmmouse.dwHitInfo < 0)
nmmouse.dwItemData = btnPtr->dwData; nmmouse.dwItemSpec = -1;
TOOLBAR_SendNotify ((NMHDR *) &nmmouse, infoPtr, NM_CLICK); else
} {
nmmouse.dwItemSpec = infoPtr->buttons[nmmouse.dwHitInfo].idCommand;
nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData;
} }
ClientToScreen(hwnd, &pt);
nmmouse.pt = pt;
if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_CLICK))
return DefWindowProcW(hwnd, WM_LBUTTONUP, wParam, lParam);
return 0; return 0;
} }
...@@ -5687,9 +5716,10 @@ TOOLBAR_RButtonUp( HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -5687,9 +5716,10 @@ TOOLBAR_RButtonUp( HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
ClientToScreen(hwnd, &pt); ClientToScreen(hwnd, &pt);
memcpy(&nmmouse.pt, &pt, sizeof(POINT)); nmmouse.pt = pt;
TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RCLICK); if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RCLICK))
return DefWindowProcW(hwnd, WM_RBUTTONUP, wParam, lParam);
return 0; return 0;
} }
...@@ -5698,26 +5728,10 @@ static LRESULT ...@@ -5698,26 +5728,10 @@ static LRESULT
TOOLBAR_RButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_RButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
NMHDR nmhdr;
NMMOUSE nmmouse; if (!TOOLBAR_SendNotify(&nmhdr, infoPtr, NM_RDBLCLK))
POINT pt; return DefWindowProcW(hwnd, WM_RBUTTONDBLCLK, wParam, lParam);
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
nmmouse.dwHitInfo = TOOLBAR_InternalHitTest(hwnd, &pt);
if (nmmouse.dwHitInfo < 0)
nmmouse.dwItemSpec = -1;
else {
nmmouse.dwItemSpec = infoPtr->buttons[nmmouse.dwHitInfo].idCommand;
nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData;
}
ClientToScreen(hwnd, &pt);
memcpy(&nmmouse.pt, &pt, sizeof(POINT));
TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RDBLCLK);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment