TOOLBAR_LButtonUp should work even if ReleaseCapture was already
called.
This commit is contained in:
parent
5b3855bf20
commit
874e14c57e
|
@ -4482,18 +4482,16 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
if((infoPtr->nHotItem >= 0) && (nHit != -1))
|
if((infoPtr->nHotItem >= 0) && (nHit != -1))
|
||||||
infoPtr->buttons[infoPtr->nHotItem].bHot = TRUE;
|
infoPtr->buttons[infoPtr->nHotItem].bHot = TRUE;
|
||||||
|
|
||||||
if ((infoPtr->bCaptured) && (infoPtr->nButtonDown >= 0)) {
|
|
||||||
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
|
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
|
||||||
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
||||||
|
|
||||||
if (nHit == infoPtr->nButtonDown) {
|
|
||||||
if (btnPtr->fsStyle & TBSTYLE_CHECK) {
|
if (btnPtr->fsStyle & TBSTYLE_CHECK) {
|
||||||
if (btnPtr->fsStyle & TBSTYLE_GROUP) {
|
if (btnPtr->fsStyle & TBSTYLE_GROUP) {
|
||||||
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr,
|
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr,
|
||||||
infoPtr->nButtonDown);
|
nHit);
|
||||||
if (nOldIndex == infoPtr->nButtonDown)
|
if (nOldIndex == nHit)
|
||||||
bSendMessage = FALSE;
|
bSendMessage = FALSE;
|
||||||
if ((nOldIndex != infoPtr->nButtonDown) &&
|
if ((nOldIndex != nHit) &&
|
||||||
(nOldIndex != -1))
|
(nOldIndex != -1))
|
||||||
infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED;
|
infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED;
|
||||||
btnPtr->fsState |= TBSTATE_CHECKED;
|
btnPtr->fsState |= TBSTATE_CHECKED;
|
||||||
|
@ -4505,9 +4503,6 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
btnPtr->fsState |= TBSTATE_CHECKED;
|
btnPtr->fsState |= TBSTATE_CHECKED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
bSendMessage = FALSE;
|
|
||||||
|
|
||||||
if (nOldIndex != -1)
|
if (nOldIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -4520,6 +4515,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
* that resets bCaptured and btn TBSTATE_PRESSED flags,
|
* that resets bCaptured and btn TBSTATE_PRESSED flags,
|
||||||
* and obliterates nButtonDown and nOldHit (see TOOLBAR_CaptureChanged)
|
* and obliterates nButtonDown and nOldHit (see TOOLBAR_CaptureChanged)
|
||||||
*/
|
*/
|
||||||
|
if ((infoPtr->bCaptured) && (infoPtr->nButtonDown >= 0))
|
||||||
ReleaseCapture ();
|
ReleaseCapture ();
|
||||||
|
|
||||||
/* Issue NM_RELEASEDCAPTURE to parent to let him know it is released */
|
/* Issue NM_RELEASEDCAPTURE to parent to let him know it is released */
|
||||||
|
@ -4541,9 +4537,8 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
||||||
TBN_ENDDRAG);
|
TBN_ENDDRAG);
|
||||||
|
|
||||||
if (bSendMessage)
|
|
||||||
SendMessageA (infoPtr->hwndNotify, WM_COMMAND,
|
SendMessageA (infoPtr->hwndNotify, WM_COMMAND,
|
||||||
MAKEWPARAM(btnPtr->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 NMRCLICK or NM_CLICK with the NMMOUSE structure.
|
* either NMRCLICK or NM_CLICK with the NMMOUSE structure.
|
||||||
|
@ -4553,8 +4548,6 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
nmmouse.dwItemData = btnPtr->dwData;
|
nmmouse.dwItemData = btnPtr->dwData;
|
||||||
TOOLBAR_SendNotify ((NMHDR *) &nmmouse, infoPtr,
|
TOOLBAR_SendNotify ((NMHDR *) &nmmouse, infoPtr,
|
||||||
NM_CLICK);
|
NM_CLICK);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue