mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:52:57 +00:00
- Updated COMCTL32 to Wine 20031212 release.
svn path=/trunk/; revision=7126
This commit is contained in:
parent
c5f80947d5
commit
4bfb4ce695
4 changed files with 406 additions and 492 deletions
|
@ -31,13 +31,21 @@
|
|||
* TODO:
|
||||
* - Button wrapping (under construction).
|
||||
* - Messages.
|
||||
* - Notifications (under construction).
|
||||
* - Notifications
|
||||
* - NM_CHAR
|
||||
* - NM_KEYDOWN
|
||||
* - NM_LDOWN
|
||||
* - NM_RCLICK
|
||||
* - NM_RDBLCLICK
|
||||
* - TBN_DELETINGBUTTON
|
||||
* - TBN_DRAGOUT
|
||||
* - TBN_GETOBJECT
|
||||
* - TBN_RESTORE
|
||||
* - TBN_SAVE
|
||||
* - TBN_TOOLBARCHANGE
|
||||
* - Fix TB_SETROWS.
|
||||
* - Tooltip support (almost complete).
|
||||
* - Unicode suppport (under construction).
|
||||
* - Fix TOOLBAR_SetButtonInfo32A/W.
|
||||
* - TBSTYLE_AUTOSIZE for toolbar and buttons.
|
||||
* - I_IMAGECALLBACK support.
|
||||
* - iString of -1 is undocumented
|
||||
* - Customization dialog:
|
||||
* - Add flat look.
|
||||
|
@ -45,7 +53,6 @@
|
|||
* Buttons are not listed in M$-like order. M$ seems to use a single
|
||||
* internal list to store the button information of both listboxes.
|
||||
* - Drag list support.
|
||||
* - Help and Reset button support.
|
||||
*
|
||||
* Testing:
|
||||
* - Run tests using Waite Group Windows95 API Bible Volume 2.
|
||||
|
@ -189,6 +196,13 @@ typedef enum
|
|||
#define DDARROW_WIDTH 11
|
||||
#define ARROW_HEIGHT 3
|
||||
|
||||
/* gap between edge of button and image with TBSTYLE_LIST */
|
||||
#define LIST_IMAGE_OFFSET 3
|
||||
/* gap between bitmap and text (always present) */
|
||||
#define LIST_TEXT_OFFSET 2
|
||||
/* how wide to treat the bitmap if it isn't present */
|
||||
#define LIST_IMAGE_ABSENT_WIDTH 2
|
||||
|
||||
#define TOOLBAR_GetInfoPtr(hwnd) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0))
|
||||
#define TOOLBAR_HasText(x, y) (TOOLBAR_GetText(x, y) ? TRUE : FALSE)
|
||||
#define TOOLBAR_HasDropDownArrows(exStyle) ((exStyle & TBSTYLE_EX_DRAWDDARROWS) ? TRUE : FALSE)
|
||||
|
@ -693,7 +707,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
|
||||
/* Center the bitmap horizontally and vertically */
|
||||
if (dwStyle & TBSTYLE_LIST)
|
||||
rcBitmap.left += 3;
|
||||
rcBitmap.left += LIST_IMAGE_OFFSET;
|
||||
else
|
||||
rcBitmap.left+=(infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2;
|
||||
|
||||
|
@ -725,7 +739,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
if (dwStyle & TBSTYLE_LIST) {
|
||||
/* LIST style w/ ICON offset is by matching native. */
|
||||
/* Matches IE4 "Links" bar. - GA 8/01 */
|
||||
rcText.left += (infoPtr->nBitmapWidth + 2);
|
||||
rcText.left += (infoPtr->nBitmapWidth + LIST_TEXT_OFFSET);
|
||||
}
|
||||
else {
|
||||
rcText.top += infoPtr->nBitmapHeight + 1;
|
||||
|
@ -735,7 +749,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
if (dwStyle & TBSTYLE_LIST) {
|
||||
/* LIST style w/o ICON offset is by matching native. */
|
||||
/* Matches IE4 "menu" bar. - GA 8/01 */
|
||||
rcText.left += 4;
|
||||
rcText.left += LIST_IMAGE_ABSENT_WIDTH + LIST_TEXT_OFFSET;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -860,7 +874,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
ILD_NORMAL))
|
||||
TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rcBitmap.left, rcBitmap.top);
|
||||
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
goto FINALNOTIFY;
|
||||
}
|
||||
|
||||
|
@ -884,13 +899,14 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
}
|
||||
|
||||
if (hasDropDownArrow)
|
||||
TOOLBAR_DrawArrow(hdc, rcArrow.left, rcArrow.top + (rcArrow.bottom - rcArrow.top - ARROW_HEIGHT) / 2, COLOR_WINDOWFRAME);
|
||||
TOOLBAR_DrawArrow(hdc, rcArrow.left + offset, rcArrow.top + offset + (rcArrow.bottom - rcArrow.top - ARROW_HEIGHT) / 2, COLOR_WINDOWFRAME);
|
||||
|
||||
TOOLBAR_DrawImageList (infoPtr, btnPtr, IMAGE_LIST_DEFAULT,
|
||||
hdc, rcBitmap.left+offset, rcBitmap.top+offset,
|
||||
ILD_NORMAL);
|
||||
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
goto FINALNOTIFY;
|
||||
}
|
||||
|
||||
|
@ -913,7 +929,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
hdc, rcBitmap.left+1, rcBitmap.top+1,
|
||||
ILD_NORMAL);
|
||||
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
goto FINALNOTIFY;
|
||||
}
|
||||
|
||||
|
@ -925,7 +942,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
|
||||
TOOLBAR_DrawPattern (hdc, &rc);
|
||||
TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rcBitmap.left, rcBitmap.top);
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
goto FINALNOTIFY;
|
||||
}
|
||||
|
||||
|
@ -933,7 +951,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
if (dwStyle & TBSTYLE_FLAT)
|
||||
{
|
||||
if (hasDropDownArrow)
|
||||
TOOLBAR_DrawArrow(hdc, rcArrow.left+1, 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);
|
||||
|
||||
if (tbcd.nmcd.uItemState & CDIS_HOT) {
|
||||
/* if hot, attempt to draw with hot image list, if fails,
|
||||
|
@ -971,7 +989,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
}
|
||||
|
||||
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, dwStyle, &rcText, lpText, &tbcd);
|
||||
|
||||
FINALNOTIFY:
|
||||
if (infoPtr->dwItemCustDraw & CDRF_NOTIFYPOSTPAINT)
|
||||
|
@ -997,7 +1016,7 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
|
|||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
TBUTTON_INFO *btnPtr;
|
||||
INT i, oldBKmode = 0;
|
||||
RECT rcTemp;
|
||||
RECT rcTemp, rcClient;
|
||||
NMTBCUSTOMDRAW tbcd;
|
||||
DWORD ntfret;
|
||||
|
||||
|
@ -1023,11 +1042,22 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
|
|||
if (infoPtr->bBtnTranspnt)
|
||||
oldBKmode = SetBkMode (hdc, TRANSPARENT);
|
||||
|
||||
GetClientRect(hwnd, &rcClient);
|
||||
|
||||
/* redraw necessary buttons */
|
||||
btnPtr = infoPtr->buttons;
|
||||
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
|
||||
{
|
||||
if(IntersectRect(&rcTemp, &(ps->rcPaint), &(btnPtr->rect)))
|
||||
BOOL bDraw;
|
||||
if (infoPtr->dwExStyle & TBSTYLE_EX_HIDECLIPPEDBUTTONS)
|
||||
{
|
||||
IntersectRect(&rcTemp, &rcClient, &btnPtr->rect);
|
||||
bDraw = EqualRect(&rcTemp, &btnPtr->rect);
|
||||
}
|
||||
else
|
||||
bDraw = TRUE;
|
||||
bDraw &= IntersectRect(&rcTemp, &(ps->rcPaint), &(btnPtr->rect));
|
||||
if (bDraw)
|
||||
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
|
||||
}
|
||||
|
||||
|
@ -1065,7 +1095,9 @@ TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
|||
lpSize->cx = 0;
|
||||
lpSize->cy = 0;
|
||||
|
||||
if (!(btnPtr->fsState & TBSTATE_HIDDEN) )
|
||||
if (!(btnPtr->fsState & TBSTATE_HIDDEN) &&
|
||||
(!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
|
||||
(btnPtr->fsStyle & BTNS_SHOWTEXT)) )
|
||||
{
|
||||
LPWSTR lpText = TOOLBAR_GetText(infoPtr, btnPtr);
|
||||
|
||||
|
@ -1444,7 +1476,8 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (btnPtr->fsStyle & TBSTYLE_AUTOSIZE)
|
||||
if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
|
||||
(btnPtr->fsStyle & TBSTYLE_AUTOSIZE))
|
||||
{
|
||||
SIZE sz;
|
||||
HDC hdc;
|
||||
|
@ -1458,9 +1491,9 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
|||
SelectObject (hdc, hOldFont);
|
||||
ReleaseDC (hwnd, hdc);
|
||||
|
||||
/* Fudge amount measured against IE4 "menu" and "Links" */
|
||||
/* toolbars with native control (v4.71). - GA 8/01 */
|
||||
cx = sz.cx + 6 + 5 + 5;
|
||||
if (sz.cx > 0)
|
||||
sz.cx += 2*LIST_TEXT_OFFSET;
|
||||
cx = sz.cx + 2*LIST_IMAGE_OFFSET;
|
||||
if (TOOLBAR_TestImageExist (infoPtr, btnPtr, GETDEFIMAGELIST(infoPtr,0)))
|
||||
{
|
||||
if (dwStyle & TBSTYLE_LIST)
|
||||
|
@ -1468,6 +1501,8 @@ TOOLBAR_CalcToolbar (HWND hwnd)
|
|||
else if (cx < (infoPtr->nBitmapWidth+7))
|
||||
cx = infoPtr->nBitmapWidth+7;
|
||||
}
|
||||
else if (dwStyle & TBSTYLE_LIST)
|
||||
cx += LIST_IMAGE_ABSENT_WIDTH;
|
||||
}
|
||||
else
|
||||
cx = infoPtr->nButtonWidth;
|
||||
|
@ -1716,18 +1751,15 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
if (!TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_QUERYINSERT))
|
||||
return FALSE;
|
||||
|
||||
/* UNDOCUMENTED: dialog hwnd immediately follows NMHDR */
|
||||
nmtb.iItem = (int)hwnd;
|
||||
/* Send TBN_INITCUSTOMIZE notification */
|
||||
if (TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_INITCUSTOMIZE) ==
|
||||
TBNRF_HIDEHELP)
|
||||
TBNRF_HIDEHELP)
|
||||
{
|
||||
TRACE("TBNRF_HIDEHELP requested\n");
|
||||
ShowWindow(GetDlgItem(hwnd, IDC_HELP_BTN), SW_HIDE);
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("Help button not implemented\n");
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_HELP_BTN), FALSE);
|
||||
}
|
||||
|
||||
/* add items to 'toolbar buttons' list and check if removable */
|
||||
for (i = 0; i < custInfo->tbInfo->nNumButtons; i++)
|
||||
|
@ -1995,6 +2027,12 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case IDC_HELP_BTN:
|
||||
TOOLBAR_SendNotify(&nmtb.hdr, infoPtr, TBN_CUSTHELP);
|
||||
break;
|
||||
case IDC_RESET_BTN:
|
||||
TOOLBAR_SendNotify(&nmtb.hdr, infoPtr, TBN_RESET);
|
||||
break;
|
||||
|
||||
case IDOK: /* Add button */
|
||||
{
|
||||
|
@ -3213,6 +3251,8 @@ TOOLBAR_GetExtendedStyle (HWND hwnd)
|
|||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
return infoPtr->dwExStyle;
|
||||
}
|
||||
|
||||
|
@ -3795,7 +3835,8 @@ TOOLBAR_PressButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: there might still be some confusion her between number of buttons
|
||||
* and number of bitmaps */
|
||||
static LRESULT
|
||||
TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -3803,6 +3844,7 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
LPTBREPLACEBITMAP lpReplace = (LPTBREPLACEBITMAP) lParam;
|
||||
HBITMAP hBitmap;
|
||||
int i = 0, nOldButtons = 0, pos = 0;
|
||||
int nOldBitmaps, nNewBitmaps;
|
||||
HIMAGELIST himlDef = 0;
|
||||
|
||||
TRACE("hInstOld %p nIDOld %x hInstNew %p nIDNew %x nButtons %x\n",
|
||||
|
@ -3846,16 +3888,14 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
WARN("No hinst/bitmap found! hInst %p nID %x\n", lpReplace->hInstOld, lpReplace->nIDOld);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
infoPtr->nNumBitmaps = infoPtr->nNumBitmaps - nOldButtons + lpReplace->nButtons;
|
||||
|
||||
himlDef = GETDEFIMAGELIST(infoPtr, 0); /* fixme: correct? */
|
||||
nOldBitmaps = ImageList_GetImageCount(himlDef);
|
||||
|
||||
/* ImageList_Replace(GETDEFIMAGELIST(), pos, hBitmap, NULL); */
|
||||
|
||||
|
||||
himlDef = GETDEFIMAGELIST(infoPtr, 0);
|
||||
for (i = pos + nOldButtons - 1; i >= pos; i--) {
|
||||
for (i = pos + nOldBitmaps - 1; i >= pos; i--)
|
||||
ImageList_Remove(himlDef, i);
|
||||
}
|
||||
|
||||
{
|
||||
BITMAP bmp;
|
||||
|
@ -3885,9 +3925,15 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
DeleteDC (hdcBitmap);
|
||||
|
||||
ImageList_Add (himlDef, hbmLoad, NULL);
|
||||
nNewBitmaps = ImageList_GetImageCount(himlDef);
|
||||
DeleteObject (hbmLoad);
|
||||
}
|
||||
|
||||
infoPtr->nNumBitmaps = infoPtr->nNumBitmaps - nOldBitmaps + nNewBitmaps;
|
||||
|
||||
TRACE(" pos %d %d old bitmaps replaced by %d new ones.\n",
|
||||
pos, nOldBitmaps, nNewBitmaps);
|
||||
|
||||
InvalidateRect(hwnd, NULL, FALSE);
|
||||
|
||||
return TRUE;
|
||||
|
@ -4212,21 +4258,20 @@ TOOLBAR_SetExtendedStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
DWORD dwTemp;
|
||||
|
||||
dwTemp = infoPtr->dwExStyle;
|
||||
infoPtr->dwExStyle = (DWORD)lParam;
|
||||
infoPtr->dwExStyle |= (DWORD)lParam;
|
||||
|
||||
if (infoPtr->dwExStyle & (TBSTYLE_EX_MIXEDBUTTONS |
|
||||
TBSTYLE_EX_HIDECLIPPEDBUTTONS)) {
|
||||
FIXME("Extended style not implemented %s %s\n",
|
||||
(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ?
|
||||
"TBSTYLE_EX_MIXEDBUTTONS" : "",
|
||||
(infoPtr->dwExStyle & TBSTYLE_EX_HIDECLIPPEDBUTTONS) ?
|
||||
"TBSTYLE_EX_HIDECLIPPEDBUTTONS" : "");
|
||||
}
|
||||
TRACE("new style 0x%08lx\n", infoPtr->dwExStyle);
|
||||
|
||||
if (infoPtr->dwExStyle & ~TBSTYLE_EX_ALL)
|
||||
FIXME("Unknown Toolbar Extended Style 0x%08lx. Please report.\n",
|
||||
(infoPtr->dwExStyle & ~TBSTYLE_EX_ALL));
|
||||
|
||||
TOOLBAR_CalcToolbar (hwnd);
|
||||
|
||||
TOOLBAR_AutoSize(hwnd);
|
||||
|
||||
InvalidateRect(hwnd, NULL, FALSE);
|
||||
|
||||
return (LRESULT)dwTemp;
|
||||
}
|
||||
|
||||
|
@ -4475,27 +4520,7 @@ TOOLBAR_SetState (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
static LRESULT
|
||||
TOOLBAR_SetStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
TBUTTON_INFO *btnPtr;
|
||||
INT nIndex;
|
||||
|
||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
||||
if (nIndex == -1)
|
||||
return FALSE;
|
||||
|
||||
btnPtr = &infoPtr->buttons[nIndex];
|
||||
|
||||
/* process style change if current style doesn't match new style */
|
||||
if(btnPtr->fsStyle != LOWORD(lParam))
|
||||
{
|
||||
btnPtr->fsStyle = LOWORD(lParam);
|
||||
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr,
|
||||
btnPtr));
|
||||
|
||||
if (infoPtr->hwndToolTip) {
|
||||
FIXME("change tool tip!\n");
|
||||
}
|
||||
}
|
||||
SetWindowLongW(hwnd, GWL_STYLE, lParam);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -4697,7 +4722,6 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
infoPtr->nBitmapWidth = 16;
|
||||
|
||||
infoPtr->nHeight = infoPtr->nButtonHeight + TOP_BORDER + BOTTOM_BORDER;
|
||||
infoPtr->nRows = 1;
|
||||
infoPtr->nMaxTextRows = 1;
|
||||
infoPtr->cxMin = -1;
|
||||
infoPtr->cxMax = -1;
|
||||
|
@ -4709,7 +4733,7 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
infoPtr->nButtonDown = -1;
|
||||
infoPtr->nOldHit = -1;
|
||||
infoPtr->nHotItem = -2; /* It has to be initially different from nOldHit */
|
||||
infoPtr->hwndNotify = GetParent (hwnd);
|
||||
infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
|
||||
infoPtr->bTransparent = (dwStyle & TBSTYLE_TRANSPARENT);
|
||||
infoPtr->bBtnTranspnt = (dwStyle & (TBSTYLE_FLAT | TBSTYLE_LIST));
|
||||
infoPtr->dwDTFlags = (dwStyle & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE : DT_CENTER;
|
||||
|
@ -5274,6 +5298,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
/* paranoid!! */
|
||||
infoPtr->dwStructSize = sizeof(TBBUTTON);
|
||||
infoPtr->nRows = 1;
|
||||
|
||||
/* fix instance handle, if the toolbar was created by CreateToolbarEx() */
|
||||
if (!GetWindowLongA (hwnd, GWL_HINSTANCE)) {
|
||||
|
@ -5447,7 +5472,7 @@ TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
INT i;
|
||||
|
||||
if (lParam == NF_REQUERY) {
|
||||
i = SendMessageA(GetParent(infoPtr->hwndSelf),
|
||||
i = SendMessageA(infoPtr->hwndNotify,
|
||||
WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
|
||||
if ((i < NFR_ANSI) || (i > NFR_UNICODE)) {
|
||||
ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n",
|
||||
|
@ -5620,8 +5645,12 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, LPSTYLESTRUCT lpStyle)
|
|||
infoPtr->bBtnTranspnt = (lpStyle->styleNew &
|
||||
(TBSTYLE_FLAT | TBSTYLE_LIST));
|
||||
TOOLBAR_CheckStyle (hwnd, lpStyle->styleNew);
|
||||
|
||||
TRACE("new style 0x%08lx\n", lpStyle->styleNew);
|
||||
}
|
||||
|
||||
TOOLBAR_CalcToolbar(hwnd);
|
||||
|
||||
TOOLBAR_AutoSize (hwnd);
|
||||
|
||||
InvalidateRect(hwnd, NULL, FALSE);
|
||||
|
@ -5643,6 +5672,8 @@ TOOLBAR_SysColorChange (HWND hwnd)
|
|||
static LRESULT WINAPI
|
||||
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
|
||||
TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n",
|
||||
hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam);
|
||||
|
||||
|
@ -5996,13 +6027,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_DRAWITEM:
|
||||
case WM_MEASUREITEM:
|
||||
case WM_VKEYTOITEM:
|
||||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
if(infoPtr != NULL)
|
||||
return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam);
|
||||
else
|
||||
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
|
||||
}
|
||||
return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam);
|
||||
|
||||
/* We see this in Outlook Express 5.x and just does DefWindowProc */
|
||||
case PGM_FORWARDMOUSE:
|
||||
|
|
|
@ -1902,12 +1902,11 @@ TOOLTIPS_WindowFromPoint (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
|
||||
static LRESULT
|
||||
TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr;
|
||||
NONCLIENTMETRICSA nclm;
|
||||
INT nResult;
|
||||
HWND hParent;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO));
|
||||
|
@ -1930,21 +1929,16 @@ TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
TOOLTIPS_SetDelayTime(hwnd, TTDT_AUTOMATIC, 0L);
|
||||
|
||||
hParent = GetParent(hwnd);
|
||||
if (hParent) {
|
||||
nResult = (INT) SendMessageA (hParent, WM_NOTIFYFORMAT,
|
||||
nResult = (INT) SendMessageA (lpcs->hwndParent, WM_NOTIFYFORMAT,
|
||||
(WPARAM)hwnd, (LPARAM)NF_QUERY);
|
||||
if (nResult == NFR_ANSI) {
|
||||
infoPtr->bNotifyUnicode = FALSE;
|
||||
if (nResult == NFR_ANSI) {
|
||||
infoPtr->bNotifyUnicode = FALSE;
|
||||
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
|
||||
}
|
||||
else if (nResult == NFR_UNICODE) {
|
||||
infoPtr->bNotifyUnicode = TRUE;
|
||||
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
|
||||
}
|
||||
else {
|
||||
ERR (" -- WM_NOTIFYFORMAT returns: error!\n");
|
||||
}
|
||||
} else if (nResult == NFR_UNICODE) {
|
||||
infoPtr->bNotifyUnicode = TRUE;
|
||||
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
|
||||
} else {
|
||||
TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
|
||||
}
|
||||
|
||||
SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE);
|
||||
|
@ -2371,7 +2365,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
|
||||
case WM_CREATE:
|
||||
return TOOLTIPS_Create (hwnd, wParam, lParam);
|
||||
return TOOLTIPS_Create (hwnd, (LPCREATESTRUCTW)lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return TOOLTIPS_Destroy (hwnd, wParam, lParam);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -48,6 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(updown);
|
|||
typedef struct
|
||||
{
|
||||
HWND Self; /* Handle to this up-down control */
|
||||
HWND Notify; /* Handle to the parent window */
|
||||
UINT AccelCount; /* Number of elements in AccelVect */
|
||||
UDACCEL* AccelVect; /* Vector containing AccelCount elements */
|
||||
INT AccelIndex; /* Current accel index, -1 if not accel'ing */
|
||||
|
@ -562,8 +563,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
|
|||
ni.hdr.hwndFrom = infoPtr->Self;
|
||||
ni.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
|
||||
ni.hdr.code = UDN_DELTAPOS;
|
||||
if (!SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY,
|
||||
(WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
|
||||
if (!SendMessageW(infoPtr->Notify, WM_NOTIFY, (WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
|
||||
/* Parent said: OK to adjust */
|
||||
|
||||
/* Now adjust value with (maybe new) delta */
|
||||
|
@ -574,10 +574,8 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
|
|||
}
|
||||
|
||||
/* Also, notify it. This message is sent in any case. */
|
||||
SendMessageW( GetParent(infoPtr->Self),
|
||||
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
|
||||
MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal),
|
||||
(LPARAM)infoPtr->Self);
|
||||
SendMessageW( infoPtr->Notify, dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
|
||||
MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal), (LPARAM)infoPtr->Self);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -616,7 +614,7 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
|
|||
hdr.hwndFrom = infoPtr->Self;
|
||||
hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
|
||||
hdr.code = NM_RELEASEDCAPTURE;
|
||||
SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr);
|
||||
SendMessageW(infoPtr->Notify, WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr);
|
||||
ReleaseCapture();
|
||||
}
|
||||
|
||||
|
@ -720,6 +718,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
|||
|
||||
/* initialize the info struct */
|
||||
infoPtr->Self = hwnd;
|
||||
infoPtr->Notify = ((LPCREATESTRUCTA)lParam)->hwndParent;
|
||||
infoPtr->AccelCount = 0;
|
||||
infoPtr->AccelVect = 0;
|
||||
infoPtr->AccelIndex = -1;
|
||||
|
@ -798,7 +797,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
|||
if ( (infoPtr->Flags & FLAG_MOUSEIN) &&
|
||||
(infoPtr->Flags & FLAG_ARROW) ) {
|
||||
|
||||
SendMessageW( GetParent(hwnd),
|
||||
SendMessageW( infoPtr->Notify,
|
||||
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
|
||||
MAKELONG(SB_ENDSCROLL, infoPtr->CurVal),
|
||||
(LPARAM)hwnd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue