mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Sync with Wine-20040213:
Huw Davies <huw@codeweavers.com> Only redraw button in PressButton and Indeterminate if its state has changed. Huw Davies <huw@codeweavers.com> Honour TB_SETMAXTEXTROWS. Ulrich Czekalla <ulrich@codeweavers.com> Add support for BTNS_WHOLEDROPDOWN. Populate button rect when sending TBN_DROPDOWN. Dmitry Timoshkov <dmitry@codeweavers.com> Add partial support for some undocumented toolbar messages. Huw Davies <huw@codeweavers.com> TB_ADDBUTTONS can pass a string ptr instead of an index. TB_GETBUTTONINFO only returns a string if it's not in the internal string list. Huw Davies <huw@codeweavers.com> Use the BTNS_* toolbar button style defines rather than the outdated TBSTYLE_*. Huw Davies <huw@codeweavers.com> Add a missing return. Jon Griffiths <jon_p_griffiths@yahoo.com> Draw disabled toolbar buttons correctly. svn path=/trunk/; revision=8234
This commit is contained in:
parent
df3569b50b
commit
f3b3a68770
1 changed files with 175 additions and 97 deletions
|
@ -497,7 +497,7 @@ TOOLBAR_DrawFlatSeparator (LPRECT lpRect, HDC hdc, TOOLBAR_INFO *infoPtr)
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* TOOLBAR_DrawDDFlatSeparator
|
* TOOLBAR_DrawDDFlatSeparator
|
||||||
*
|
*
|
||||||
* This function draws the separator that was flaged as TBSTYLE_DROPDOWN.
|
* This function draws the separator that was flaged as BTNS_DROPDOWN.
|
||||||
* In this case, the separator is a pixel high line of COLOR_BTNSHADOW,
|
* In this case, the separator is a pixel high line of COLOR_BTNSHADOW,
|
||||||
* followed by a pixel high line of COLOR_BTNHIGHLIGHT. These separators
|
* followed by a pixel high line of COLOR_BTNHIGHLIGHT. These separators
|
||||||
* are horizontal as opposed to the vertical separators for not dropdown
|
* are horizontal as opposed to the vertical separators for not dropdown
|
||||||
|
@ -614,40 +614,52 @@ TOOLBAR_DrawPattern (HDC hdc, LPRECT lpRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void TOOLBAR_DrawMasked(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
||||||
TOOLBAR_DrawMasked (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
|
||||||
HDC hdc, INT x, INT y)
|
HDC hdc, INT x, INT y)
|
||||||
{
|
{
|
||||||
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, 0);
|
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, 0);
|
||||||
INT cx, cy;
|
|
||||||
HBITMAP hbmMask;
|
|
||||||
HDC hdcMask;
|
|
||||||
|
|
||||||
if (!himl)
|
if (himl)
|
||||||
return;
|
{
|
||||||
|
INT cx, cy;
|
||||||
|
HBITMAP hbmMask, hbmImage;
|
||||||
|
HDC hdcMask, hdcImage;
|
||||||
|
|
||||||
ImageList_GetIconSize(himl, &cx, &cy);
|
ImageList_GetIconSize(himl, &cx, &cy);
|
||||||
|
|
||||||
/* create new dc's */
|
/* Create src image */
|
||||||
hdcMask = CreateCompatibleDC (0);
|
hdcImage = CreateCompatibleDC(hdc);
|
||||||
|
hbmImage = CreateBitmap(cx, cy, GetDeviceCaps(hdc,PLANES),
|
||||||
|
GetDeviceCaps(hdc,BITSPIXEL), NULL);
|
||||||
|
SelectObject(hdcImage, hbmImage);
|
||||||
|
ImageList_DrawEx(himl, btnPtr->iBitmap, hdcImage, 0, 0, cx, cy,
|
||||||
|
RGB(0xff, 0xff, 0xff), RGB(0,0,0), ILD_NORMAL);
|
||||||
|
|
||||||
/* create new bitmap */
|
/* Create Mask */
|
||||||
|
hdcMask = CreateCompatibleDC(0);
|
||||||
hbmMask = CreateBitmap(cx, cy, 1, 1, NULL);
|
hbmMask = CreateBitmap(cx, cy, 1, 1, NULL);
|
||||||
SelectObject(hdcMask, hbmMask);
|
SelectObject(hdcMask, hbmMask);
|
||||||
|
|
||||||
/* copy the mask bitmap */
|
/* Remove the background and all white pixels */
|
||||||
ImageList_DrawEx(himl, btnPtr->iBitmap, hdcMask, 0, 0, 0, 0, RGB(255, 255, 255), RGB(0, 0, 0), ILD_MASK);
|
SetBkColor(hdcImage, ImageList_GetBkColor(himl));
|
||||||
|
BitBlt(hdcMask, 0, 0, cx, cy, hdcImage, 0, 0, SRCCOPY);
|
||||||
|
SetBkColor(hdcImage, RGB(0xff, 0xff, 0xff));
|
||||||
|
BitBlt(hdcMask, 0, 0, cx, cy, hdcImage, 0, 0, NOTSRCERASE);
|
||||||
|
|
||||||
/* draw the new mask */
|
/* draw the new mask 'etched' to hdc */
|
||||||
|
SetBkColor(hdc, RGB(255, 255, 255));
|
||||||
SelectObject(hdc, GetSysColorBrush(COLOR_3DHILIGHT));
|
SelectObject(hdc, GetSysColorBrush(COLOR_3DHILIGHT));
|
||||||
BitBlt (hdc, x+1, y+1, cx, cy, hdcMask, 0, 0, 0xB8074A);
|
BitBlt(hdc, x + 1, y + 1, cx, cy, hdcMask, 0, 0, 0xE20746);
|
||||||
|
|
||||||
SelectObject(hdc, GetSysColorBrush(COLOR_3DSHADOW));
|
SelectObject(hdc, GetSysColorBrush(COLOR_3DSHADOW));
|
||||||
BitBlt (hdc, x, y, cx, cy, hdcMask, 0, 0, 0xB8074A);
|
BitBlt(hdc, x, y, cx, cy, hdcMask, 0, 0, 0xE20746);
|
||||||
|
|
||||||
|
/* Cleanup */
|
||||||
|
DeleteObject(hbmImage);
|
||||||
|
DeleteDC(hdcImage);
|
||||||
DeleteObject (hbmMask);
|
DeleteObject (hbmMask);
|
||||||
DeleteDC(hdcMask);
|
DeleteDC(hdcMask);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static UINT
|
static UINT
|
||||||
|
@ -672,8 +684,11 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
{
|
{
|
||||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||||
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
|
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
|
||||||
BOOL hasDropDownArrow = TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) &&
|
BOOL hasDropDownArrow = (TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) &&
|
||||||
(btnPtr->fsStyle & TBSTYLE_DROPDOWN);
|
(btnPtr->fsStyle & BTNS_DROPDOWN)) ||
|
||||||
|
(btnPtr->fsStyle & BTNS_WHOLEDROPDOWN);
|
||||||
|
BOOL drawSepDropDownArrow = hasDropDownArrow &&
|
||||||
|
(~btnPtr->fsStyle & BTNS_WHOLEDROPDOWN);
|
||||||
RECT rc, rcArrow, rcBitmap, rcText, rcFill;
|
RECT rc, rcArrow, rcBitmap, rcText, rcFill;
|
||||||
LPWSTR lpText = NULL;
|
LPWSTR lpText = NULL;
|
||||||
NMTBCUSTOMDRAW tbcd;
|
NMTBCUSTOMDRAW tbcd;
|
||||||
|
@ -693,11 +708,17 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
|
|
||||||
if (hasDropDownArrow)
|
if (hasDropDownArrow)
|
||||||
{
|
{
|
||||||
|
int right;
|
||||||
|
|
||||||
if (dwStyle & TBSTYLE_FLAT)
|
if (dwStyle & TBSTYLE_FLAT)
|
||||||
rc.right = max(rc.left, rc.right - DDARROW_WIDTH);
|
right = max(rc.left, rc.right - DDARROW_WIDTH);
|
||||||
else
|
else
|
||||||
rc.right = max(rc.left, rc.right - DDARROW_WIDTH - 2);
|
right = max(rc.left, rc.right - DDARROW_WIDTH - 2);
|
||||||
rcArrow.left = rc.right;
|
|
||||||
|
if (drawSepDropDownArrow)
|
||||||
|
rc.right = right;
|
||||||
|
|
||||||
|
rcArrow.left = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy text rect after adjusting for drop-down arrow
|
/* copy text rect after adjusting for drop-down arrow
|
||||||
|
@ -733,7 +754,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
* I changed it. IE4 "Links" toolbar would not
|
* I changed it. IE4 "Links" toolbar would not
|
||||||
* draw correctly with the original code. - GA 8/01
|
* draw correctly with the original code. - GA 8/01
|
||||||
* ((dwStyle & TBSTYLE_LIST) &&
|
* ((dwStyle & TBSTYLE_LIST) &&
|
||||||
* ((btnPtr->fsStyle & TBSTYLE_AUTOSIZE) == 0) &&
|
* ((btnPtr->fsStyle & BTNS_AUTOSIZE) == 0) &&
|
||||||
* (btnPtr->iBitmap != I_IMAGENONE))
|
* (btnPtr->iBitmap != I_IMAGENONE))
|
||||||
*/
|
*/
|
||||||
if (dwStyle & TBSTYLE_LIST) {
|
if (dwStyle & TBSTYLE_LIST) {
|
||||||
|
@ -810,19 +831,19 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
FillRect( hdc, &rcFill, GetSysColorBrush(COLOR_BTNFACE));
|
FillRect( hdc, &rcFill, GetSysColorBrush(COLOR_BTNFACE));
|
||||||
|
|
||||||
/* separator */
|
/* separator */
|
||||||
if (btnPtr->fsStyle & TBSTYLE_SEP) {
|
if (btnPtr->fsStyle & BTNS_SEP) {
|
||||||
/* with the FLAT style, iBitmap is the width and has already */
|
/* with the FLAT style, iBitmap is the width and has already */
|
||||||
/* been taken into consideration in calculating the width */
|
/* been taken into consideration in calculating the width */
|
||||||
/* so now we need to draw the vertical separator */
|
/* so now we need to draw the vertical separator */
|
||||||
/* empirical tests show that iBitmap can/will be non-zero */
|
/* empirical tests show that iBitmap can/will be non-zero */
|
||||||
/* when drawing the vertical bar... */
|
/* when drawing the vertical bar... */
|
||||||
if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) {
|
if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) {
|
||||||
if (btnPtr->fsStyle & TBSTYLE_DROPDOWN)
|
if (btnPtr->fsStyle & BTNS_DROPDOWN)
|
||||||
TOOLBAR_DrawDDFlatSeparator (&rc, hdc, btnPtr, infoPtr);
|
TOOLBAR_DrawDDFlatSeparator (&rc, hdc, btnPtr, infoPtr);
|
||||||
else
|
else
|
||||||
TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr);
|
TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr);
|
||||||
}
|
}
|
||||||
else if (btnPtr->fsStyle != TBSTYLE_SEP) {
|
else if (btnPtr->fsStyle != BTNS_SEP) {
|
||||||
FIXME("Draw some kind of separator: fsStyle=%x\n",
|
FIXME("Draw some kind of separator: fsStyle=%x\n",
|
||||||
btnPtr->fsStyle);
|
btnPtr->fsStyle);
|
||||||
}
|
}
|
||||||
|
@ -858,7 +879,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
{
|
{
|
||||||
DrawEdge (hdc, &rc, EDGE_RAISED,
|
DrawEdge (hdc, &rc, EDGE_RAISED,
|
||||||
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||||
if (hasDropDownArrow)
|
if (drawSepDropDownArrow)
|
||||||
DrawEdge (hdc, &rcArrow, EDGE_RAISED,
|
DrawEdge (hdc, &rcArrow, EDGE_RAISED,
|
||||||
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||||
}
|
}
|
||||||
|
@ -879,7 +900,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
goto FINALNOTIFY;
|
goto FINALNOTIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pressed TBSTYLE_BUTTON */
|
/* pressed BTNS_BUTTON */
|
||||||
if (tbcd.nmcd.uItemState & CDIS_SELECTED) {
|
if (tbcd.nmcd.uItemState & CDIS_SELECTED) {
|
||||||
offset = (infoPtr->dwItemCDFlag & TBCDRF_NOOFFSET) ? 0 : 1;
|
offset = (infoPtr->dwItemCDFlag & TBCDRF_NOOFFSET) ? 0 : 1;
|
||||||
if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
|
if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
|
||||||
|
@ -887,13 +908,13 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
if (dwStyle & TBSTYLE_FLAT)
|
if (dwStyle & TBSTYLE_FLAT)
|
||||||
{
|
{
|
||||||
DrawEdge (hdc, &rc, BDR_SUNKENOUTER, BF_RECT | BF_ADJUST);
|
DrawEdge (hdc, &rc, BDR_SUNKENOUTER, BF_RECT | BF_ADJUST);
|
||||||
if (hasDropDownArrow)
|
if (drawSepDropDownArrow)
|
||||||
DrawEdge (hdc, &rcArrow, BDR_SUNKENOUTER, BF_RECT | BF_ADJUST);
|
DrawEdge (hdc, &rcArrow, BDR_SUNKENOUTER, BF_RECT | BF_ADJUST);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawEdge (hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_MIDDLE | BF_ADJUST);
|
DrawEdge (hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||||
if (hasDropDownArrow)
|
if (drawSepDropDownArrow)
|
||||||
DrawEdge (hdc, &rcArrow, EDGE_SUNKEN, BF_RECT | BF_MIDDLE | BF_ADJUST);
|
DrawEdge (hdc, &rcArrow, EDGE_SUNKEN, BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -910,9 +931,9 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
goto FINALNOTIFY;
|
goto FINALNOTIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* checked TBSTYLE_CHECK */
|
/* checked BTNS_CHECK */
|
||||||
if ((tbcd.nmcd.uItemState & CDIS_CHECKED) &&
|
if ((tbcd.nmcd.uItemState & CDIS_CHECKED) &&
|
||||||
(btnPtr->fsStyle & TBSTYLE_CHECK)) {
|
(btnPtr->fsStyle & BTNS_CHECK)) {
|
||||||
if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
|
if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
|
||||||
{
|
{
|
||||||
if (dwStyle & TBSTYLE_FLAT)
|
if (dwStyle & TBSTYLE_FLAT)
|
||||||
|
@ -977,7 +998,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
||||||
|
|
||||||
if (hasDropDownArrow)
|
if (hasDropDownArrow)
|
||||||
{
|
{
|
||||||
if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
|
if (drawSepDropDownArrow && !(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
|
||||||
DrawEdge (hdc, &rcArrow, EDGE_RAISED,
|
DrawEdge (hdc, &rcArrow, EDGE_RAISED,
|
||||||
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||||
TOOLBAR_DrawArrow(hdc, rcArrow.left, rcArrow.top + (rcArrow.bottom - rcArrow.top - ARROW_HEIGHT) / 2, COLOR_WINDOWFRAME);
|
TOOLBAR_DrawArrow(hdc, rcArrow.left, rcArrow.top + (rcArrow.bottom - rcArrow.top - ARROW_HEIGHT) / 2, COLOR_WINDOWFRAME);
|
||||||
|
@ -1084,7 +1105,7 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
|
||||||
* prefix characters as M$ likes to call them). The prefix character
|
* prefix characters as M$ likes to call them). The prefix character
|
||||||
* indicates where the underline goes, except for the string "&&" which
|
* indicates where the underline goes, except for the string "&&" which
|
||||||
* is reduced to a single "&". GetTextExtentPoint does not process these
|
* is reduced to a single "&". GetTextExtentPoint does not process these
|
||||||
* only DrawText does. Note that the TBSTYLE_NOPREFIX is handled here.
|
* only DrawText does. Note that the BTNS_NOPREFIX is handled here.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
||||||
|
@ -1112,7 +1133,7 @@ TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
||||||
|
|
||||||
/* Use DrawText to get true size as drawn (less pesky "&") */
|
/* Use DrawText to get true size as drawn (less pesky "&") */
|
||||||
DrawTextW (hdc, lpText, -1, &myrect, DT_VCENTER | DT_SINGLELINE |
|
DrawTextW (hdc, lpText, -1, &myrect, DT_VCENTER | DT_SINGLELINE |
|
||||||
DT_CALCRECT | ((btnPtr->fsStyle & TBSTYLE_NOPREFIX) ?
|
DT_CALCRECT | ((btnPtr->fsStyle & BTNS_NOPREFIX) ?
|
||||||
DT_NOPREFIX : 0));
|
DT_NOPREFIX : 0));
|
||||||
|
|
||||||
/* feed back to caller */
|
/* feed back to caller */
|
||||||
|
@ -1143,6 +1164,9 @@ TOOLBAR_CalcStrings (HWND hwnd, LPSIZE lpSize)
|
||||||
lpSize->cx = 0;
|
lpSize->cx = 0;
|
||||||
lpSize->cy = 0;
|
lpSize->cy = 0;
|
||||||
|
|
||||||
|
if(infoPtr->nMaxTextRows == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
hdc = GetDC (hwnd);
|
hdc = GetDC (hwnd);
|
||||||
hOldFont = SelectObject (hdc, infoPtr->hFont);
|
hOldFont = SelectObject (hdc, infoPtr->hFont);
|
||||||
|
|
||||||
|
@ -1221,10 +1245,10 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
|
||||||
/* it is the actual width of the separator. This is used for */
|
/* it is the actual width of the separator. This is used for */
|
||||||
/* custom controls in toolbars. */
|
/* custom controls in toolbars. */
|
||||||
/* */
|
/* */
|
||||||
/* TBSTYLE_DROPDOWN separators are treated as buttons for */
|
/* BTNS_DROPDOWN separators are treated as buttons for */
|
||||||
/* width. - GA 8/01 */
|
/* width. - GA 8/01 */
|
||||||
if ((btnPtr[i].fsStyle & TBSTYLE_SEP) &&
|
if ((btnPtr[i].fsStyle & BTNS_SEP) &&
|
||||||
!(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN))
|
!(btnPtr[i].fsStyle & BTNS_DROPDOWN))
|
||||||
cx = (btnPtr[i].iBitmap > 0) ?
|
cx = (btnPtr[i].iBitmap > 0) ?
|
||||||
btnPtr[i].iBitmap : SEPARATOR_WIDTH;
|
btnPtr[i].iBitmap : SEPARATOR_WIDTH;
|
||||||
else
|
else
|
||||||
|
@ -1234,9 +1258,9 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
|
||||||
/* The first separator in a group should be wrapped to the */
|
/* The first separator in a group should be wrapped to the */
|
||||||
/* next row if the previous wrapping is on a button. */
|
/* next row if the previous wrapping is on a button. */
|
||||||
if( bButtonWrap &&
|
if( bButtonWrap &&
|
||||||
(btnPtr[i].fsStyle & TBSTYLE_SEP) &&
|
(btnPtr[i].fsStyle & BTNS_SEP) &&
|
||||||
(i + 1 < infoPtr->nNumButtons ) &&
|
(i + 1 < infoPtr->nNumButtons ) &&
|
||||||
(btnPtr[i + 1].fsStyle & TBSTYLE_SEP) )
|
(btnPtr[i + 1].fsStyle & BTNS_SEP) )
|
||||||
{
|
{
|
||||||
TRACE("wrap point 1 btn %d style %02x\n", i, btnPtr[i].fsStyle);
|
TRACE("wrap point 1 btn %d style %02x\n", i, btnPtr[i].fsStyle);
|
||||||
btnPtr[i].fsState |= TBSTATE_WRAP;
|
btnPtr[i].fsState |= TBSTATE_WRAP;
|
||||||
|
@ -1258,8 +1282,8 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
|
||||||
/* If the current button is a separator and not hidden, */
|
/* If the current button is a separator and not hidden, */
|
||||||
/* go to the next until it reaches a non separator. */
|
/* go to the next until it reaches a non separator. */
|
||||||
/* Wrap the last separator if it is before a button. */
|
/* Wrap the last separator if it is before a button. */
|
||||||
while( ( ((btnPtr[i].fsStyle & TBSTYLE_SEP) &&
|
while( ( ((btnPtr[i].fsStyle & BTNS_SEP) &&
|
||||||
!(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN)) ||
|
!(btnPtr[i].fsStyle & BTNS_DROPDOWN)) ||
|
||||||
(btnPtr[i].fsState & TBSTATE_HIDDEN) ) &&
|
(btnPtr[i].fsState & TBSTATE_HIDDEN) ) &&
|
||||||
i < infoPtr->nNumButtons )
|
i < infoPtr->nNumButtons )
|
||||||
{
|
{
|
||||||
|
@ -1284,7 +1308,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
|
||||||
/* separator and wrap it. */
|
/* separator and wrap it. */
|
||||||
for ( j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--)
|
for ( j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--)
|
||||||
{
|
{
|
||||||
if ((btnPtr[j].fsStyle & TBSTYLE_SEP) &&
|
if ((btnPtr[j].fsStyle & BTNS_SEP) &&
|
||||||
!(btnPtr[j].fsState & TBSTATE_HIDDEN))
|
!(btnPtr[j].fsState & TBSTATE_HIDDEN))
|
||||||
{
|
{
|
||||||
bFound = TRUE;
|
bFound = TRUE;
|
||||||
|
@ -1327,7 +1351,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
|
||||||
btnPtr[i].fsState |= TBSTATE_WRAP;
|
btnPtr[i].fsState |= TBSTATE_WRAP;
|
||||||
bFound = TRUE;
|
bFound = TRUE;
|
||||||
x = infoPtr->nIndent;
|
x = infoPtr->nIndent;
|
||||||
if (btnPtr[i].fsStyle & TBSTYLE_SEP )
|
if (btnPtr[i].fsStyle & BTNS_SEP )
|
||||||
bButtonWrap = FALSE;
|
bButtonWrap = FALSE;
|
||||||
else
|
else
|
||||||
bButtonWrap = TRUE;
|
bButtonWrap = TRUE;
|
||||||
|
@ -1394,12 +1418,12 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
||||||
else
|
else
|
||||||
infoPtr->nButtonHeight = sizeString.cy + 6;
|
infoPtr->nButtonHeight = sizeString.cy + 6;
|
||||||
}
|
}
|
||||||
else if (infoPtr->nButtonHeight < infoPtr->nBitmapHeight + 6)
|
else
|
||||||
infoPtr->nButtonHeight = infoPtr->nBitmapHeight + 6;
|
infoPtr->nButtonHeight = infoPtr->nBitmapHeight + 6;
|
||||||
|
|
||||||
if (sizeString.cx > infoPtr->nBitmapWidth)
|
if (sizeString.cx > infoPtr->nBitmapWidth)
|
||||||
infoPtr->nButtonWidth = sizeString.cx + 6;
|
infoPtr->nButtonWidth = sizeString.cx + 6;
|
||||||
else if (infoPtr->nButtonWidth < infoPtr->nBitmapWidth + 6)
|
else
|
||||||
infoPtr->nButtonWidth = infoPtr->nBitmapWidth + 6;
|
infoPtr->nButtonWidth = infoPtr->nBitmapWidth + 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1464,8 +1488,8 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
||||||
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
|
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
|
||||||
/* it is the actual width of the separator. This is used for */
|
/* it is the actual width of the separator. This is used for */
|
||||||
/* custom controls in toolbars. */
|
/* custom controls in toolbars. */
|
||||||
if (btnPtr->fsStyle & TBSTYLE_SEP) {
|
if (btnPtr->fsStyle & BTNS_SEP) {
|
||||||
if (btnPtr->fsStyle & TBSTYLE_DROPDOWN) {
|
if (btnPtr->fsStyle & BTNS_DROPDOWN) {
|
||||||
cy = (btnPtr->iBitmap > 0) ?
|
cy = (btnPtr->iBitmap > 0) ?
|
||||||
btnPtr->iBitmap : SEPARATOR_WIDTH;
|
btnPtr->iBitmap : SEPARATOR_WIDTH;
|
||||||
cx = infoPtr->nButtonWidth;
|
cx = infoPtr->nButtonWidth;
|
||||||
|
@ -1477,7 +1501,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
|
if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
|
||||||
(btnPtr->fsStyle & TBSTYLE_AUTOSIZE))
|
(btnPtr->fsStyle & BTNS_AUTOSIZE))
|
||||||
{
|
{
|
||||||
SIZE sz;
|
SIZE sz;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
@ -1507,7 +1531,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
||||||
else
|
else
|
||||||
cx = infoPtr->nButtonWidth;
|
cx = infoPtr->nButtonWidth;
|
||||||
|
|
||||||
if (hasDropDownArrows && (btnPtr->fsStyle & TBSTYLE_DROPDOWN))
|
if ((hasDropDownArrows && (btnPtr->fsStyle & BTNS_DROPDOWN)) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN))
|
||||||
cx += DDARROW_WIDTH;
|
cx += DDARROW_WIDTH;
|
||||||
}
|
}
|
||||||
if (btnPtr->fsState & TBSTATE_WRAP )
|
if (btnPtr->fsState & TBSTATE_WRAP )
|
||||||
|
@ -1523,7 +1547,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
||||||
infoPtr->rcBound.bottom = y + cy;
|
infoPtr->rcBound.bottom = y + cy;
|
||||||
|
|
||||||
/* Set the toolTip only for non-hidden, non-separator button */
|
/* Set the toolTip only for non-hidden, non-separator button */
|
||||||
if (infoPtr->hwndToolTip && !(btnPtr->fsStyle & TBSTYLE_SEP ))
|
if (infoPtr->hwndToolTip && !(btnPtr->fsStyle & BTNS_SEP ))
|
||||||
{
|
{
|
||||||
TTTOOLINFOA ti;
|
TTTOOLINFOA ti;
|
||||||
|
|
||||||
|
@ -1546,14 +1570,14 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
||||||
|
|
||||||
if( bWrap )
|
if( bWrap )
|
||||||
{
|
{
|
||||||
if ( !(btnPtr->fsStyle & TBSTYLE_SEP) )
|
if ( !(btnPtr->fsStyle & BTNS_SEP) )
|
||||||
y += cy;
|
y += cy;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
|
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
|
||||||
/* it is the actual width of the separator. This is used for */
|
/* it is the actual width of the separator. This is used for */
|
||||||
/* custom controls in toolbars. */
|
/* custom controls in toolbars. */
|
||||||
if ( !(btnPtr->fsStyle & TBSTYLE_DROPDOWN))
|
if ( !(btnPtr->fsStyle & BTNS_DROPDOWN))
|
||||||
y += cy + ( (btnPtr->iBitmap > 0 ) ?
|
y += cy + ( (btnPtr->iBitmap > 0 ) ?
|
||||||
btnPtr->iBitmap : SEPARATOR_WIDTH) * 2 /3;
|
btnPtr->iBitmap : SEPARATOR_WIDTH) * 2 /3;
|
||||||
else
|
else
|
||||||
|
@ -1613,7 +1637,7 @@ TOOLBAR_InternalHitTest (HWND hwnd, LPPOINT lpPt)
|
||||||
if (btnPtr->fsState & TBSTATE_HIDDEN)
|
if (btnPtr->fsState & TBSTATE_HIDDEN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (btnPtr->fsStyle & TBSTYLE_SEP) {
|
if (btnPtr->fsStyle & BTNS_SEP) {
|
||||||
if (PtInRect (&btnPtr->rect, *lpPt)) {
|
if (PtInRect (&btnPtr->rect, *lpPt)) {
|
||||||
TRACE(" ON SEPARATOR %d!\n", i);
|
TRACE(" ON SEPARATOR %d!\n", i);
|
||||||
return -i;
|
return -i;
|
||||||
|
@ -1666,7 +1690,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
|
||||||
|
|
||||||
/* check index button */
|
/* check index button */
|
||||||
btnPtr = &infoPtr->buttons[nIndex];
|
btnPtr = &infoPtr->buttons[nIndex];
|
||||||
if ((btnPtr->fsStyle & TBSTYLE_CHECKGROUP) == TBSTYLE_CHECKGROUP) {
|
if ((btnPtr->fsStyle & BTNS_CHECKGROUP) == BTNS_CHECKGROUP) {
|
||||||
if (btnPtr->fsState & TBSTATE_CHECKED)
|
if (btnPtr->fsState & TBSTATE_CHECKED)
|
||||||
return nIndex;
|
return nIndex;
|
||||||
}
|
}
|
||||||
|
@ -1675,7 +1699,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
|
||||||
nRunIndex = nIndex - 1;
|
nRunIndex = nIndex - 1;
|
||||||
while (nRunIndex >= 0) {
|
while (nRunIndex >= 0) {
|
||||||
btnPtr = &infoPtr->buttons[nRunIndex];
|
btnPtr = &infoPtr->buttons[nRunIndex];
|
||||||
if ((btnPtr->fsStyle & TBSTYLE_CHECKGROUP) == TBSTYLE_CHECKGROUP) {
|
if ((btnPtr->fsStyle & BTNS_CHECKGROUP) == BTNS_CHECKGROUP) {
|
||||||
if (btnPtr->fsState & TBSTATE_CHECKED)
|
if (btnPtr->fsState & TBSTATE_CHECKED)
|
||||||
return nRunIndex;
|
return nRunIndex;
|
||||||
}
|
}
|
||||||
|
@ -1688,7 +1712,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
|
||||||
nRunIndex = nIndex + 1;
|
nRunIndex = nIndex + 1;
|
||||||
while (nRunIndex < infoPtr->nNumButtons) {
|
while (nRunIndex < infoPtr->nNumButtons) {
|
||||||
btnPtr = &infoPtr->buttons[nRunIndex];
|
btnPtr = &infoPtr->buttons[nRunIndex];
|
||||||
if ((btnPtr->fsStyle & TBSTYLE_CHECKGROUP) == TBSTYLE_CHECKGROUP) {
|
if ((btnPtr->fsStyle & BTNS_CHECKGROUP) == BTNS_CHECKGROUP) {
|
||||||
if (btnPtr->fsState & TBSTATE_CHECKED)
|
if (btnPtr->fsState & TBSTATE_CHECKED)
|
||||||
return nRunIndex;
|
return nRunIndex;
|
||||||
}
|
}
|
||||||
|
@ -1766,7 +1790,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
|
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
|
||||||
memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
|
memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
|
||||||
btnInfo->btn.fsStyle = TBSTYLE_SEP;
|
btnInfo->btn.fsStyle = BTNS_SEP;
|
||||||
btnInfo->bVirtual = FALSE;
|
btnInfo->bVirtual = FALSE;
|
||||||
LoadStringW (COMCTL32_hModule, IDS_SEPARATOR, btnInfo->text, 64);
|
LoadStringW (COMCTL32_hModule, IDS_SEPARATOR, btnInfo->text, 64);
|
||||||
|
|
||||||
|
@ -1780,7 +1804,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
/* insert separator button into 'available buttons' list */
|
/* insert separator button into 'available buttons' list */
|
||||||
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
|
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
|
||||||
memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
|
memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
|
||||||
btnInfo->btn.fsStyle = TBSTYLE_SEP;
|
btnInfo->btn.fsStyle = BTNS_SEP;
|
||||||
btnInfo->bVirtual = FALSE;
|
btnInfo->bVirtual = FALSE;
|
||||||
btnInfo->bRemovable = TRUE;
|
btnInfo->bRemovable = TRUE;
|
||||||
LoadStringW (COMCTL32_hModule, IDS_SEPARATOR, btnInfo->text, 64);
|
LoadStringW (COMCTL32_hModule, IDS_SEPARATOR, btnInfo->text, 64);
|
||||||
|
@ -1828,7 +1852,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (&btnInfo->btn, &nmtb.tbButton, sizeof(TBBUTTON));
|
memcpy (&btnInfo->btn, &nmtb.tbButton, sizeof(TBBUTTON));
|
||||||
if (!(nmtb.tbButton.fsStyle & TBSTYLE_SEP))
|
if (!(nmtb.tbButton.fsStyle & BTNS_SEP))
|
||||||
{
|
{
|
||||||
if (lstrlenW(nmtb.pszText))
|
if (lstrlenW(nmtb.pszText))
|
||||||
lstrcpyW(btnInfo->text, nmtb.pszText);
|
lstrcpyW(btnInfo->text, nmtb.pszText);
|
||||||
|
@ -1847,7 +1871,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
/* append 'virtual' separator button to the 'toolbar buttons' list */
|
/* append 'virtual' separator button to the 'toolbar buttons' list */
|
||||||
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
|
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
|
||||||
memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
|
memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
|
||||||
btnInfo->btn.fsStyle = TBSTYLE_SEP;
|
btnInfo->btn.fsStyle = BTNS_SEP;
|
||||||
btnInfo->bVirtual = TRUE;
|
btnInfo->bVirtual = TRUE;
|
||||||
btnInfo->bRemovable = FALSE;
|
btnInfo->bRemovable = FALSE;
|
||||||
LoadStringW (COMCTL32_hModule, IDS_SEPARATOR, btnInfo->text, 64);
|
LoadStringW (COMCTL32_hModule, IDS_SEPARATOR, btnInfo->text, 64);
|
||||||
|
@ -2017,7 +2041,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
SendMessageA (custInfo->tbHwnd, TB_DELETEBUTTON, index, 0);
|
SendMessageA (custInfo->tbHwnd, TB_DELETEBUTTON, index, 0);
|
||||||
|
|
||||||
/* insert into 'available button' list */
|
/* insert into 'available button' list */
|
||||||
if (!(btnInfo->btn.fsStyle & TBSTYLE_SEP))
|
if (!(btnInfo->btn.fsStyle & BTNS_SEP))
|
||||||
{
|
{
|
||||||
index = (int)SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, 0);
|
index = (int)SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, 0);
|
||||||
SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_SETITEMDATA, index, (LPARAM)btnInfo);
|
SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_SETITEMDATA, index, (LPARAM)btnInfo);
|
||||||
|
@ -2164,7 +2188,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
|
DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
|
||||||
|
|
||||||
/* draw image and text */
|
/* draw image and text */
|
||||||
if ((btnInfo->btn.fsStyle & TBSTYLE_SEP) == 0) {
|
if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) {
|
||||||
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr,
|
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr,
|
||||||
btnInfo->btn.iBitmap));
|
btnInfo->btn.iBitmap));
|
||||||
ImageList_Draw (himl, GETIBITMAP(infoPtr, btnInfo->btn.iBitmap),
|
ImageList_Draw (himl, GETIBITMAP(infoPtr, btnInfo->btn.iBitmap),
|
||||||
|
@ -2461,10 +2485,13 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
btnPtr->fsState = lpTbb[nCount].fsState;
|
btnPtr->fsState = lpTbb[nCount].fsState;
|
||||||
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
|
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
|
||||||
btnPtr->dwData = lpTbb[nCount].dwData;
|
btnPtr->dwData = lpTbb[nCount].dwData;
|
||||||
|
if(HIWORD(lpTbb[nCount].iString) && lpTbb[nCount].iString != -1)
|
||||||
|
Str_SetPtrAtoW ((LPWSTR*)&btnPtr->iString, (LPSTR)lpTbb[nCount].iString );
|
||||||
|
else
|
||||||
btnPtr->iString = lpTbb[nCount].iString;
|
btnPtr->iString = lpTbb[nCount].iString;
|
||||||
btnPtr->bHot = FALSE;
|
btnPtr->bHot = FALSE;
|
||||||
|
|
||||||
if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
|
if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & BTNS_SEP)) {
|
||||||
TTTOOLINFOA ti;
|
TTTOOLINFOA ti;
|
||||||
|
|
||||||
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
|
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
|
||||||
|
@ -2525,10 +2552,13 @@ TOOLBAR_AddButtonsW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
btnPtr->fsState = lpTbb[nCount].fsState;
|
btnPtr->fsState = lpTbb[nCount].fsState;
|
||||||
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
|
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
|
||||||
btnPtr->dwData = lpTbb[nCount].dwData;
|
btnPtr->dwData = lpTbb[nCount].dwData;
|
||||||
|
if(HIWORD(lpTbb[nCount].iString) && lpTbb[nCount].iString != -1)
|
||||||
|
Str_SetPtrW ((LPWSTR*)&btnPtr->iString, (LPWSTR)lpTbb[nCount].iString );
|
||||||
|
else
|
||||||
btnPtr->iString = lpTbb[nCount].iString;
|
btnPtr->iString = lpTbb[nCount].iString;
|
||||||
btnPtr->bHot = FALSE;
|
btnPtr->bHot = FALSE;
|
||||||
|
|
||||||
if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
|
if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & BTNS_SEP)) {
|
||||||
TTTOOLINFOW ti;
|
TTTOOLINFOW ti;
|
||||||
|
|
||||||
ZeroMemory (&ti, sizeof(TTTOOLINFOW));
|
ZeroMemory (&ti, sizeof(TTTOOLINFOW));
|
||||||
|
@ -2869,7 +2899,7 @@ TOOLBAR_CheckButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
btnPtr = &infoPtr->buttons[nIndex];
|
btnPtr = &infoPtr->buttons[nIndex];
|
||||||
|
|
||||||
if (!(btnPtr->fsStyle & TBSTYLE_CHECK))
|
if (!(btnPtr->fsStyle & BTNS_CHECK))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
bChecked = (btnPtr->fsState & TBSTATE_CHECKED) ? TRUE : FALSE;
|
bChecked = (btnPtr->fsState & TBSTATE_CHECKED) ? TRUE : FALSE;
|
||||||
|
@ -2877,7 +2907,7 @@ TOOLBAR_CheckButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
if (LOWORD(lParam) == FALSE)
|
if (LOWORD(lParam) == FALSE)
|
||||||
btnPtr->fsState &= ~TBSTATE_CHECKED;
|
btnPtr->fsState &= ~TBSTATE_CHECKED;
|
||||||
else {
|
else {
|
||||||
if (btnPtr->fsStyle & TBSTYLE_GROUP) {
|
if (btnPtr->fsStyle & BTNS_GROUP) {
|
||||||
nOldIndex =
|
nOldIndex =
|
||||||
TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, nIndex);
|
TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, nIndex);
|
||||||
if (nOldIndex == nIndex)
|
if (nOldIndex == nIndex)
|
||||||
|
@ -2962,7 +2992,7 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ((infoPtr->hwndToolTip) &&
|
if ((infoPtr->hwndToolTip) &&
|
||||||
!(infoPtr->buttons[nIndex].fsStyle & TBSTYLE_SEP)) {
|
!(infoPtr->buttons[nIndex].fsStyle & BTNS_SEP)) {
|
||||||
TTTOOLINFOA ti;
|
TTTOOLINFOA ti;
|
||||||
|
|
||||||
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
|
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
|
||||||
|
@ -3136,8 +3166,14 @@ TOOLBAR_GetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
if (lpTbInfo->dwMask & TBIF_STYLE)
|
if (lpTbInfo->dwMask & TBIF_STYLE)
|
||||||
lpTbInfo->fsStyle = btnPtr->fsStyle;
|
lpTbInfo->fsStyle = btnPtr->fsStyle;
|
||||||
if (lpTbInfo->dwMask & TBIF_TEXT) {
|
if (lpTbInfo->dwMask & TBIF_TEXT) {
|
||||||
LPWSTR lpText = TOOLBAR_GetText(infoPtr,btnPtr);
|
/* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
|
||||||
|
can't use TOOLBAR_GetText here */
|
||||||
|
LPWSTR lpText;
|
||||||
|
if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
|
||||||
|
lpText = (LPWSTR)btnPtr->iString;
|
||||||
Str_GetPtrWtoA (lpText, lpTbInfo->pszText,lpTbInfo->cchText);
|
Str_GetPtrWtoA (lpText, lpTbInfo->pszText,lpTbInfo->cchText);
|
||||||
|
} else
|
||||||
|
lpTbInfo->pszText[0] = '\0';
|
||||||
}
|
}
|
||||||
return nIndex;
|
return nIndex;
|
||||||
}
|
}
|
||||||
|
@ -3181,8 +3217,14 @@ TOOLBAR_GetButtonInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
if (lpTbInfo->dwMask & TBIF_STYLE)
|
if (lpTbInfo->dwMask & TBIF_STYLE)
|
||||||
lpTbInfo->fsStyle = btnPtr->fsStyle;
|
lpTbInfo->fsStyle = btnPtr->fsStyle;
|
||||||
if (lpTbInfo->dwMask & TBIF_TEXT) {
|
if (lpTbInfo->dwMask & TBIF_TEXT) {
|
||||||
LPWSTR lpText = TOOLBAR_GetText(infoPtr,btnPtr);
|
/* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
|
||||||
|
can't use TOOLBAR_GetText here */
|
||||||
|
LPWSTR lpText;
|
||||||
|
if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
|
||||||
|
lpText = (LPWSTR)btnPtr->iString;
|
||||||
Str_GetPtrW (lpText,lpTbInfo->pszText,lpTbInfo->cchText);
|
Str_GetPtrW (lpText,lpTbInfo->pszText,lpTbInfo->cchText);
|
||||||
|
} else
|
||||||
|
lpTbInfo->pszText[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return nIndex;
|
return nIndex;
|
||||||
|
@ -3509,17 +3551,20 @@ TOOLBAR_Indeterminate (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||||
TBUTTON_INFO *btnPtr;
|
TBUTTON_INFO *btnPtr;
|
||||||
INT nIndex;
|
INT nIndex;
|
||||||
|
DWORD oldState;
|
||||||
|
|
||||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
||||||
if (nIndex == -1)
|
if (nIndex == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
btnPtr = &infoPtr->buttons[nIndex];
|
btnPtr = &infoPtr->buttons[nIndex];
|
||||||
|
oldState = btnPtr->fsState;
|
||||||
if (LOWORD(lParam) == FALSE)
|
if (LOWORD(lParam) == FALSE)
|
||||||
btnPtr->fsState &= ~TBSTATE_INDETERMINATE;
|
btnPtr->fsState &= ~TBSTATE_INDETERMINATE;
|
||||||
else
|
else
|
||||||
btnPtr->fsState |= TBSTATE_INDETERMINATE;
|
btnPtr->fsState |= TBSTATE_INDETERMINATE;
|
||||||
|
|
||||||
|
if(oldState != btnPtr->fsState)
|
||||||
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr, btnPtr));
|
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr, btnPtr));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -3596,7 +3641,7 @@ TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
else
|
else
|
||||||
infoPtr->buttons[nIndex].iString = lpTbb->iString;
|
infoPtr->buttons[nIndex].iString = lpTbb->iString;
|
||||||
|
|
||||||
if ((infoPtr->hwndToolTip) && !(lpTbb->fsStyle & TBSTYLE_SEP)) {
|
if ((infoPtr->hwndToolTip) && !(lpTbb->fsStyle & BTNS_SEP)) {
|
||||||
TTTOOLINFOA ti;
|
TTTOOLINFOA ti;
|
||||||
|
|
||||||
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
|
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
|
||||||
|
@ -3696,7 +3741,7 @@ TOOLBAR_InsertButtonW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
else
|
else
|
||||||
infoPtr->buttons[nIndex].iString = lpTbb->iString;
|
infoPtr->buttons[nIndex].iString = lpTbb->iString;
|
||||||
|
|
||||||
if ((infoPtr->hwndToolTip) && !(lpTbb->fsStyle & TBSTYLE_SEP)) {
|
if ((infoPtr->hwndToolTip) && !(lpTbb->fsStyle & BTNS_SEP)) {
|
||||||
TTTOOLINFOW ti;
|
TTTOOLINFOW ti;
|
||||||
|
|
||||||
ZeroMemory (&ti, sizeof(TTTOOLINFOW));
|
ZeroMemory (&ti, sizeof(TTTOOLINFOW));
|
||||||
|
@ -3825,17 +3870,20 @@ TOOLBAR_PressButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||||
TBUTTON_INFO *btnPtr;
|
TBUTTON_INFO *btnPtr;
|
||||||
INT nIndex;
|
INT nIndex;
|
||||||
|
DWORD oldState;
|
||||||
|
|
||||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
||||||
if (nIndex == -1)
|
if (nIndex == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
btnPtr = &infoPtr->buttons[nIndex];
|
btnPtr = &infoPtr->buttons[nIndex];
|
||||||
|
oldState = btnPtr->fsState;
|
||||||
if (LOWORD(lParam) == FALSE)
|
if (LOWORD(lParam) == FALSE)
|
||||||
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
||||||
else
|
else
|
||||||
btnPtr->fsState |= TBSTATE_PRESSED;
|
btnPtr->fsState |= TBSTATE_PRESSED;
|
||||||
|
|
||||||
|
if(oldState != btnPtr->fsState)
|
||||||
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr, btnPtr));
|
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr, btnPtr));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -4419,6 +4467,7 @@ TOOLBAR_SetMaxTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
infoPtr->nMaxTextRows = (INT)wParam;
|
infoPtr->nMaxTextRows = (INT)wParam;
|
||||||
|
|
||||||
|
TOOLBAR_CalcToolbar(hwnd);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4604,6 +4653,11 @@ TOOLBAR_SetVersion (HWND hwnd, INT iVersion)
|
||||||
return iOldVersion;
|
return iOldVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT TOOLBAR_Unkwn45D(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
FIXME("hwnd=%p wParam %08x lParam %08lx stub!\n", hwnd, wParam, lParam);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
/* */
|
/* */
|
||||||
|
@ -4657,6 +4711,13 @@ TOOLBAR_Unkwn45E (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
return (LRESULT)nOldHotItem;
|
return (LRESULT)nOldHotItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT TOOLBAR_Unkwn460(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
TRACE("hwnd=%p wParam %08x lParam %08lx\n", hwnd, wParam, lParam);
|
||||||
|
|
||||||
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -4687,7 +4748,6 @@ TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
RECT rc;
|
RECT rc;
|
||||||
HWND hwndParent = GetParent(hwnd);
|
HWND hwndParent = GetParent(hwnd);
|
||||||
|
|
||||||
InvalidateRect(hwnd, 0, 1);
|
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
MapWindowPoints(0, hwndParent, (LPPOINT)&rc, 2);
|
MapWindowPoints(0, hwndParent, (LPPOINT)&rc, 2);
|
||||||
TRACE("mapped to (%ld,%ld)-(%ld,%ld)\n",
|
TRACE("mapped to (%ld,%ld)-(%ld,%ld)\n",
|
||||||
|
@ -4713,6 +4773,14 @@ TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT TOOLBAR_Unkwn464(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
TRACE("hwnd=%p wParam %08x lParam %08lx\n", hwnd, wParam, lParam);
|
||||||
|
|
||||||
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -4963,9 +5031,11 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH);
|
arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH);
|
||||||
|
|
||||||
/* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */
|
/* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */
|
||||||
if ((btnPtr->fsState & TBSTATE_ENABLED) && (btnPtr->fsStyle & TBSTYLE_DROPDOWN) &&
|
if ((btnPtr->fsState & TBSTATE_ENABLED) &&
|
||||||
|
((btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) ||
|
||||||
|
((btnPtr->fsStyle & BTNS_DROPDOWN) &&
|
||||||
((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) ||
|
((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) ||
|
||||||
(!TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle))))
|
(!TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle))))))
|
||||||
{
|
{
|
||||||
LRESULT res;
|
LRESULT res;
|
||||||
/*
|
/*
|
||||||
|
@ -4979,7 +5049,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
memset(&nmtb.tbButton, 0, sizeof(TBBUTTON));
|
memset(&nmtb.tbButton, 0, sizeof(TBBUTTON));
|
||||||
nmtb.cchText = 0;
|
nmtb.cchText = 0;
|
||||||
nmtb.pszText = 0;
|
nmtb.pszText = 0;
|
||||||
memset(&nmtb.rcButton, 0, sizeof(RECT));
|
CopyRect(&nmtb.rcButton, &btnPtr->rect);
|
||||||
res = TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
res = TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
||||||
TBN_DROPDOWN);
|
TBN_DROPDOWN);
|
||||||
if (res != TBDDRET_TREATPRESSED)
|
if (res != TBDDRET_TREATPRESSED)
|
||||||
|
@ -5046,8 +5116,8 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
|
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
|
||||||
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
||||||
|
|
||||||
if (btnPtr->fsStyle & TBSTYLE_CHECK) {
|
if (btnPtr->fsStyle & BTNS_CHECK) {
|
||||||
if (btnPtr->fsStyle & TBSTYLE_GROUP) {
|
if (btnPtr->fsStyle & BTNS_GROUP) {
|
||||||
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr,
|
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr,
|
||||||
nHit);
|
nHit);
|
||||||
if (nOldIndex == nHit)
|
if (nOldIndex == nHit)
|
||||||
|
@ -5936,12 +6006,20 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case TB_SETUNICODEFORMAT:
|
case TB_SETUNICODEFORMAT:
|
||||||
return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam);
|
return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam);
|
||||||
|
|
||||||
|
case TB_UNKWN45D:
|
||||||
|
return TOOLBAR_Unkwn45D(hwnd, wParam, lParam);
|
||||||
|
|
||||||
case TB_UNKWN45E:
|
case TB_UNKWN45E:
|
||||||
return TOOLBAR_Unkwn45E (hwnd, wParam, lParam);
|
return TOOLBAR_Unkwn45E (hwnd, wParam, lParam);
|
||||||
|
|
||||||
|
case TB_UNKWN460:
|
||||||
|
return TOOLBAR_Unkwn460(hwnd, wParam, lParam);
|
||||||
|
|
||||||
case TB_UNKWN463:
|
case TB_UNKWN463:
|
||||||
return TOOLBAR_Unkwn463 (hwnd, wParam, lParam);
|
return TOOLBAR_Unkwn463 (hwnd, wParam, lParam);
|
||||||
|
|
||||||
|
case TB_UNKWN464:
|
||||||
|
return TOOLBAR_Unkwn464(hwnd, wParam, lParam);
|
||||||
|
|
||||||
/* Common Control Messages */
|
/* Common Control Messages */
|
||||||
|
|
||||||
|
@ -6011,7 +6089,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return TOOLBAR_Notify (hwnd, wParam, lParam);
|
return TOOLBAR_Notify (hwnd, wParam, lParam);
|
||||||
|
|
||||||
case WM_NOTIFYFORMAT:
|
case WM_NOTIFYFORMAT:
|
||||||
TOOLBAR_NotifyFormatFake (hwnd, wParam, lParam);
|
return TOOLBAR_NotifyFormatFake (hwnd, wParam, lParam);
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
return TOOLBAR_Paint (hwnd, wParam);
|
return TOOLBAR_Paint (hwnd, wParam);
|
||||||
|
|
Loading…
Reference in a new issue