* - check for the 'rec ' list in some AVI files
*/
-#define COM_NO_WINDOWS_H
#include <stdarg.h>
#include <string.h>
#include "windef.h"
mmioRead(infoPtr->hMMio, (LPSTR)&infoPtr->mah, sizeof(infoPtr->mah));
- TRACE("mah.dwMicroSecPerFrame=%ld\n", infoPtr->mah.dwMicroSecPerFrame);
- TRACE("mah.dwMaxBytesPerSec=%ld\n", infoPtr->mah.dwMaxBytesPerSec);
- TRACE("mah.dwPaddingGranularity=%ld\n", infoPtr->mah.dwPaddingGranularity);
- TRACE("mah.dwFlags=%ld\n", infoPtr->mah.dwFlags);
- TRACE("mah.dwTotalFrames=%ld\n", infoPtr->mah.dwTotalFrames);
- TRACE("mah.dwInitialFrames=%ld\n", infoPtr->mah.dwInitialFrames);
- TRACE("mah.dwStreams=%ld\n", infoPtr->mah.dwStreams);
- TRACE("mah.dwSuggestedBufferSize=%ld\n", infoPtr->mah.dwSuggestedBufferSize);
- TRACE("mah.dwWidth=%ld\n", infoPtr->mah.dwWidth);
- TRACE("mah.dwHeight=%ld\n", infoPtr->mah.dwHeight);
+ TRACE("mah.dwMicroSecPerFrame=%d\n", infoPtr->mah.dwMicroSecPerFrame);
+ TRACE("mah.dwMaxBytesPerSec=%d\n", infoPtr->mah.dwMaxBytesPerSec);
+ TRACE("mah.dwPaddingGranularity=%d\n", infoPtr->mah.dwPaddingGranularity);
+ TRACE("mah.dwFlags=%d\n", infoPtr->mah.dwFlags);
+ TRACE("mah.dwTotalFrames=%d\n", infoPtr->mah.dwTotalFrames);
+ TRACE("mah.dwInitialFrames=%d\n", infoPtr->mah.dwInitialFrames);
+ TRACE("mah.dwStreams=%d\n", infoPtr->mah.dwStreams);
+ TRACE("mah.dwSuggestedBufferSize=%d\n", infoPtr->mah.dwSuggestedBufferSize);
+ TRACE("mah.dwWidth=%d\n", infoPtr->mah.dwWidth);
+ TRACE("mah.dwHeight=%d\n", infoPtr->mah.dwHeight);
mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
HIBYTE(LOWORD(infoPtr->ash.fccHandler)),
LOBYTE(HIWORD(infoPtr->ash.fccHandler)),
HIBYTE(HIWORD(infoPtr->ash.fccHandler)));
- TRACE("ash.dwFlags=%ld\n", infoPtr->ash.dwFlags);
+ TRACE("ash.dwFlags=%d\n", infoPtr->ash.dwFlags);
TRACE("ash.wPriority=%d\n", infoPtr->ash.wPriority);
TRACE("ash.wLanguage=%d\n", infoPtr->ash.wLanguage);
- TRACE("ash.dwInitialFrames=%ld\n", infoPtr->ash.dwInitialFrames);
- TRACE("ash.dwScale=%ld\n", infoPtr->ash.dwScale);
- TRACE("ash.dwRate=%ld\n", infoPtr->ash.dwRate);
- TRACE("ash.dwStart=%ld\n", infoPtr->ash.dwStart);
- TRACE("ash.dwLength=%ld\n", infoPtr->ash.dwLength);
- TRACE("ash.dwSuggestedBufferSize=%ld\n", infoPtr->ash.dwSuggestedBufferSize);
- TRACE("ash.dwQuality=%ld\n", infoPtr->ash.dwQuality);
- TRACE("ash.dwSampleSize=%ld\n", infoPtr->ash.dwSampleSize);
+ TRACE("ash.dwInitialFrames=%d\n", infoPtr->ash.dwInitialFrames);
+ TRACE("ash.dwScale=%d\n", infoPtr->ash.dwScale);
+ TRACE("ash.dwRate=%d\n", infoPtr->ash.dwRate);
+ TRACE("ash.dwStart=%d\n", infoPtr->ash.dwStart);
+ TRACE("ash.dwLength=%d\n", infoPtr->ash.dwLength);
+ TRACE("ash.dwSuggestedBufferSize=%d\n", infoPtr->ash.dwSuggestedBufferSize);
+ TRACE("ash.dwQuality=%d\n", infoPtr->ash.dwQuality);
+ TRACE("ash.dwSampleSize=%d\n", infoPtr->ash.dwSampleSize);
TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", infoPtr->ash.rcFrame.top, infoPtr->ash.rcFrame.left,
infoPtr->ash.rcFrame.bottom, infoPtr->ash.rcFrame.right);
mmioRead(infoPtr->hMMio, (LPSTR)infoPtr->inbih, mmckInfo.cksize);
- TRACE("bih.biSize=%ld\n", infoPtr->inbih->biSize);
- TRACE("bih.biWidth=%ld\n", infoPtr->inbih->biWidth);
- TRACE("bih.biHeight=%ld\n", infoPtr->inbih->biHeight);
+ TRACE("bih.biSize=%d\n", infoPtr->inbih->biSize);
+ TRACE("bih.biWidth=%d\n", infoPtr->inbih->biWidth);
+ TRACE("bih.biHeight=%d\n", infoPtr->inbih->biHeight);
TRACE("bih.biPlanes=%d\n", infoPtr->inbih->biPlanes);
TRACE("bih.biBitCount=%d\n", infoPtr->inbih->biBitCount);
- TRACE("bih.biCompression=%ld\n", infoPtr->inbih->biCompression);
- TRACE("bih.biSizeImage=%ld\n", infoPtr->inbih->biSizeImage);
- TRACE("bih.biXPelsPerMeter=%ld\n", infoPtr->inbih->biXPelsPerMeter);
- TRACE("bih.biYPelsPerMeter=%ld\n", infoPtr->inbih->biYPelsPerMeter);
- TRACE("bih.biClrUsed=%ld\n", infoPtr->inbih->biClrUsed);
- TRACE("bih.biClrImportant=%ld\n", infoPtr->inbih->biClrImportant);
+ TRACE("bih.biCompression=%d\n", infoPtr->inbih->biCompression);
+ TRACE("bih.biSizeImage=%d\n", infoPtr->inbih->biSizeImage);
+ TRACE("bih.biXPelsPerMeter=%d\n", infoPtr->inbih->biXPelsPerMeter);
+ TRACE("bih.biYPelsPerMeter=%d\n", infoPtr->inbih->biYPelsPerMeter);
+ TRACE("bih.biClrUsed=%d\n", infoPtr->inbih->biClrUsed);
+ TRACE("bih.biClrImportant=%d\n", infoPtr->inbih->biClrImportant);
mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
}
if (numFrame != infoPtr->mah.dwTotalFrames) {
- WARN("Found %ld frames (/%ld)\n", numFrame, infoPtr->mah.dwTotalFrames);
+ WARN("Found %d frames (/%d)\n", numFrame, infoPtr->mah.dwTotalFrames);
return FALSE;
}
if (insize > infoPtr->ash.dwSuggestedBufferSize) {
- WARN("insize=%ld suggestedSize=%ld\n", insize, infoPtr->ash.dwSuggestedBufferSize);
+ WARN("insize=%d suggestedSize=%d\n", insize, infoPtr->ash.dwSuggestedBufferSize);
infoPtr->ash.dwSuggestedBufferSize = insize;
}
infoPtr->hbmPrevFrame = 0;
infoPtr->dwStyle = lpcs->style;
- TRACE("Animate style=0x%08lx, parent=%p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
+ TRACE("Animate style=0x%08x, parent=%p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
InitializeCriticalSection(&infoPtr->cs);
static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT lpss)
{
- TRACE("(styletype=%x, styleOld=0x%08lx, styleNew=0x%08lx)\n",
+ TRACE("(styletype=%x, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0;
GetTextExtentPointW (mydc, strA, 1, size);
SelectObject (mydc, ofont);
ReleaseDC (0, mydc);
- TRACE("selected font hwnd=%p, height=%ld\n", nfont, size->cy);
+ TRACE("selected font hwnd=%p, height=%d\n", nfont, size->cy);
}
/* reposition the Edit control based on whether icon exists */
COMBOEX_GetComboFontSize (infoPtr, &mysize);
- TRACE("Combo font x=%ld, y=%ld\n", mysize.cx, mysize.cy);
+ TRACE("Combo font x=%d, y=%d\n", mysize.cx, mysize.cy);
x = xioff + CBE_STARTOFFSET + 1;
w = rect.right-rect.left - x - GetSystemMetrics(SM_CXVSCROLL) - 1;
h = mysize.cy + 1;
y = rect.bottom - h - 1;
- TRACE("Combo client (%ld,%ld)-(%ld,%ld), setting Edit to (%d,%d)-(%d,%d)\n",
+ TRACE("Combo client (%d,%d)-(%d,%d), setting Edit to (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom, x, y, x + w, y + h);
SetWindowPos(infoPtr->hwndEdit, HWND_TOP, x, y, w, h,
SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER);
cy = mysize.cy + CBE_EXTRA;
if (infoPtr->himl && ImageList_GetImageInfo(infoPtr->himl, 0, &iinfo)) {
cy = max (iinfo.rcImage.bottom - iinfo.rcImage.top, cy);
- TRACE("upgraded height due to image: height=%ld\n", cy);
+ TRACE("upgraded height due to image: height=%d\n", cy);
}
SendMessageW (infoPtr->hwndSelf, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)cy);
if (infoPtr->hwndCombo) {
{
DWORD dwTemp;
- TRACE("(mask=x%08lx, style=0x%08lx)\n", mask, style);
+ TRACE("(mask=x%08x, style=0x%08x)\n", mask, style);
dwTemp = infoPtr->dwExtStyle;
mask = CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT;
if ((infoPtr->dwExtStyle & mask) != (dwTemp & mask)) {
/* if state of EX_NOEDITIMAGE changes, invalidate all */
- TRACE("EX_NOEDITIMAGE state changed to %ld\n",
+ TRACE("EX_NOEDITIMAGE state changed to %d\n",
infoPtr->dwExtStyle & CBES_EX_NOEDITIMAGE);
InvalidateRect (infoPtr->hwndSelf, NULL, TRUE);
COMBOEX_AdjustEditPos (infoPtr);
height = cb_wrect.bottom-cb_wrect.top
+ cbx_wrect.bottom-cbx_wrect.top
- (cbx_crect.bottom-cbx_crect.top);
- TRACE("EX window=(%ld,%ld)-(%ld,%ld), client=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("EX window=(%d,%d)-(%d,%d), client=(%d,%d)-(%d,%d)\n",
cbx_wrect.left, cbx_wrect.top, cbx_wrect.right, cbx_wrect.bottom,
cbx_crect.left, cbx_crect.top, cbx_crect.right, cbx_crect.bottom);
- TRACE("CB window=(%ld,%ld)-(%ld,%ld), EX setting=(0,0)-(%ld,%d)\n",
+ TRACE("CB window=(%d,%d)-(%d,%d), EX setting=(0,0)-(%d,%d)\n",
cb_wrect.left, cb_wrect.top, cb_wrect.right, cb_wrect.bottom,
cbx_wrect.right-cbx_wrect.left, height);
SetWindowPos (infoPtr->hwndSelf, HWND_TOP, 0, 0,
/* create combo box */
GetWindowRect(hwnd, &wnrc1);
GetClientRect(hwnd, &clrc1);
- TRACE("EX window=(%ld,%ld)-(%ld,%ld) client=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("EX window=(%d,%d)-(%d,%d) client=(%d,%d)-(%d,%d)\n",
wnrc1.left, wnrc1.top, wnrc1.right, wnrc1.bottom,
clrc1.left, clrc1.top, clrc1.right, clrc1.bottom);
GetWindowRect(hwnd, &wnrc1);
GetClientRect(hwnd, &clrc1);
GetWindowRect(infoPtr->hwndCombo, &cmbwrc);
- TRACE("EX window=(%ld,%ld)-(%ld,%ld) client=(%ld,%ld)-(%ld,%ld) CB wnd=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("EX window=(%d,%d)-(%d,%d) client=(%d,%d)-(%d,%d) CB wnd=(%d,%d)-(%d,%d)\n",
wnrc1.left, wnrc1.top, wnrc1.right, wnrc1.bottom,
clrc1.left, clrc1.top, clrc1.right, clrc1.bottom,
cmbwrc.left, cmbwrc.top, cmbwrc.right, cmbwrc.bottom);
SWP_NOACTIVATE | SWP_NOREDRAW);
GetWindowRect(infoPtr->hwndCombo, &cmbwrc);
- TRACE("CB window=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("CB window=(%d,%d)-(%d,%d)\n",
cmbwrc.left, cmbwrc.top, cmbwrc.right, cmbwrc.bottom);
SetWindowPos(hwnd, HWND_TOP,
0, 0, cmbwrc.right-cmbwrc.left, cmbwrc.bottom-cmbwrc.top,
dis->CtlType, dis->CtlID);
TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
dis->itemID, dis->itemAction, dis->itemState);
- TRACE("hWnd=%p hDC=%p (%ld,%ld)-(%ld,%ld) itemData=0x%08lx\n",
+ TRACE("hWnd=%p hDC=%p (%d,%d)-(%d,%d) itemData=0x%08lx\n",
dis->hwndItem, dis->hDC, dis->rcItem.left,
dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom,
dis->itemData);
if ( ( (dis->itemAction & ODA_FOCUS) && (dis->itemState & ODS_SELECTED)) ||
( (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) && (dis->itemState & ODS_FOCUS) ) ) {
- TRACE("drawing item -1 special focus, rect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("drawing item -1 special focus, rect=(%d,%d)-(%d,%d)\n",
dis->rcItem.left, dis->rcItem.top,
dis->rcItem.right, dis->rcItem.bottom);
}
edrc.left=edrc.top=edrc.right=edrc.bottom=-1;
if (infoPtr->hwndEdit)
GetWindowRect (infoPtr->hwndEdit, &edrc);
- TRACE("window rects ex=(%ld,%ld)-(%ld,%ld), cb=(%ld,%ld)-(%ld,%ld), ed=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("window rects ex=(%d,%d)-(%d,%d), cb=(%d,%d)-(%d,%d), ed=(%d,%d)-(%d,%d)\n",
exrc.left, exrc.top, exrc.right, exrc.bottom,
cbrc.left, cbrc.top, cbrc.right, cbrc.bottom,
edrc.left, edrc.top, edrc.right, edrc.bottom);
}
}
else {
- ERR("NOT drawing item -1 special focus, rect=(%ld,%ld)-(%ld,%ld), action=%08x, state=%08x\n",
+ ERR("NOT drawing item -1 special focus, rect=(%d,%d)-(%d,%d), action=%08x, state=%08x\n",
dis->rcItem.left, dis->rcItem.top,
dis->rcItem.right, dis->rcItem.bottom,
dis->itemAction, dis->itemState);
rect.right = x + txtsize.cx;
rect.top = dis->rcItem.top + 1;
rect.bottom = dis->rcItem.bottom - 1;
- TRACE("drawing item %d text, rect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("drawing item %d text, rect=(%d,%d)-(%d,%d)\n",
dis->itemID, rect.left, rect.top, rect.right, rect.bottom);
ExtTextOutW (dis->hDC, x, y, ETO_OPAQUE | ETO_CLIPPED,
&rect, str, len, 0);
oldstyle = (DWORD)GetWindowLongW (hwnd, GWL_STYLE);
newstyle = oldstyle & ~(WS_VSCROLL | WS_HSCROLL | WS_BORDER);
if (newstyle != oldstyle) {
- TRACE("req style %08lx, reseting style %08lx\n",
+ TRACE("req style %08x, reseting style %08x\n",
oldstyle, newstyle);
SetWindowLongW (hwnd, GWL_STYLE, newstyle);
}
TRACE("winpos=(%d,%d %dx%d) flags=0x%08x\n",
wp->x, wp->y, wp->cx, wp->cy, wp->flags);
- TRACE("EX window=(%ld,%ld)-(%ld,%ld), client=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("EX window=(%d,%d)-(%d,%d), client=(%d,%d)-(%d,%d)\n",
cbx_wrect.left, cbx_wrect.top, cbx_wrect.right, cbx_wrect.bottom,
cbx_crect.left, cbx_crect.top, cbx_crect.right, cbx_crect.bottom);
- TRACE("CB window=(%ld,%ld)-(%ld,%ld), EX setting=(0,0)-(%d,%ld)\n",
+ TRACE("CB window=(%d,%d)-(%d,%d), EX setting=(0,0)-(%d,%d)\n",
cb_wrect.left, cb_wrect.top, cb_wrect.right, cb_wrect.bottom,
width, cb_wrect.bottom-cb_wrect.top);
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
GetClientRect (hwnd, &rect);
- TRACE("erasing (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("erasing (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc);
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
GetClientRect (hwnd, &rect);
- TRACE("erasing (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("erasing (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc);
*| DWORD nMaxItems;
*| DWORD dwFlags;
*| HKEY hKey;
- *| LPCTSTR lpszSubKey;
+ *| LPTSTR lpszSubKey;
*| PROC lpfnCompare;
*|} CREATEMRULIST, *LPCREATEMRULIST;
*
DWORD nMaxItems;
DWORD dwFlags;
HKEY hKey;
- LPCSTR lpszSubKey;
+ LPSTR lpszSubKey;
PROC lpfnCompare;
} CREATEMRULISTA, *LPCREATEMRULISTA;
DWORD nMaxItems;
DWORD dwFlags;
HKEY hKey;
- LPCWSTR lpszSubKey;
+ LPWSTR lpszSubKey;
PROC lpfnCompare;
} CREATEMRULISTW, *LPCREATEMRULISTW;
if (err) {
ERR("error saving /%s/, err=%d\n", debugstr_w(realname), err);
}
- TRACE("saving value for name /%s/ size=%ld\n",
+ TRACE("saving value for name /%s/ size=%d\n",
debugstr_w(realname), witem->size);
}
}
}
Free(mp->realMRU);
Free(mp->array);
- Free((LPWSTR)mp->extview.lpszSubKey);
+ Free(mp->extview.lpszSubKey);
Free(mp);
}
if (lpRegNum && (ret != -1))
*lpRegNum = 'a' + i;
- TRACE("(%p, %p, %ld, %p) returning %d\n",
+ TRACE("(%p, %p, %d, %p) returning %d\n",
hList, lpData, cbData, lpRegNum, ret);
return ret;
mp->wineFlags |= WMRUF_CHANGED;
mp->realMRU[0] = replace + 'a';
- TRACE("(%p, %p, %ld) adding data, /%c/ now most current\n",
+ TRACE("(%p, %p, %d) adding data, /%c/ now most current\n",
hList, lpData, cbData, replace+'a');
if (!(mp->extview.dwFlags & MRUF_DELAYED_SAVE)) {
&newkey,
&dwdisp))) {
/* error - what to do ??? */
- ERR("(%lu %lu %lx %p %s %p): Could not open key, error=%d\n",
+ ERR("(%u %u %x %p %s %p): Could not open key, error=%d\n",
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
mp->extview.lpfnCompare, err);
else
datasize /= sizeof(WCHAR);
- TRACE("MRU list = %s, datasize = %ld\n", debugstr_w(mp->realMRU), datasize);
+ TRACE("MRU list = %s, datasize = %d\n", debugstr_w(mp->realMRU), datasize);
mp->cursize = datasize - 1;
/* datasize now has number of items in the MRUList */
else
mp->cursize = 0;
- TRACE("(%lu %lu %lx %p %s %p): Current Size = %ld\n",
+ TRACE("(%u %u %x %p %s %p): Current Size = %d\n",
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
mp->extview.lpfnCompare, mp->cursize);
mp = Alloc(sizeof(WINEMRULIST));
memcpy(&mp->extview, lpcml, sizeof(CREATEMRULISTW));
mp->extview.lpszSubKey = Alloc((strlenW(lpcml->lpszSubKey) + 1) * sizeof(WCHAR));
- strcpyW((LPWSTR)mp->extview.lpszSubKey, lpcml->lpszSubKey);
+ strcpyW(mp->extview.lpszSubKey, lpcml->lpszSubKey);
mp->isUnicode = TRUE;
return CreateMRUListLazy_common(mp);
len = MultiByteToWideChar(CP_ACP, 0, lpcml->lpszSubKey, -1, NULL, 0);
mp->extview.lpszSubKey = Alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpcml->lpszSubKey, -1,
- (LPWSTR)mp->extview.lpszSubKey, len);
+ mp->extview.lpszSubKey, len);
mp->isUnicode = FALSE;
return CreateMRUListLazy_common(mp);
}
witem = mp->array[desired];
datasize = min( witem->size, nBufferSize );
memcpy( lpBuffer, &witem->datastart, datasize);
- TRACE("(%p, %d, %p, %ld): returning len=%d\n",
+ TRACE("(%p, %d, %p, %d): returning len=%d\n",
hList, nItemPos, lpBuffer, nBufferSize, datasize);
return datasize;
}
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
lpBuffer, datasize, NULL, NULL);
}
- TRACE("(%p, %d, %p, %ld): returning len=%d\n",
+ TRACE("(%p, %d, %p, %d): returning len=%d\n",
hList, nItemPos, lpBuffer, nBufferSize, datasize);
return datasize;
}
-
-/**************************************************************************
- * Str_GetPtrA [COMCTL32.233]
- *
- * Copies a string into a destination buffer.
- *
- * PARAMS
- * lpSrc [I] Source string
- * lpDest [O] Destination buffer
- * nMaxLen [I] Size of buffer in characters
- *
- * RETURNS
- * The number of characters copied.
- */
-INT WINAPI Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
-{
- INT len;
-
- TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
-
- if (!lpDest && lpSrc)
- return strlen (lpSrc);
-
- if (nMaxLen == 0)
- return 0;
-
- if (lpSrc == NULL) {
- lpDest[0] = '\0';
- return 0;
- }
-
- len = strlen (lpSrc);
- if (len >= nMaxLen)
- len = nMaxLen - 1;
-
- RtlMoveMemory (lpDest, lpSrc, len);
- lpDest[len] = '\0';
-
- return len;
-}
-
-
-/**************************************************************************
- * Str_SetPtrA [COMCTL32.234]
- *
- * Makes a copy of a string, allocating memory if necessary.
- *
- * PARAMS
- * lppDest [O] Pointer to destination string
- * lpSrc [I] Source string
- *
- * RETURNS
- * Success: TRUE
- * Failure: FALSE
- *
- * NOTES
- * Set lpSrc to NULL to free the memory allocated by a previous call
- * to this function.
- */
-BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
-{
- TRACE("(%p %p)\n", lppDest, lpSrc);
-
- if (lpSrc) {
- LPSTR ptr = ReAlloc (*lppDest, strlen (lpSrc) + 1);
- if (!ptr)
- return FALSE;
- strcpy (ptr, lpSrc);
- *lppDest = ptr;
- }
- else {
- if (*lppDest) {
- Free (*lppDest);
- *lppDest = NULL;
- }
- }
-
- return TRUE;
-}
-
-
-/**************************************************************************
- * Str_GetPtrW [COMCTL32.235]
- *
- * See Str_GetPtrA.
- */
-INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
-{
- INT len;
-
- TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
-
- if (!lpDest && lpSrc)
- return strlenW (lpSrc);
-
- if (nMaxLen == 0)
- return 0;
-
- if (lpSrc == NULL) {
- lpDest[0] = L'\0';
- return 0;
- }
-
- len = strlenW (lpSrc);
- if (len >= nMaxLen)
- len = nMaxLen - 1;
-
- RtlMoveMemory (lpDest, lpSrc, len*sizeof(WCHAR));
- lpDest[len] = L'\0';
-
- return len;
-}
-
-
-/**************************************************************************
- * Str_SetPtrW [COMCTL32.236]
- *
- * See Str_SetPtrA.
- */
-BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
-{
- TRACE("(%p %p)\n", lppDest, lpSrc);
-
- if (lpSrc) {
- INT len = strlenW (lpSrc) + 1;
- LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR));
- if (!ptr)
- return FALSE;
- strcpyW (ptr, lpSrc);
- *lppDest = ptr;
- }
- else {
- if (*lppDest) {
- Free (*lppDest);
- *lppDest = NULL;
- }
- }
-
- return TRUE;
-}
-
-
/**************************************************************************
* Str_GetPtrWtoA [internal]
*
LPNMHDR lpNmh = NULL;
UINT idFrom = 0;
- TRACE("(%p %p %d %p 0x%08lx)\n",
+ TRACE("(%p %p %d %p 0x%08x)\n",
lpNotify->hwndFrom, lpNotify->hwndTo, uCode, lpHdr,
lpNotify->dwParam5);
NOTIFYDATA notify;
HWND hwndNotify;
- TRACE("(%p %p %d %p 0x%08lx)\n",
+ TRACE("(%p %p %d %p 0x%08x)\n",
hwndFrom, hwndTo, uCode, lpHdr, dwParam5);
hwndNotify = hwndTo;
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
+LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
+LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
+LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- TRACE("%p,%lx,%p\n", hinstDLL, fdwReason, lpvReserved);
+ TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
if (lpInitCtrls->dwSize != sizeof(INITCOMMONCONTROLSEX))
return FALSE;
- TRACE("(0x%08lx)\n", lpInitCtrls->dwICC);
+ TRACE("(0x%08x)\n", lpInitCtrls->dwICC);
for (cCount = 0; cCount < 32; cCount++) {
dwMask = 1 << cCount;
break;
default:
- FIXME("Unknown class! dwICC=0x%lX\n", dwMask);
+ FIXME("Unknown class! dwICC=0x%X\n", dwMask);
break;
}
}
pdvi->dwBuildNumber = 2919;
pdvi->dwPlatformID = 6304;
- TRACE("%lu.%lu.%lu.%lu\n",
+ TRACE("%u.%u.%u.%u\n",
pdvi->dwMajorVersion, pdvi->dwMinorVersion,
pdvi->dwBuildNumber, pdvi->dwPlatformID);
{
HWND hwndToolTip;
- hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, 0,
+ hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, hwndOwner,
0, 0, 0);
static const WCHAR fld_mon[] = { 'S', 'e', 'p', 't', 'e', 'm', 'b', 'e', 'r', 0 };
static const WCHAR fld_mon3[] = { 'D', 'e', 'c', 0 };
int spec;
- WCHAR buffer[80], *bufptr;
+ WCHAR buffer[80];
+ LPCWSTR bufptr;
SIZE size;
TRACE ("%d,%d\n", infoPtr->nrFields, count);
case TWODIGITMINUTE:
case TWODIGITMONTH:
case TWODIGITYEAR:
- bufptr = (WCHAR *)fld_d2W;
+ bufptr = fld_d2W;
break;
case INVALIDFULLYEAR:
case FULLYEAR:
- bufptr = (WCHAR *)fld_d4W;
+ bufptr = fld_d4W;
break;
case THREECHARDAY:
- bufptr = (WCHAR *)fld_day3;
+ bufptr = fld_day3;
break;
case FULLDAY:
- bufptr = (WCHAR *)fld_day;
+ bufptr = fld_day;
break;
case THREECHARMONTH:
- bufptr = (WCHAR *)fld_mon3;
+ bufptr = fld_mon3;
break;
case FULLMONTH:
- bufptr = (WCHAR *)fld_mon;
+ bufptr = fld_mon;
break;
case ONELETTERAMPM:
- bufptr = (WCHAR *)fld_am1;
+ bufptr = fld_am1;
break;
case TWOLETTERAMPM:
- bufptr = (WCHAR *)fld_am2;
+ bufptr = fld_am2;
break;
default:
- bufptr = (WCHAR *)fld_d1W;
+ bufptr = fld_d1W;
break;
}
}
{
int i;
- TRACE ("%ld, %ld\n", pt.x, pt.y);
+ TRACE ("%d, %d\n", pt.x, pt.y);
if (PtInRect (&infoPtr->calbutton, pt)) return DTHT_MCPOPUP;
if (PtInRect (&infoPtr->checkbox, pt)) return DTHT_CHECKBOX;
infoPtr->rcClient.bottom = height;
infoPtr->rcClient.right = width;
- TRACE("Height=%ld, Width=%ld\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
+ TRACE("Height=%d, Width=%d\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
infoPtr->rcDraw = infoPtr->rcClient;
{
static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 };
- TRACE("(styletype=%x, styleOld=0x%08lx, styleNew=0x%08lx)\n",
+ TRACE("(styletype=%x, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0;
if (errCode != S_OK)
return errCode;
- FIXME ("dwSize=%lu dwData2=%lu dwItems=%lu\n",
+ FIXME ("dwSize=%u dwData2=%u dwItems=%u\n",
streamData.dwSize, streamData.dwData2, streamData.dwItems);
if ( ulRead < sizeof(STREAMDATA) ||
/* store the handle to the dpa */
*phDpa = hDpa;
- FIXME ("new hDpa=%p, errorcode=%lx\n", hDpa, errCode);
+ FIXME ("new hDpa=%p, errorcode=%x\n", hDpa, errCode);
return errCode;
}
INT nResult, i;
INT nIndex;
- TRACE("%p %p %08lx %p %p %08lx)\n",
+ TRACE("%p %p %08x %p %p %08lx)\n",
hdpa1, hdpa2, dwFlags, pfnCompare, pfnMerge, lParam);
if (IsBadWritePtr (hdpa1, sizeof(*hdpa1)))
INT nIndex;
DWORD dwScrollTime;
- TRACE("(%p %ld x %ld %s)\n",
+ TRACE("(%p %d x %d %s)\n",
hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE");
ScreenToClient (hwndLB, &pt);
* TODO:
* - Imagelist support (completed?)
* - Hottrack support (completed?)
- * - Custom draw support (completed?)
* - Filters support (HDS_FILTER, HDI_FILTER, HDM_*FILTER*, HDN_*FILTER*)
* - New Windows Vista features
*/
static BOOL HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask);
static void HEADER_FreeCallbackItems(HEADER_ITEM *lpItem);
+static LRESULT HEADER_SendNotify(HWND hwnd, UINT code, NMHDR *hdr);
+static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT *rect);
static const WCHAR themeClass[] = {'H','e','a','d','e','r',0};
static WCHAR emptyString[] = {0};
static INT
-HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
+HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *phdi = &infoPtr->items[iItem];
RECT r;
- INT oldBkMode, cxEdge = GetSystemMetrics(SM_CXEDGE);
+ INT oldBkMode;
HTHEME theme = GetWindowTheme (hwnd);
NMCUSTOMDRAW nmcd;
TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, (infoPtr->nNotifyFormat == NFR_UNICODE));
- if (!infoPtr->bRectsValid)
- HEADER_SetItemBounds(hwnd);
-
r = phdi->rect;
if (r.right - r.left == 0)
return phdi->rect.right;
+ /* Set the colors before sending NM_CUSTOMDRAW so that it can change them */
+ SetTextColor(hdc, (bHotTrack && !theme) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
+ SetBkColor(hdc, GetSysColor(COLOR_3DFACE));
+
+ if (lCDFlags & CDRF_NOTIFYITEMDRAW && !(phdi->fmt & HDF_OWNERDRAW))
+ {
+ LRESULT lCDItemFlags;
+
+ nmcd.dwDrawStage = CDDS_PREPAINT | CDDS_ITEM;
+ nmcd.hdc = hdc;
+ nmcd.dwItemSpec = iItem;
+ nmcd.rc = r;
+ nmcd.uItemState = phdi->bDown ? CDIS_SELECTED : 0;
+ nmcd.lItemlParam = phdi->lParam;
+
+ lCDItemFlags = HEADER_SendNotify(hwnd, NM_CUSTOMDRAW, (NMHDR *)&nmcd);
+ if (lCDItemFlags & CDRF_SKIPDEFAULT)
+ return phdi->rect.right;
+ }
+
if (theme != NULL) {
int state = (phdi->bDown) ? HIS_PRESSED :
(bHotTrack ? HIS_HOT : HIS_NORMAL);
&r, &r);
}
else {
+ HBRUSH hbr;
+
if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) {
if (phdi->bDown) {
DrawEdge (hdc, &r, BDR_RAISEDOUTER,
}
else
DrawEdge (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
+
+ hbr = CreateSolidBrush(GetBkColor(hdc));
+ FillRect(hdc, &r, hbr);
+ DeleteObject(hbr);
}
if (phdi->bDown) {
r.left += 2;
r.top += 2;
}
- r.left -= cxEdge;
- r.right += cxEdge;
-
- /* Set the colors before sending NM_CUSTOMDRAW so that it can change them */
- SetTextColor (hdc, (bHotTrack && !theme) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
- SetBkColor(hdc, GetSysColor(COLOR_3DFACE));
-
- nmcd.hdr.hwndFrom = hwnd;
- nmcd.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
- nmcd.hdr.code = NM_CUSTOMDRAW;
- nmcd.dwDrawStage = CDDS_PREPAINT | CDDS_ITEM | CDDS_ITEMPOSTERASE;
- nmcd.hdc = hdc;
- nmcd.dwItemSpec = iItem;
- nmcd.rc = r;
- nmcd.uItemState = phdi->bDown ? CDIS_SELECTED : 0;
- nmcd.lItemlParam = phdi->lParam;
-
- SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd);
-
if (phdi->fmt & HDF_OWNERDRAW) {
DRAWITEMSTRUCT dis;
dis.itemState = phdi->bDown ? ODS_SELECTED : 0;
dis.hwndItem = hwnd;
dis.hDC = hdc;
- dis.rcItem = r;
+ dis.rcItem = phdi->rect;
dis.itemData = phdi->lParam;
oldBkMode = SetBkMode(hdc, TRANSPARENT);
SendMessageW (infoPtr->hwndNotify, WM_DRAWITEM,
rw = r.right - r.left;
rh = r.bottom - r.top;
- if (theme == NULL) {
- HBRUSH hbr = CreateSolidBrush(GetBkColor(hdc));
- RECT rcBackground = r;
-
- rcBackground.right -= cxEdge;
- rcBackground.left += cxEdge;
- FillRect(hdc, &rcBackground, hbr);
- DeleteObject(hbr);
- }
if (phdi->fmt & HDF_STRING) {
RECT textRect;
+ SetRectEmpty(&textRect);
DrawTextW (hdc, phdi->pszText, -1,
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
cw = textRect.right - textRect.left + 2 * infoPtr->iMargin;
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HFONT hFont, hOldFont;
- RECT rect;
+ RECT rect, rcRest;
HBRUSH hbrBk;
UINT i;
INT x;
+ LRESULT lCDFlags;
HTHEME theme = GetWindowTheme (hwnd);
if (!infoPtr->bRectsValid)
/* get rect for the bar, adjusted for the border */
GetClientRect (hwnd, &rect);
+ lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hdc, &rect);
if (infoPtr->bDragging)
ImageList_DragShowNolock(FALSE);
for (i = 0; x <= rect.right && i < infoPtr->uNumItem; i++) {
int idx = HEADER_OrderToIndex(hwnd,i);
if (RectVisible(hdc, &infoPtr->items[idx].rect))
- HEADER_DrawItem (hwnd, hdc, idx, infoPtr->iHotItem == i);
+ HEADER_DrawItem(hwnd, hdc, idx, infoPtr->iHotItem == idx, lCDFlags);
x = infoPtr->items[idx].rect.right;
}
- if ((x <= rect.right) && (infoPtr->uNumItem > 0)) {
- rect.left = x;
+ rcRest = rect;
+ rcRest.left = x;
+ if ((x <= rect.right) && RectVisible(hdc, &rcRest) && (infoPtr->uNumItem > 0)) {
if (theme != NULL) {
- DrawThemeBackground (theme, hdc, HP_HEADERITEM, HIS_NORMAL, &rect,
- NULL);
+ DrawThemeBackground(theme, hdc, HP_HEADERITEM, HIS_NORMAL, &rcRest, NULL);
}
else {
if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS)
- DrawEdge (hdc, &rect, EDGE_RAISED, BF_TOP|BF_LEFT|BF_BOTTOM|BF_SOFT|BF_MIDDLE);
+ DrawEdge (hdc, &rcRest, EDGE_RAISED, BF_TOP|BF_LEFT|BF_BOTTOM|BF_SOFT|BF_MIDDLE);
else
- DrawEdge (hdc, &rect, EDGE_ETCHED, BF_BOTTOM|BF_MIDDLE);
+ DrawEdge (hdc, &rcRest, EDGE_ETCHED, BF_BOTTOM|BF_MIDDLE);
}
}
if (infoPtr->bDragging)
ImageList_DragShowNolock(TRUE);
SelectObject (hdc, hOldFont);
+
+ if (lCDFlags & CDRF_NOTIFYPOSTPAINT)
+ HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hdc, &rect);
}
HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
- HFONT hFont, hOldFont;
- hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT);
- hOldFont = SelectObject (hdc, hFont);
- HEADER_DrawItem (hwnd, hdc, iItem, infoPtr->iHotItem == iItem);
- SelectObject (hdc, hOldFont);
+ if (!infoPtr->bRectsValid)
+ HEADER_SetItemBounds(hwnd);
+
+ InvalidateRect(hwnd, &infoPtr->items[iItem].rect, FALSE);
}
return code;
}
+static LRESULT
+HEADER_SendNotify(HWND hwnd, UINT code, NMHDR *nmhdr)
+{
+ HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
+
+ nmhdr->hwndFrom = hwnd;
+ nmhdr->idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
+ nmhdr->code = code;
+
+ return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
+ (WPARAM)nmhdr->idFrom, (LPARAM)nmhdr);
+}
+
static BOOL
HEADER_SendSimpleNotify (HWND hwnd, UINT code)
{
- HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
NMHDR nmhdr;
+ return (BOOL)HEADER_SendNotify(hwnd, code, &nmhdr);
+}
- nmhdr.hwndFrom = hwnd;
- nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
- nmhdr.code = code;
-
- return (BOOL)SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
- (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
+static LRESULT
+HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT *rect)
+{
+ NMCUSTOMDRAW nm;
+ nm.dwDrawStage = dwDrawStage;
+ nm.hdc = hdc;
+ nm.rc = *rect;
+ nm.dwItemSpec = 0;
+ nm.uItemState = 0;
+ nm.lItemlParam = 0;
+
+ return HEADER_SendNotify(hwnd, NM_CUSTOMDRAW, (NMHDR *)&nm);
}
static BOOL
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
NMHEADERW nmhdr;
- nmhdr.hdr.hwndFrom = hwnd;
- nmhdr.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
- nmhdr.hdr.code = (infoPtr->nNotifyFormat == NFR_UNICODE ? code : HEADER_NotifyCodeWtoA(code));
+ if (infoPtr->nNotifyFormat != NFR_UNICODE)
+ code = HEADER_NotifyCodeWtoA(code);
nmhdr.iItem = iItem;
nmhdr.iButton = 0;
nmhdr.pitem = lpItem;
- return (BOOL)SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
- (WPARAM)nmhdr.hdr.idFrom, (LPARAM)&nmhdr);
+ return (BOOL)HEADER_SendNotify(hwnd, code, (NMHDR *)&nmhdr);
}
static BOOL
HEADER_ITEM *lpItem;
HIMAGELIST himl;
HBITMAP hMemory, hOldBitmap;
+ LRESULT lCDFlags;
+ RECT rc;
HDC hMemoryDC;
HDC hDeviceDC;
int height, width;
if (wParam < 0 || wParam >= infoPtr->uNumItem)
return FALSE;
+
+ if (!infoPtr->bRectsValid)
+ HEADER_SetItemBounds(hwnd);
+
lpItem = &infoPtr->items[wParam];
width = lpItem->rect.right - lpItem->rect.left;
height = lpItem->rect.bottom - lpItem->rect.top;
ReleaseDC(NULL, hDeviceDC);
hOldBitmap = SelectObject(hMemoryDC, hMemory);
SetViewportOrgEx(hMemoryDC, -lpItem->rect.left, -lpItem->rect.top, NULL);
- HEADER_DrawItem(hwnd, hMemoryDC, wParam, FALSE);
+
+ GetClientRect(hwnd, &rc);
+ lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hMemoryDC, &rc);
+ HEADER_DrawItem(hwnd, hMemoryDC, wParam, FALSE, lCDFlags);
+ if (lCDFlags & CDRF_NOTIFYPOSTPAINT)
+ HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hMemoryDC, &rc);
+
hMemory = SelectObject(hMemoryDC, hOldBitmap);
DeleteDC(hMemoryDC);
UINT flags;
INT nItem;
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if ((GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) && (flags == HHT_ONHEADER))
INT nItem;
HDC hdc;
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if ((dwStyle & HDS_BUTTONS) && (flags == HHT_ONHEADER)) {
BOOL bRet;
POINT pt;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
/* Send a Notify message */
bRet = HEADER_SendSimpleNotify (hwnd, NM_RCLICK);
if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED)
return 0;
- TRACE("() Key: %ld\n", key);
+ TRACE("() Key: %d\n", key);
wOldHotKey = infoPtr->HotKey;
bOldMod = infoPtr->CurrMod;
if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED)
return 0;
- TRACE("() Key: %ld\n", key);
+ TRACE("() Key: %d\n", key);
bOldMod = infoPtr->CurrMod;
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTE
- *
+ *
* This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 12, 2002, by Dimitrie O. Paun.
- *
+ *
* Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
- *
+ *
* TODO:
* - Add support for ILD_PRESERVEALPHA, ILD_SCALE, ILD_DPISCALE
* - Add support for ILS_GLOW, ILS_SHADOW, ILS_SATURATE, ILS_ALPHA
static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0 };
-static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT width, UINT height);
+static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT height);
static inline BOOL is_valid(HIMAGELIST himl)
{
return himl && himl->magic == IMAGELIST_MAGIC;
}
+/*
+ * An imagelist with N images is tiled like this:
+ *
+ * N/4 ->
+ *
+ * 4 048C..
+ * 159D..
+ * | 26AE.N
+ * V 37BF.
+ */
+
+#define TILE_COUNT 4
+
+static inline UINT imagelist_width( UINT count )
+{
+ return ((count + TILE_COUNT - 1)/TILE_COUNT);
+}
+
+static inline void imagelist_point_from_index( HIMAGELIST himl, UINT index, LPPOINT pt )
+{
+ pt->x = (index/TILE_COUNT) * himl->cx;
+ pt->y = (index%TILE_COUNT) * himl->cy;
+}
+
+static inline void imagelist_get_bitmap_size( HIMAGELIST himl, UINT count, UINT cy, SIZE *sz )
+{
+ sz->cx = imagelist_width( count ) * himl->cx;
+ sz->cy = cy*TILE_COUNT;
+}
+
+/*
+ * imagelist_copy_images()
+ *
+ * Copies a block of count images from offset src in the list to offset dest.
+ * Images are copied a row at at time. Assumes hdcSrc and hdcDest are different.
+ */
+static inline void imagelist_copy_images( HIMAGELIST himl, HDC hdcSrc, HDC hdcDest,
+ UINT src, UINT count, UINT dest )
+{
+ POINT ptSrc, ptDest;
+ SIZE sz;
+ UINT i;
+
+ for ( i=0; i<TILE_COUNT; i++ )
+ {
+ imagelist_point_from_index( himl, src+i, &ptSrc );
+ imagelist_point_from_index( himl, dest+i, &ptDest );
+ sz.cx = himl->cx * imagelist_width( count - i );
+ sz.cy = himl->cy;
+
+ BitBlt( hdcDest, ptDest.x, ptDest.y, sz.cx, sz.cy,
+ hdcSrc, ptSrc.x, ptSrc.y, SRCCOPY );
+ }
+}
/*************************************************************************
* IMAGELIST_InternalExpandBitmaps [Internal]
{
HDC hdcBitmap;
HBITMAP hbmNewBitmap, hbmNull;
- INT nNewWidth, nNewCount;
+ INT nNewCount;
+ SIZE sz;
if ((himl->cCurImage + nImageCount <= himl->cMaxImage)
&& (himl->cy >= cy))
if (cy == 0) cy = himl->cy;
nNewCount = himl->cCurImage + nImageCount + himl->cGrow;
- nNewWidth = nNewCount * himl->cx;
- TRACE("Create expanded bitmaps : himl=%p x=%d y=%d count=%d\n", himl, nNewWidth, cy, nNewCount);
+ imagelist_get_bitmap_size(himl, nNewCount, cy, &sz);
+
+ TRACE("Create expanded bitmaps : himl=%p x=%d y=%d count=%d\n", himl, sz.cx, cy, nNewCount);
hdcBitmap = CreateCompatibleDC (0);
- hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewWidth, cy);
+ hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, cy);
if (hbmNewBitmap == 0)
- ERR("creating new image bitmap (x=%d y=%d)!\n", nNewWidth, cy);
+ ERR("creating new image bitmap (x=%d y=%d)!\n", sz.cx, cy);
- if(himl->cCurImage)
+ if (himl->cCurImage)
{
hbmNull = SelectObject (hdcBitmap, hbmNewBitmap);
- BitBlt (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, cy,
+ BitBlt (hdcBitmap, 0, 0, sz.cx, sz.cy,
himl->hdcImage, 0, 0, SRCCOPY);
SelectObject (hdcBitmap, hbmNull);
}
if (himl->flags & ILC_MASK)
{
- hbmNewBitmap = CreateBitmap (nNewWidth, cy, 1, 1, NULL);
+ hbmNewBitmap = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
if (hbmNewBitmap == 0)
ERR("creating new mask bitmap!\n");
if(himl->cCurImage)
{
hbmNull = SelectObject (hdcBitmap, hbmNewBitmap);
- BitBlt (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, cy,
+ BitBlt (hdcBitmap, 0, 0, sz.cx, sz.cy,
himl->hdcMask, 0, 0, SRCCOPY);
SelectObject (hdcBitmap, hbmNull);
}
INT WINAPI
ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
{
- HDC hdcBitmap;
- INT nFirstIndex, nImageCount;
- INT nStartX;
+ HDC hdcBitmap, hdcTemp;
+ INT nFirstIndex, nImageCount, i;
BITMAP bmp;
- HBITMAP hOldBitmap;
+ HBITMAP hOldBitmap, hOldBitmapTemp;
+ POINT pt;
TRACE("himl=%p hbmimage=%p hbmmask=%p\n", himl, hbmImage, hbmMask);
if (!is_valid(himl))
return -1;
- GetObjectA (hbmImage, sizeof(BITMAP), (LPVOID)&bmp);
+ if (!GetObjectW(hbmImage, sizeof(BITMAP), (LPVOID)&bmp))
+ return -1;
+
nImageCount = bmp.bmWidth / himl->cx;
IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmWidth, bmp.bmHeight);
- nStartX = himl->cCurImage * himl->cx;
-
hdcBitmap = CreateCompatibleDC(0);
hOldBitmap = SelectObject(hdcBitmap, hbmImage);
- /* Copy result to the imagelist
- */
- BitBlt (himl->hdcImage, nStartX, 0, bmp.bmWidth, bmp.bmHeight,
- hdcBitmap, 0, 0, SRCCOPY);
-
- if(himl->hbmMask)
+ for (i=0; i<nImageCount; i++)
{
- HDC hdcTemp;
- HBITMAP hOldBitmapTemp;
+ imagelist_point_from_index( himl, himl->cCurImage + i, &pt );
+
+ /* Copy result to the imagelist
+ */
+ BitBlt( himl->hdcImage, pt.x, pt.y, himl->cx, bmp.bmHeight,
+ hdcBitmap, i*himl->cx, 0, SRCCOPY );
+
+ if (!himl->hbmMask)
+ continue;
hdcTemp = CreateCompatibleDC(0);
hOldBitmapTemp = SelectObject(hdcTemp, hbmMask);
- BitBlt (himl->hdcMask,
- nStartX, 0, bmp.bmWidth, bmp.bmHeight,
- hdcTemp,
- 0, 0,
- SRCCOPY);
+ BitBlt( himl->hdcMask, pt.x, pt.y, himl->cx, bmp.bmHeight,
+ hdcTemp, i*himl->cx, 0, SRCCOPY );
SelectObject(hdcTemp, hOldBitmapTemp);
DeleteDC(hdcTemp);
/* Remove the background from the image
*/
- BitBlt (himl->hdcImage,
- nStartX, 0, bmp.bmWidth, bmp.bmHeight,
- himl->hdcMask,
- nStartX, 0,
- 0x220326); /* NOTSRCAND */
+ BitBlt( himl->hdcImage, pt.x, pt.y, himl->cx, bmp.bmHeight,
+ himl->hdcMask, pt.x, pt.y, 0x220326 ); /* NOTSRCAND */
}
SelectObject(hdcBitmap, hOldBitmap);
ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
{
HDC hdcMask, hdcBitmap;
- INT nIndex, nImageCount, nMaskXOffset=0;
+ INT i, nIndex, nImageCount;
BITMAP bmp;
HBITMAP hOldBitmap;
HBITMAP hMaskBitmap=0;
COLORREF bkColor;
+ POINT pt;
- TRACE("himl=%p hbitmap=%p clrmask=%lx\n", himl, hBitmap, clrMask);
+ TRACE("himl=%p hbitmap=%p clrmask=%x\n", himl, hBitmap, clrMask);
if (!is_valid(himl))
return -1;
- if (!GetObjectA (hBitmap, sizeof(BITMAP), &bmp))
+ if (!GetObjectW(hBitmap, sizeof(BITMAP), &bmp))
return -1;
if (himl->cx > 0)
himl->cCurImage += nImageCount;
hdcBitmap = CreateCompatibleDC(0);
+ hOldBitmap = SelectObject(hdcBitmap, hBitmap);
+ /* Create a temp Mask so we can remove the background of the Image */
+ hdcMask = CreateCompatibleDC(0);
+ hMaskBitmap = CreateBitmap(bmp.bmWidth, bmp.bmHeight, 1, 1, NULL);
+ SelectObject(hdcMask, hMaskBitmap);
- hOldBitmap = SelectObject(hdcBitmap, hBitmap);
- if(himl->hbmMask)
- {
- hdcMask = himl->hdcMask;
- nMaskXOffset = nIndex * himl->cx;
- }
- else
- {
- /*
- Create a temp Mask so we can remove the background of
- the Image (Windows does this even if there is no mask)
- */
- hdcMask = CreateCompatibleDC(0);
- hMaskBitmap = CreateBitmap(bmp.bmWidth, bmp.bmHeight, 1, 1, NULL);
- SelectObject(hdcMask, hMaskBitmap);
- nMaskXOffset = 0;
- }
/* create monochrome image to the mask bitmap */
- bkColor = (clrMask != CLR_DEFAULT) ? clrMask :
- GetPixel (hdcBitmap, 0, 0);
+ bkColor = (clrMask != CLR_DEFAULT) ? clrMask : GetPixel (hdcBitmap, 0, 0);
SetBkColor (hdcBitmap, bkColor);
- BitBlt (hdcMask,
- nMaskXOffset, 0, bmp.bmWidth, bmp.bmHeight,
- hdcBitmap, 0, 0,
- SRCCOPY);
+ BitBlt (hdcMask, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY);
SetBkColor(hdcBitmap, RGB(255,255,255));
- /*Remove the background from the image
- */
+
/*
- WINDOWS BUG ALERT!!!!!!
- The statement below should not be done in common practice
- but this is how ImageList_AddMasked works in Windows.
- It overwrites the original bitmap passed, this was discovered
- by using the same bitmap to iterate the different styles
- on windows where it failed (BUT ImageList_Add is OK)
- This is here in case some apps rely on this bug
- */
- BitBlt(hdcBitmap,
- 0, 0, bmp.bmWidth, bmp.bmHeight,
- hdcMask,
- nMaskXOffset, 0,
- 0x220326); /* NOTSRCAND */
- /* Copy result to the imagelist
- */
- BitBlt (himl->hdcImage,
- nIndex * himl->cx, 0, bmp.bmWidth, bmp.bmHeight,
- hdcBitmap,
- 0, 0,
- SRCCOPY);
- /* Clean up
- */
- SelectObject(hdcBitmap, hOldBitmap);
- DeleteDC(hdcBitmap);
- if(!himl->hbmMask)
+ * Remove the background from the image
+ *
+ * WINDOWS BUG ALERT!!!!!!
+ * The statement below should not be done in common practice
+ * but this is how ImageList_AddMasked works in Windows.
+ * It overwrites the original bitmap passed, this was discovered
+ * by using the same bitmap to iterate the different styles
+ * on windows where it failed (BUT ImageList_Add is OK)
+ * This is here in case some apps rely on this bug
+ *
+ * Blt mode 0x220326 is NOTSRCAND
+ */
+ BitBlt(hdcBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcMask, 0, 0, 0x220326);
+
+ /* Copy result to the imagelist */
+ for (i=0; i<nImageCount; i++)
{
- DeleteObject(hMaskBitmap);
- DeleteDC(hdcMask);
+ imagelist_point_from_index( himl, nIndex + i, &pt );
+ BitBlt(himl->hdcImage, pt.x, pt.y, himl->cx, bmp.bmHeight,
+ hdcBitmap, i*himl->cx, 0, SRCCOPY);
+ BitBlt(himl->hdcMask, pt.x, pt.y, himl->cx, bmp.bmHeight,
+ hdcMask, i*himl->cx, 0, SRCCOPY);
}
+ /* Clean up */
+ SelectObject(hdcBitmap, hOldBitmap);
+ DeleteDC(hdcBitmap);
+ DeleteObject(hMaskBitmap);
+ DeleteDC(hdcMask);
+
return nIndex;
}
ImageList_Copy (HIMAGELIST himlDst, INT iDst, HIMAGELIST himlSrc,
INT iSrc, UINT uFlags)
{
+ POINT ptSrc, ptDst;
+
TRACE("himlDst=%p iDst=%d himlSrc=%p iSrc=%d\n", himlDst, iDst, himlSrc, iSrc);
if (!is_valid(himlSrc) || !is_valid(himlDst))
if ((iSrc < 0) || (iSrc >= himlSrc->cCurImage))
return FALSE;
+ imagelist_point_from_index( himlDst, iDst, &ptDst );
+ imagelist_point_from_index( himlSrc, iSrc, &ptSrc );
+
if (uFlags & ILCF_SWAP) {
/* swap */
HDC hdcBmp;
HBITMAP hbmTempImage, hbmTempMask;
hdcBmp = CreateCompatibleDC (0);
-
+
/* create temporary bitmaps */
hbmTempImage = CreateBitmap (himlSrc->cx, himlSrc->cy, 1,
himlSrc->uBitsPixel, NULL);
/* image */
SelectObject (hdcBmp, hbmTempImage);
StretchBlt (hdcBmp, 0, 0, himlSrc->cx, himlSrc->cy,
- himlDst->hdcImage, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
+ himlDst->hdcImage, ptDst.x, ptDst.y, himlDst->cx, himlDst->cy,
SRCCOPY);
/* mask */
SelectObject (hdcBmp, hbmTempMask);
StretchBlt (hdcBmp, 0, 0, himlSrc->cx, himlSrc->cy,
- himlDst->hdcMask, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
+ himlDst->hdcMask, ptDst.x, ptDst.y, himlDst->cx, himlDst->cy,
SRCCOPY);
/* copy (and stretch) source to destination */
/* image */
- StretchBlt (himlDst->hdcImage, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
- himlSrc->hdcImage, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
+ StretchBlt (himlDst->hdcImage, ptDst.x, ptDst.y, himlDst->cx, himlDst->cy,
+ himlSrc->hdcImage, ptSrc.x, ptSrc.y, himlSrc->cx, himlSrc->cy,
SRCCOPY);
/* mask */
- StretchBlt (himlDst->hdcMask, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
- himlSrc->hdcMask, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
+ StretchBlt (himlDst->hdcMask, ptDst.x, ptDst.y, himlDst->cx, himlDst->cy,
+ himlSrc->hdcMask, ptSrc.x, ptSrc.y, himlSrc->cx, himlSrc->cy,
SRCCOPY);
/* copy (without stretching) temporary bitmaps to source (restore) */
/* mask */
- BitBlt (himlSrc->hdcMask, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
+ BitBlt (himlSrc->hdcMask, ptSrc.x, ptSrc.y, himlSrc->cx, himlSrc->cy,
hdcBmp, 0, 0, SRCCOPY);
/* image */
- BitBlt (himlSrc->hdcImage, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
+ BitBlt (himlSrc->hdcImage, ptSrc.x, ptSrc.y, himlSrc->cx, himlSrc->cy,
hdcBmp, 0, 0, SRCCOPY);
/* delete temporary bitmaps */
DeleteObject (hbmTempMask);
}
else {
/* copy image */
- StretchBlt (himlDst->hdcImage, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
- himlSrc->hdcImage, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
+ StretchBlt (himlDst->hdcImage, ptDst.x, ptDst.y, himlDst->cx, himlDst->cy,
+ himlSrc->hdcImage, ptSrc.x, ptSrc.y, himlSrc->cx, himlSrc->cy,
SRCCOPY);
/* copy mask */
- StretchBlt (himlDst->hdcMask, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
- himlSrc->hdcMask, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
+ StretchBlt (himlDst->hdcMask, ptDst.x, ptDst.y, himlDst->cx, himlDst->cy,
+ himlSrc->hdcMask, ptSrc.x, ptSrc.y, himlSrc->cx, himlSrc->cy,
SRCCOPY);
}
himl->uBitsPixel = (UINT)GetDeviceCaps (himl->hdcImage, BITSPIXEL);
if (himl->cMaxImage > 0) {
- himl->hbmImage = ImageList_CreateImage(himl->hdcImage, himl, cx * himl->cMaxImage, cy);
+ himl->hbmImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, cy);
SelectObject(himl->hdcImage, himl->hbmImage);
} else
himl->hbmImage = 0;
if ((himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
- himl->hbmMask =
- CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
- 1, 1, NULL);
+ SIZE sz;
+
+ imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
+ himl->hbmMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
if (himl->hbmMask == 0) {
ERR("Error creating mask bitmap!\n");
goto cleanup;
BOOL WINAPI
ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
{
- INT cx, cy, lx, ly, nOvlIdx;
+ INT cx, cy, nOvlIdx;
DWORD fState, dwRop;
UINT fStyle;
COLORREF oldImageBk, oldImageFg;
HBITMAP hImageBmp, hOldImageBmp, hBlendMaskBmp;
BOOL bIsTransparent, bBlend, bResult = FALSE, bMask;
HIMAGELIST himl;
+ POINT pt;
if (!pimldp || !(himl = pimldp->himl)) return FALSE;
if (!is_valid(himl)) return FALSE;
if ((pimldp->i < 0) || (pimldp->i >= himl->cCurImage)) return FALSE;
- lx = himl->cx * pimldp->i + pimldp->xBitmap;
- ly = pimldp->yBitmap;
+ imagelist_point_from_index( himl, pimldp->i, &pt );
+ pt.x += pimldp->xBitmap;
+ pt.y += pimldp->yBitmap;
fState = pimldp->cbSize < sizeof(IMAGELISTDRAWPARAMS) ? ILS_NORMAL : pimldp->fState;
fStyle = pimldp->fStyle & ~ILD_OVERLAYMASK;
HBRUSH hOldBrush;
hOldBrush = SelectObject (hImageDC, CreateSolidBrush (GetTextColor(pimldp->hdcDst)));
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
- BitBlt(hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCPAINT);
+ BitBlt(hImageDC, 0, 0, cx, cy, hMaskListDC, pt.x, pt.y, SRCPAINT);
DeleteObject (SelectObject (hImageDC, hOldBrush));
if( bIsTransparent )
{
hOldBrush = SelectObject (hImageDC, CreateSolidBrush (colour));
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
- BitBlt( hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCAND );
- BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCPAINT );
+ BitBlt( hImageDC, 0, 0, cx, cy, hMaskListDC, pt.x, pt.y, SRCAND );
+ BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, pt.x, pt.y, SRCPAINT );
DeleteObject (SelectObject (hImageDC, hOldBrush));
}
-
+
/* Time for blending, if required */
if (bBlend) {
HBRUSH hBlendBrush, hOldBrush;
/* Modify the blend mask if an Image Mask exist */
if(himl->hbmMask) {
- BitBlt(hBlendMaskDC, 0, 0, cx, cy, hMaskListDC, lx, ly, 0x220326); /* NOTSRCAND */
+ BitBlt(hBlendMaskDC, 0, 0, cx, cy, hMaskListDC, pt.x, pt.y, 0x220326); /* NOTSRCAND */
BitBlt(hBlendMaskDC, 0, 0, cx, cy, hBlendMaskDC, 0, 0, NOTSRCCOPY);
}
-
+
/* now apply blend to the current image given the BlendMask */
if (clrBlend == CLR_DEFAULT) clrBlend = GetSysColor (COLOR_HIGHLIGHT);
else if (clrBlend == CLR_NONE) clrBlend = GetTextColor (pimldp->hdcDst);
DeleteObject(SelectObject(hImageDC, hOldBrush));
SelectObject(hBlendMaskDC, hOldBitmap);
}
-
- /* Now do the overlay image, if any */
+
+ /* Now do the overlay image, if any */
nOvlIdx = (pimldp->fStyle & ILD_OVERLAYMASK) >> 8;
if ( (nOvlIdx >= 1) && (nOvlIdx <= MAX_OVERLAYIMAGE)) {
- nOvlIdx = himl->nOvlIdx[nOvlIdx - 1];
- if ((nOvlIdx >= 0) && (nOvlIdx < himl->cCurImage)) {
- const INT ox = himl->cx * nOvlIdx + pimldp->xBitmap;
+ nOvlIdx = himl->nOvlIdx[nOvlIdx - 1];
+ if ((nOvlIdx >= 0) && (nOvlIdx < himl->cCurImage)) {
+ POINT ptOvl;
+ imagelist_point_from_index( himl, nOvlIdx, &ptOvl );
+ ptOvl.x += pimldp->xBitmap;
if (himl->hbmMask && !(fStyle & ILD_IMAGE))
- BitBlt (hImageDC, 0, 0, cx, cy, hMaskListDC, ox, ly, SRCAND);
- BitBlt (hImageDC, 0, 0, cx, cy, hImageListDC, ox, ly, SRCPAINT);
+ BitBlt (hImageDC, 0, 0, cx, cy, hMaskListDC, ptOvl.x, ptOvl.y, SRCAND);
+ BitBlt (hImageDC, 0, 0, cx, cy, hImageListDC, ptOvl.x, ptOvl.y, SRCPAINT);
}
}
if (fStyle & ILD_PRESERVEALPHA) FIXME("ILD_PRESERVEALPHA: unimplemented!\n");
if (fStyle & ILD_SCALE) FIXME("ILD_SCALE: unimplemented!\n");
if (fStyle & ILD_DPISCALE) FIXME("ILD_DPISCALE: unimplemented!\n");
-
+
/* now copy the image to the screen */
dwRop = SRCCOPY;
if (himl->hbmMask && bIsTransparent ) {
COLORREF oldDstFg = SetTextColor(pimldp->hdcDst, RGB( 0, 0, 0 ) );
COLORREF oldDstBk = SetBkColor(pimldp->hdcDst, RGB( 0xff, 0xff, 0xff ));
- BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hMaskListDC, lx, ly, SRCAND);
+ BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hMaskListDC, pt.x, pt.y, SRCAND);
SetBkColor(pimldp->hdcDst, oldDstBk);
SetTextColor(pimldp->hdcDst, oldDstFg);
dwRop = SRCPAINT;
BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, dwRop);
bResult = TRUE;
-end:
+end:
/* cleanup the mess */
SetBkColor(hImageDC, oldImageBk);
SetTextColor(hImageDC, oldImageFg);
if (himlDst)
{
- BitBlt (himlDst->hdcImage, 0, 0, himlSrc->cCurImage * himlSrc->cx, himlSrc->cy,
+ SIZE sz;
+
+ imagelist_get_bitmap_size(himlSrc, himlSrc->cCurImage, himlSrc->cy, &sz);
+ BitBlt (himlDst->hdcImage, 0, 0, sz.cx, sz.cy,
himlSrc->hdcImage, 0, 0, SRCCOPY);
if (himlDst->hbmMask)
- BitBlt (himlDst->hdcMask, 0, 0, himlSrc->cCurImage * himlSrc->cx, himlSrc->cy,
+ BitBlt (himlDst->hdcMask, 0, 0, sz.cx, sz.cy,
himlSrc->hdcMask, 0, 0, SRCCOPY);
himlDst->cCurImage = himlSrc->cCurImage;
HICON hIcon;
HBITMAP hOldDstBitmap;
HDC hdcDst;
+ POINT pt;
TRACE("%p %d %d\n", himl, i, fStyle);
if (!is_valid(himl) || (i < 0) || (i >= himl->cCurImage)) return NULL;
hdcDst = CreateCompatibleDC(0);
+ imagelist_point_from_index( himl, i, &pt );
+
/* draw mask*/
ii.hbmMask = CreateBitmap (himl->cx, himl->cy, 1, 1, NULL);
hOldDstBitmap = SelectObject (hdcDst, ii.hbmMask);
if (himl->hbmMask) {
BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
- himl->hdcMask, i * himl->cx, 0, SRCCOPY);
+ himl->hdcMask, pt.x, pt.y, SRCCOPY);
}
else
PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
/* draw image*/
SelectObject (hdcDst, ii.hbmColor);
BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
- himl->hdcImage, i * himl->cx, 0, SRCCOPY);
+ himl->hdcImage, pt.x, pt.y, SRCCOPY);
/*
* CreateIconIndirect requires us to deselect the bitmaps from
BOOL WINAPI
ImageList_GetImageInfo (HIMAGELIST himl, INT i, IMAGEINFO *pImageInfo)
{
+ POINT pt;
+
if (!is_valid(himl) || (pImageInfo == NULL))
return FALSE;
if ((i < 0) || (i >= himl->cCurImage))
pImageInfo->hbmImage = himl->hbmImage;
pImageInfo->hbmMask = himl->hbmMask;
- pImageInfo->rcImage.top = 0;
- pImageInfo->rcImage.bottom = himl->cy;
- pImageInfo->rcImage.left = i * himl->cx;
- pImageInfo->rcImage.right = (i+1) * himl->cx;
+ imagelist_point_from_index( himl, i, &pt );
+ pImageInfo->rcImage.top = pt.y;
+ pImageInfo->rcImage.bottom = pt.y + himl->cy;
+ pImageInfo->rcImage.left = pt.x;
+ pImageInfo->rcImage.right = pt.x + himl->cx;
return TRUE;
}
BOOL WINAPI
ImageList_GetImageRect (HIMAGELIST himl, INT i, LPRECT lpRect)
{
+ POINT pt;
+
if (!is_valid(himl) || (lpRect == NULL))
return FALSE;
if ((i < 0) || (i >= himl->cCurImage))
return FALSE;
- lpRect->left = i * himl->cx;
- lpRect->top = 0;
- lpRect->right = lpRect->left + himl->cx;
- lpRect->bottom = himl->cy;
+ imagelist_point_from_index( himl, i, &pt );
+ lpRect->left = pt.x;
+ lpRect->top = pt.y;
+ lpRect->right = pt.x + himl->cx;
+ lpRect->bottom = pt.y + himl->cy;
return TRUE;
}
HIMAGELIST himlDst = NULL;
INT cxDst, cyDst;
INT xOff1, yOff1, xOff2, yOff2;
- INT nX1, nX2;
+ POINT pt1, pt2;
TRACE("(himl1=%p i1=%d himl2=%p i2=%d dx=%d dy=%d)\n", himl1, i1, himl2,
i2, dx, dy);
if (himlDst)
{
- nX1 = i1 * himl1->cx;
- nX2 = i2 * himl2->cx;
+ imagelist_point_from_index( himl1, i1, &pt1 );
+ imagelist_point_from_index( himl1, i2, &pt2 );
/* copy image */
BitBlt (himlDst->hdcImage, 0, 0, cxDst, cyDst, himl1->hdcImage, 0, 0, BLACKNESS);
if (i1 >= 0 && i1 < himl1->cCurImage)
- BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, nX1, 0, SRCCOPY);
+ BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, pt1.x, pt1.y, SRCCOPY);
if (i2 >= 0 && i2 < himl2->cCurImage)
{
- BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , nX2, 0, SRCAND);
- BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, nX2, 0, SRCPAINT);
+ BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , pt2.x, pt2.y, SRCAND);
+ BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCPAINT);
}
/* copy mask */
BitBlt (himlDst->hdcMask, 0, 0, cxDst, cyDst, himl1->hdcMask, 0, 0, WHITENESS);
if (i1 >= 0 && i1 < himl1->cCurImage)
- BitBlt (himlDst->hdcMask, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcMask, nX1, 0, SRCCOPY);
+ BitBlt (himlDst->hdcMask, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcMask, pt1.x, pt1.y, SRCCOPY);
if (i2 >= 0 && i2 < himl2->cCurImage)
- BitBlt (himlDst->hdcMask, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask, nX2, 0, SRCAND);
+ BitBlt (himlDst->hdcMask, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask, pt2.x, pt2.y, SRCAND);
himlDst->cCurImage = 1;
}
#endif
/* helper for ImageList_Read, see comments below */
-static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) {
- HDC xdc = 0, hBitmapDC =0;
+static BOOL _read_bitmap(HIMAGELIST himl, HDC hdcIml, LPSTREAM pstm, int ilcFlag)
+{
+ HDC xdc = 0;
BITMAPFILEHEADER bmfh;
BITMAPINFOHEADER bmih;
int bitsperpixel,palspace,longsperline,width,height;
- LPBITMAPINFOHEADER bmihc = NULL;
- int result = 0;
- HBITMAP hbitmap = 0, hDIB = 0;
+ LPBITMAPINFO bmi = NULL;
+ int result = FALSE;
+ HBITMAP hDIB = 0;
LPBYTE bits = NULL;
+ int i, j, nheight, nRows, nCols;
+ POINT pt;
+ int cy = himl->cy;
- if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)) ||
- (bmfh.bfType != (('M'<<8)|'B')) ||
- !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL)) ||
- (bmih.biSize != sizeof(bmih))
- )
+ if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)))
+ return result;
+
+ if (bmfh.bfType != (('M'<<8)|'B'))
+ return result;
+
+ if (!SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL)))
+ return result;
+
+ if ((bmih.biSize != sizeof(bmih)))
return 0;
bitsperpixel = bmih.biPlanes * bmih.biBitCount;
if (bitsperpixel<=8)
- palspace = (1<<bitsperpixel)*sizeof(RGBQUAD);
+ palspace = (1<<bitsperpixel)*sizeof(RGBQUAD);
else
- palspace = 0;
+ palspace = 0;
width = bmih.biWidth;
height = bmih.biHeight;
- bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace);
- if (!bmihc) goto ret1;
- memcpy(bmihc,&bmih,sizeof(bmih));
- longsperline = ((width*bitsperpixel+31)&~0x1f)>>5;
- bmihc->biSizeImage = (longsperline*height)<<2;
+ bmi = Alloc(sizeof(bmih)+palspace);
+ if (!bmi)
+ return result;
+
+ memcpy(bmi, &bmih, sizeof(bmih));
+ longsperline = ((width*bitsperpixel+31)&~0x1f)>>5;
+ bmi->bmiHeader.biSizeImage = (longsperline*height)<<2;
/* read the palette right after the end of the bitmapinfoheader */
- if (palspace)
- if (!SUCCEEDED(IStream_Read ( pstm, bmihc+1, palspace, NULL)))
- goto ret1;
+ if (palspace && !SUCCEEDED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL)))
+ goto error;
xdc = GetDC(0);
-#if 0 /* Magic for NxM -> 1x(N*M) not implemented for DIB Sections */
- if ((bitsperpixel>1) &&
- ((ilcFlag!=ILC_COLORDDB) && (!ilcFlag || may_use_dibsection(xdc)))
- ) {
- hbitmap = CreateDIBSection(xdc,(BITMAPINFO*)bmihc,0,(LPVOID*)&bits,0,0);
- if (!hbitmap)
- goto ret1;
- if (!SUCCEEDED(IStream_Read( pstm, bits, bmihc->biSizeImage, NULL)))
- goto ret1;
- result = 1;
- } else
-#endif
- {
- int i,nwidth,nheight,nRows;
- nwidth = width*(height/cy);
- nheight = cy;
- nRows = (height/cy);
-
- if (bitsperpixel==1)
- hbitmap = CreateBitmap(nwidth,nheight,1,1,NULL);
- else
- hbitmap = CreateCompatibleBitmap(xdc,nwidth,nheight);
-
- hDIB = CreateDIBSection(xdc,(BITMAPINFO*)bmihc,0,(LPVOID*)&bits,0,0);
- if (!hDIB)
- goto ret1;
- if (!SUCCEEDED(IStream_Read( pstm, bits, bmihc->biSizeImage, NULL)))
- goto ret1;
-
- hBitmapDC = CreateCompatibleDC(0);
- SelectObject(hBitmapDC, hbitmap);
-
- /* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */
- /* Do not forget that windows bitmaps are bottom->top */
- TRACE("nRows=%d\n", nRows);
- for (i=0; i < nRows; i++){
- StretchDIBits(hBitmapDC, width*i, 0, width, cy, 0, cy*(nRows-1-i), width, cy, bits,
- (BITMAPINFO*)bmihc, DIB_RGB_COLORS, SRCCOPY);
+ nheight = cy;
+ nRows = height/cy;
+ nCols = width/himl->cx;
+
+ hDIB = CreateDIBSection(xdc, bmi, 0, (LPVOID*) &bits, 0, 0);
+ if (!hDIB)
+ goto error;
+ if (!SUCCEEDED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL)))
+ goto error;
+
+ /* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */
+ /* Do not forget that windows bitmaps are bottom->top */
+ for (i=0; i < nRows; i++) {
+ for (j=0; j < nCols; j++) {
+ imagelist_point_from_index(himl, i*nCols + j, &pt);
+ StretchDIBits(hdcIml, pt.x, pt.y, himl->cx, cy,
+ j*himl->cx, (nRows - 1 - i)*himl->cy, himl->cx, cy, bits,
+ bmi, DIB_RGB_COLORS, SRCCOPY);
}
-
- result = 1;
}
-ret1:
+
+ result = TRUE;
+error:
if (xdc) ReleaseDC(0,xdc);
- if (bmihc) LocalFree((HLOCAL)bmihc);
+ Free(bmi);
if (hDIB) DeleteObject(hDIB);
- if (hBitmapDC) DeleteDC(hBitmapDC);
- if (!result) {
- if (hbitmap) {
- DeleteObject(hbitmap);
- hbitmap = 0;
- }
- }
- return hbitmap;
+ return result;
}
/*************************************************************************
* Failure: NULL
*
* The format is like this:
- * ILHEAD ilheadstruct;
+ * ILHEAD ilheadstruct;
*
* for the color image part:
- * BITMAPFILEHEADER bmfh;
- * BITMAPINFOHEADER bmih;
+ * BITMAPFILEHEADER bmfh;
+ * BITMAPINFOHEADER bmih;
* only if it has a palette:
* RGBQUAD rgbs[nr_of_paletted_colors];
*
HBITMAP hbmColor=0,hbmMask=0;
int i;
+ TRACE("%p\n", pstm);
+
if (!SUCCEEDED(IStream_Read (pstm, &ilHead, sizeof(ILHEAD), NULL)))
- return NULL;
+ return NULL;
if (ilHead.usMagic != (('L' << 8) | 'I'))
return NULL;
if (ilHead.usVersion != 0x101) /* probably version? */
return NULL;
-#if 0
- FIXME(" ilHead.cCurImage = %d\n",ilHead.cCurImage);
- FIXME(" ilHead.cMaxImage = %d\n",ilHead.cMaxImage);
- FIXME(" ilHead.cGrow = %d\n",ilHead.cGrow);
- FIXME(" ilHead.cx = %d\n",ilHead.cx);
- FIXME(" ilHead.cy = %d\n",ilHead.cy);
- FIXME(" ilHead.flags = %x\n",ilHead.flags);
- FIXME(" ilHead.ovls[0] = %d\n",ilHead.ovls[0]);
- FIXME(" ilHead.ovls[1] = %d\n",ilHead.ovls[1]);
- FIXME(" ilHead.ovls[2] = %d\n",ilHead.ovls[2]);
- FIXME(" ilHead.ovls[3] = %d\n",ilHead.ovls[3]);
-#endif
-
- hbmColor = _read_bitmap(pstm,ilHead.flags & ~ILC_MASK,ilHead.cx,ilHead.cy);
- if (!hbmColor) {
+ himl = ImageList_Create(ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
+ if (!himl) {
+ DeleteObject(hbmColor);
+ DeleteObject(hbmMask);
+ return NULL;
+ }
+ if (!_read_bitmap(himl, himl->hdcImage, pstm, ilHead.flags & ~ILC_MASK)) {
WARN("failed to read bitmap from stream\n");
return NULL;
}
if (ilHead.flags & ILC_MASK) {
- hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy);
- if (!hbmMask) {
+ if (!_read_bitmap(himl, himl->hdcMask, pstm, 0)) {
DeleteObject(hbmColor);
return NULL;
}
}
- himl = ImageList_Create (
- ilHead.cx,
- ilHead.cy,
- ilHead.flags,
- 1, /* initial */
- ilHead.cGrow
- );
- if (!himl) {
- DeleteObject(hbmColor);
- DeleteObject(hbmMask);
- return NULL;
- }
SelectObject(himl->hdcImage, hbmColor);
DeleteObject(himl->hbmImage);
himl->hbmImage = hbmColor;
ImageList_SetBkColor(himl,ilHead.bkcolor);
for (i=0;i<4;i++)
- ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1);
+ ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1);
return himl;
}
{
HBITMAP hbmNewImage, hbmNewMask;
HDC hdcBmp;
- INT cxNew, nCount;
+ INT nCount;
+ SIZE sz;
TRACE("(himl=%p i=%d)\n", himl, i);
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1;
- hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage * himl->cx, himl->cy);
+ hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cy);
SelectObject (himl->hdcImage, hbmNewImage);
DeleteObject (himl->hbmImage);
himl->hbmImage = hbmNewImage;
if (himl->hbmMask) {
- hbmNewMask = CreateBitmap (himl->cMaxImage * himl->cx, himl->cy,
- 1, 1, NULL);
+
+ imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
+ hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
SelectObject (himl->hdcMask, hbmNewMask);
DeleteObject (himl->hbmMask);
himl->hbmMask = hbmNewMask;
/* create new bitmap(s) */
nCount = (himl->cCurImage + himl->cGrow - 1);
- cxNew = nCount * himl->cx;
TRACE(" - Number of images: %d / %d (Old/New)\n",
himl->cCurImage, himl->cCurImage - 1);
TRACE(" - Max. number of images: %d / %d (Old/New)\n",
himl->cMaxImage, himl->cCurImage + himl->cGrow - 1);
- hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, cxNew, himl->cy);
+ hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, nCount, himl->cy);
+ imagelist_get_bitmap_size(himl, nCount, himl->cy, &sz );
if (himl->hbmMask)
- hbmNewMask = CreateBitmap (cxNew, himl->cy, 1, 1, NULL);
+ hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
else
hbmNewMask = 0; /* Just to keep compiler happy! */
TRACE("Pre image copy: Copy %d images\n", i);
SelectObject (hdcBmp, hbmNewImage);
- BitBlt (hdcBmp, 0, 0, i * himl->cx, himl->cy,
- himl->hdcImage, 0, 0, SRCCOPY);
+ imagelist_copy_images( himl, himl->hdcImage, hdcBmp, 0, i, 0 );
if (himl->hbmMask) {
SelectObject (hdcBmp, hbmNewMask);
- BitBlt (hdcBmp, 0, 0, i * himl->cx, himl->cy,
- himl->hdcMask, 0, 0, SRCCOPY);
+ imagelist_copy_images( himl, himl->hdcMask, hdcBmp, 0, i, 0 );
}
}
/* copy all images and masks behind the removed image */
if (i < himl->cCurImage - 1) {
TRACE("Post image copy!\n");
+
SelectObject (hdcBmp, hbmNewImage);
- BitBlt (hdcBmp, i * himl->cx, 0, (himl->cCurImage - i - 1) * himl->cx,
- himl->cy, himl->hdcImage, (i + 1) * himl->cx, 0, SRCCOPY);
+ imagelist_copy_images( himl, himl->hdcImage, hdcBmp, i,
+ (himl->cCurImage - i - 1), i + 1 );
if (himl->hbmMask) {
SelectObject (hdcBmp, hbmNewMask);
- BitBlt (hdcBmp, i * himl->cx, 0,
- (himl->cCurImage - i - 1) * himl->cx,
- himl->cy, himl->hdcMask, (i + 1) * himl->cx, 0, SRCCOPY);
+ imagelist_copy_images( himl, himl->hdcMask, hdcBmp, i,
+ (himl->cCurImage - i - 1), i + 1 );
}
}
HDC hdcImage;
BITMAP bmp;
HBITMAP hOldBitmap;
+ POINT pt;
TRACE("%p %d %p %p\n", himl, i, hbmImage, hbmMask);
return FALSE;
}
+ if (!GetObjectW(hbmImage, sizeof(BITMAP), (LPVOID)&bmp))
+ return FALSE;
+
hdcImage = CreateCompatibleDC (0);
- GetObjectA (hbmImage, sizeof(BITMAP), (LPVOID)&bmp);
/* Replace Image */
hOldBitmap = SelectObject (hdcImage, hbmImage);
- StretchBlt (himl->hdcImage, i * himl->cx, 0, himl->cx, himl->cy,
+ imagelist_point_from_index(himl, i, &pt);
+ StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
if (himl->hbmMask)
hdcTemp = CreateCompatibleDC(0);
hOldBitmapTemp = SelectObject(hdcTemp, hbmMask);
- StretchBlt (himl->hdcMask, i * himl->cx, 0, himl->cx, himl->cy,
+ StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
hdcTemp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
SelectObject(hdcTemp, hOldBitmapTemp);
DeleteDC(hdcTemp);
/* Remove the background from the image
*/
- BitBlt (himl->hdcImage,
- i*himl->cx, 0, bmp.bmWidth, bmp.bmHeight,
- himl->hdcMask,
- i*himl->cx, 0,
- 0x220326); /* NOTSRCAND */
+ BitBlt (himl->hdcImage, pt.x, pt.y, bmp.bmWidth, bmp.bmHeight,
+ himl->hdcMask, pt.x, pt.y, 0x220326); /* NOTSRCAND */
}
SelectObject (hdcImage, hOldBitmap);
ICONINFO ii;
BITMAP bmp;
BOOL ret;
+ POINT pt;
TRACE("(%p %d %p)\n", himl, i, hIcon);
SetBkColor (himl->hdcImage, RGB(255,255,255));
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
- StretchBlt (himl->hdcImage, nIndex * himl->cx, 0, himl->cx, himl->cy,
+ imagelist_point_from_index(himl, nIndex, &pt);
+ StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
if (himl->hbmMask) {
SelectObject (hdcImage, ii.hbmMask);
- StretchBlt (himl->hdcMask, nIndex * himl->cx, 0, himl->cx, himl->cy,
+ StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
}
BOOL WINAPI
ImageList_SetFilter (HIMAGELIST himl, INT i, DWORD dwFilter)
{
- FIXME("(%p 0x%x 0x%lx):empty stub!\n", himl, i, dwFilter);
+ FIXME("(%p 0x%x 0x%x):empty stub!\n", himl, i, dwFilter);
return FALSE;
}
DWORD WINAPI
ImageList_SetFlags(HIMAGELIST himl, DWORD flags)
{
- FIXME("(%p %08lx):empty stub\n", himl, flags);
+ FIXME("(%p %08x):empty stub\n", himl, flags);
return 0;
}
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1;
- hbmNew = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage * himl->cx, himl->cy);
+ hbmNew = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cy);
SelectObject (himl->hdcImage, hbmNew);
DeleteObject (himl->hbmImage);
himl->hbmImage = hbmNew;
if (himl->hbmMask) {
- hbmNew = CreateBitmap (himl->cMaxImage * himl->cx, himl->cy,
- 1, 1, NULL);
+ SIZE sz;
+ imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
+ hbmNew = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
SelectObject (himl->hdcMask, hbmNew);
DeleteObject (himl->hbmMask);
himl->hbmMask = hbmNew;
hdcBitmap = CreateCompatibleDC (0);
- hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount * himl->cx, himl->cy);
+ hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, himl->cy);
if (hbmNewBitmap != 0)
{
SelectObject (hdcBitmap, hbmNewBitmap);
+ imagelist_copy_images( himl, himl->hdcImage, hdcBitmap, 0, nCopyCount, 0 );
+
+ /* FIXME: delete 'empty' image space? */
- /* copy images */
- BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
- himl->hdcImage, 0, 0, SRCCOPY);
-#if 0
- /* delete 'empty' image space */
- SetBkColor (hdcBitmap, RGB(255, 255, 255));
- SetTextColor (hdcBitmap, RGB(0, 0, 0));
- PatBlt (hdcBitmap, nCopyCount * himl->cx, 0,
- (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
-#endif
SelectObject (himl->hdcImage, hbmNewBitmap);
DeleteObject (himl->hbmImage);
himl->hbmImage = hbmNewBitmap;
if (himl->hbmMask)
{
- hbmNewBitmap = CreateBitmap (nNewCount * himl->cx, himl->cy,
- 1, 1, NULL);
+ SIZE sz;
+ imagelist_get_bitmap_size( himl, nNewCount, himl->cy, &sz );
+ hbmNewBitmap = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
if (hbmNewBitmap != 0)
{
SelectObject (hdcBitmap, hbmNewBitmap);
+ imagelist_copy_images( himl, himl->hdcMask, hdcBitmap, 0, nCopyCount, 0 );
+
+ /* FIXME: delete 'empty' image space? */
- /* copy images */
- BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
- himl->hdcMask, 0, 0, SRCCOPY);
-#if 0
- /* delete 'empty' image space */
- SetBkColor (hdcBitmap, RGB(255, 255, 255));
- SetTextColor (hdcBitmap, RGB(0, 0, 0));
- PatBlt (hdcBitmap, nCopyCount * himl->cx, 0,
- (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
-#endif
SelectObject (himl->hdcMask, hbmNewBitmap);
DeleteObject (himl->hbmMask);
himl->hbmMask = hbmNewBitmap;
{
LPBITMAPFILEHEADER bmfh;
LPBITMAPINFOHEADER bmih;
- LPBYTE data, lpBits, lpBitsOrg;
+ LPBYTE data = NULL, lpBits = NULL, lpBitsOrg = NULL;
BITMAP bm;
INT bitCount, sizeImage, offBits, totalSize;
INT nwidth, nheight, nsizeImage, icount;
xdc = GetDC(0);
- GetObjectA(hBitmap, sizeof(BITMAP), (LPVOID)&bm);
+ if (!GetObjectW(hBitmap, sizeof(BITMAP), (LPVOID)&bm))
+ goto failed;
/* XXX is this always correct? */
icount = bm.bmWidth / cx;
}
-static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT width, UINT height)
+static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT height)
{
HBITMAP hbmNewBitmap;
UINT ilc = (himl->flags & 0xFE);
+ SIZE sz;
+
+ imagelist_get_bitmap_size( himl, count, height, &sz );
if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR)
{
}
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi->bmiHeader.biWidth = width;
- bmi->bmiHeader.biHeight = height;
+ bmi->bmiHeader.biWidth = sz.cx;
+ bmi->bmiHeader.biHeight = sz.cy;
bmi->bmiHeader.biPlanes = 1;
bmi->bmiHeader.biBitCount = himl->uBitsPixel;
bmi->bmiHeader.biCompression = BI_RGB;
{
TRACE("Creating Bitmap: %d Bits per Pixel\n", himl->uBitsPixel);
- hbmNewBitmap = CreateBitmap (width, height, 1, himl->uBitsPixel, NULL);
+ hbmNewBitmap = CreateBitmap (sz.cx, sz.cy, 1, himl->uBitsPixel, NULL);
}
TRACE("returning %p\n", hbmNewBitmap);
return hbmNewBitmap;
/* Dump the LISTVIEW_INFO structure to the debug channel */
#define LISTVIEW_DUMP(iP) do { \
- TRACE("hwndSelf=%p, clrBk=0x%06lx, clrText=0x%06lx, clrTextBk=0x%06lx, ItemHeight=%d, ItemWidth=%d, Style=0x%08lx\n", \
+ TRACE("hwndSelf=%p, clrBk=0x%06x, clrText=0x%06x, clrTextBk=0x%06x, ItemHeight=%d, ItemWidth=%d, Style=0x%08x\n", \
iP->hwndSelf, iP->clrBk, iP->clrText, iP->clrTextBk, \
iP->nItemHeight, iP->nItemWidth, iP->dwStyle); \
- TRACE("hwndSelf=%p, himlNor=%p, himlSml=%p, himlState=%p, Focused=%d, Hot=%d, exStyle=0x%08lx, Focus=%d\n", \
+ TRACE("hwndSelf=%p, himlNor=%p, himlSml=%p, himlState=%p, Focused=%d, Hot=%d, exStyle=0x%08x, Focus=%d\n", \
iP->hwndSelf, iP->himlNormal, iP->himlSmall, iP->himlState, \
iP->nFocusedItem, iP->nHotItem, iP->dwLvExStyle, iP->bFocus ); \
- TRACE("hwndSelf=%p, ntmH=%d, icSz.cx=%ld, icSz.cy=%ld, icSp.cx=%ld, icSp.cy=%ld, notifyFmt=%d\n", \
+ TRACE("hwndSelf=%p, ntmH=%d, icSz.cx=%d, icSz.cy=%d, icSp.cx=%d, icSp.cy=%d, notifyFmt=%d\n", \
iP->hwndSelf, iP->ntmHeight, iP->iconSize.cx, iP->iconSize.cy, \
iP->iconSpacing.cx, iP->iconSpacing.cy, iP->notifyFormat); \
TRACE("hwndSelf=%p, rcList=%s\n", iP->hwndSelf, wine_dbgstr_rect(&iP->rcList)); \
break;
default:
- WARN("Unknown value: %ld\n", lprc->left);
+ WARN("Unknown value: %d\n", lprc->left);
return FALSE;
}
nColumn = lprc->top;
- TRACE("(nItem=%d, nSubItem=%ld)\n", nItem, lprc->top);
+ TRACE("(nItem=%d, nSubItem=%d)\n", nItem, lprc->top);
/* On WinNT, a subitem of '0' calls LISTVIEW_GetItemRect */
if (lprc->top == 0)
return LISTVIEW_GetItemRect(infoPtr, nItem, lprc);
break;
default:
- ERR("Unknown bounds=%ld\n", lprc->left);
+ ERR("Unknown bounds=%d\n", lprc->left);
return FALSE;
}
*/
static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrBk)
{
- TRACE("(clrBk=%lx)\n", clrBk);
+ TRACE("(clrBk=%x)\n", clrBk);
if(infoPtr->clrBk != clrBk) {
if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
infoPtr->iconSpacing.cx = cx;
infoPtr->iconSpacing.cy = cy;
- TRACE("old=(%d,%d), new=(%d,%d), iconSize=(%ld,%ld), ntmH=%d\n",
+ TRACE("old=(%d,%d), new=(%d,%d), iconSize=(%d,%d), ntmH=%d\n",
LOWORD(oldspacing), HIWORD(oldspacing), cx, cy,
infoPtr->iconSize.cx, infoPtr->iconSize.cy,
infoPtr->ntmHeight);
*/
static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFlags)
{
- TRACE("(nItems=%d, dwFlags=%lx)\n", nItems, dwFlags);
+ TRACE("(nItems=%d, dwFlags=%x)\n", nItems, dwFlags);
if (infoPtr->dwStyle & LVS_OWNERDATA)
{
*/
static BOOL LISTVIEW_SetTextBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrTextBk)
{
- TRACE("(clrTextBk=%lx)\n", clrTextBk);
+ TRACE("(clrTextBk=%x)\n", clrTextBk);
if (infoPtr->clrTextBk != clrTextBk)
{
*/
static BOOL LISTVIEW_SetTextColor (LISTVIEW_INFO *infoPtr, COLORREF clrText)
{
- TRACE("(clrText=%lx)\n", clrText);
+ TRACE("(clrText=%x)\n", clrText);
if (infoPtr->clrText != clrText)
{
INT nItem = -1;
NMLVKEYDOWN nmKeyDown;
- TRACE("(nVirtualKey=%d, lKeyData=%ld)\n", nVirtualKey, lKeyData);
+ TRACE("(nVirtualKey=%d, lKeyData=%d)\n", nVirtualKey, lKeyData);
/* send LVN_KEYDOWN notification */
nmKeyDown.wVKey = nVirtualKey;
lpColumnInfo->rcHeader.right += dx;
if (lpnmh->iItem + 1 < DPA_GetPtrCount(infoPtr->hdpaColumns))
LISTVIEW_ScrollColumns(infoPtr, lpnmh->iItem + 1, dx);
+ else
+ {
+ /* only needs to update the scrolls */
+ infoPtr->nItemWidth += dx;
+ LISTVIEW_UpdateScroll(infoPtr);
+ }
LISTVIEW_UpdateItemSize(infoPtr);
if (uView == LVS_REPORT && is_redrawing(infoPtr))
{
*/
static LRESULT LISTVIEW_PrintClient(LISTVIEW_INFO *infoPtr, HDC hdc, DWORD options)
{
- FIXME("Partial Stub: (hdc=%p options=0x%08lx)\n", hdc, options);
+ FIXME("Partial Stub: (hdc=%p options=0x%08x)\n", hdc, options);
if ((options & PRF_CHECKVISIBLE) && !IsWindowVisible(infoPtr->hwndSelf))
return 0;
UINT uNewView = lpss->styleNew & LVS_TYPEMASK;
UINT uOldView = lpss->styleOld & LVS_TYPEMASK;
- TRACE("(styletype=%x, styleOld=0x%08lx, styleNew=0x%08lx)\n",
+ TRACE("(styletype=%x, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0;
{
if ((infoPtr->iconSize.cx != oldIconSize.cx) || (infoPtr->iconSize.cy != oldIconSize.cy))
{
- TRACE("icon old size=(%ld,%ld), new size=(%ld,%ld)\n",
+ TRACE("icon old size=(%d,%d), new size=(%d,%d)\n",
oldIconSize.cx, oldIconSize.cy, infoPtr->iconSize.cx, infoPtr->iconSize.cy);
LISTVIEW_SetIconSpacing(infoPtr, 0, 0);
}
RECT r2;
TRACE("%d %d %d\n",day, infoPtr->minSel.wDay, infoPtr->maxSel.wDay);
- TRACE("%ld %ld %ld %ld\n", r.left, r.top, r.right, r.bottom);
+ TRACE("%d %d %d %d\n", r.left, r.top, r.right, r.bottom);
oldCol = SetTextColor(hdc, infoPtr->monthbk);
oldBk = SetBkColor(hdc, infoPtr->trailingtxt);
hbr = GetSysColorBrush(COLOR_GRAYTEXT);
strcpyW(buf, todayW);
}
AppendMenuW(hMenu, MF_STRING|MF_ENABLED,1, buf);
- menupoint.x=(INT)LOWORD(lParam);
- menupoint.y=(INT)HIWORD(lParam);
+ menupoint.x=(short)LOWORD(lParam);
+ menupoint.y=(short)HIWORD(lParam);
ClientToScreen(infoPtr->hwndSelf, &menupoint);
if( TrackPopupMenu(hMenu,TPM_RIGHTBUTTON| TPM_NONOTIFY|TPM_RETURNCMD,
menupoint.x, menupoint.y, 0, infoPtr->hwndSelf, NULL))
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
}
- ht.pt.x = (INT)LOWORD(lParam);
- ht.pt.y = (INT)HIWORD(lParam);
+ ht.pt.x = (short)LOWORD(lParam);
+ ht.pt.y = (short)HIWORD(lParam);
hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht);
/* FIXME: these flags should be checked by */
redraw = TRUE;
}
- ht.pt.x = (INT)LOWORD(lParam);
- ht.pt.y = (INT)HIWORD(lParam);
+ ht.pt.x = (short)LOWORD(lParam);
+ ht.pt.y = (short)HIWORD(lParam);
hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht);
infoPtr->status = MC_SEL_LBUTUP;
if(!(infoPtr->status & MC_SEL_LBUTDOWN)) return 0;
- ht.pt.x = LOWORD(lParam);
- ht.pt.y = HIWORD(lParam);
+ ht.pt.x = (short)LOWORD(lParam);
+ ht.pt.y = (short)HIWORD(lParam);
hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht);
static inline COLORREF
PAGER_GetBkColor(PAGER_INFO *infoPtr)
{
- TRACE("[%p] returns %06lx\n", infoPtr->hwndSelf, infoPtr->clrBk);
+ TRACE("[%p] returns %06x\n", infoPtr->hwndSelf, infoPtr->clrBk);
return infoPtr->clrBk;
}
COLORREF clrTemp = infoPtr->clrBk;
infoPtr->clrBk = clrBk;
- TRACE("[%p] %06lx\n", infoPtr->hwndSelf, infoPtr->clrBk);
+ TRACE("[%p] %06x\n", infoPtr->hwndSelf, infoPtr->clrBk);
/* the native control seems to do things this way */
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
lpRect->bottom -= infoPtr->nButtonSize;
}
- TRACE("nPos=%d, nHeigth=%d, window=%s\n",
+ TRACE("nPos=%d, nHeight=%d, window=%s\n",
infoPtr->nPos, infoPtr->nHeight,
wine_dbgstr_rect(&rcWindow));
- TRACE("[%p] client rect set to %ldx%ld at (%ld,%ld) BtnState[%d,%d]\n",
+ TRACE("[%p] client rect set to %dx%d at (%d,%d) BtnState[%d,%d]\n",
infoPtr->hwndSelf, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top,
lpRect->left, lpRect->top,
infoPtr->TLbtnState, infoPtr->BRbtnState);
/* If in one of the buttons the capture and draw buttons */
if (btnrect)
{
- TRACE("[%p] draw btn (%ld,%ld)-(%ld,%ld), Capture %s, style %08lx\n",
+ TRACE("[%p] draw btn (%d,%d)-(%d,%d), Capture %s, style %08x\n",
infoPtr->hwndSelf, btnrect->left, btnrect->top,
btnrect->right, btnrect->bottom,
(infoPtr->bCapture) ? "TRUE" : "FALSE",
else
dir = (infoPtr->dwStyle & PGS_HORZ) ?
PGF_SCROLLRIGHT : PGF_SCROLLDOWN;
- TRACE("[%p] TIMERID1: style=%08lx, dir=%d\n",
+ TRACE("[%p] TIMERID1: style=%08x, dir=%d\n",
infoPtr->hwndSelf, infoPtr->dwStyle, dir);
KillTimer(infoPtr->hwndSelf, TIMERID1);
SetTimer(infoPtr->hwndSelf, TIMERID1, REPEAT_DELAY, 0);
{
DWORD oldStyle = infoPtr->dwStyle;
- TRACE("(styletype=%x, styleOld=0x%08lx, styleNew=0x%08lx)\n",
+ TRACE("(styletype=%x, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0;
* - Wizard 97 header resizing
* - Enforcing of minimal wizard size
* - Messages:
- * o PSM_GETRESULT
* o PSM_INSERTPAGE
* o PSM_RECALCPAGESIZES
* o PSM_SETHEADERSUBTITLE
BOOL hasApply;
BOOL hasFinish;
BOOL useCallback;
- BOOL restartWindows;
- BOOL rebootSystem;
BOOL activeValid;
PropPageInfo* proppage;
HFONT hFont;
int height;
HIMAGELIST hImageList;
BOOL ended;
+ INT result;
} PropSheetInfo;
typedef struct
psInfo->isModeless = dwFlags & PSH_MODELESS;
memcpy(&psInfo->ppshheader,lppsh,dwSize);
- TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%ld\ndwFlags\t\t%08lx\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
+ TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance,
debugstr_a(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
if (psInfo->active_page < 0 || psInfo->active_page >= psInfo->nPages)
psInfo->active_page = 0;
- psInfo->restartWindows = FALSE;
- psInfo->rebootSystem = FALSE;
+ psInfo->result = 0;
psInfo->hImageList = 0;
psInfo->activeValid = FALSE;
psInfo->isModeless = dwFlags & PSH_MODELESS;
memcpy(&psInfo->ppshheader,lppsh,dwSize);
- TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%ld\ndwFlags\t\t%08lx\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
+ TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance, debugstr_w(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
PROPSHEET_UnImplementedFlags(lppsh->dwFlags);
if (psInfo->active_page < 0 || psInfo->active_page >= psInfo->nPages)
psInfo->active_page = 0;
- psInfo->restartWindows = FALSE;
- psInfo->rebootSystem = FALSE;
+ psInfo->result = 0;
psInfo->hImageList = 0;
psInfo->activeValid = FALSE;
* Original tab size.
*/
GetClientRect(hwndTabCtrl, &rcOrigTab);
- TRACE("orig tab %ld %ld %ld %ld\n", rcOrigTab.left, rcOrigTab.top,
+ TRACE("orig tab %d %d %d %d\n", rcOrigTab.left, rcOrigTab.top,
rcOrigTab.right, rcOrigTab.bottom);
/*
rcPage.bottom = psInfo->height;
MapDialogRect(hwndDlg, &rcPage);
- TRACE("biggest page %ld %ld %ld %ld\n", rcPage.left, rcPage.top,
+ TRACE("biggest page %d %d %d %d\n", rcPage.left, rcPage.top,
rcPage.right, rcPage.bottom);
if ( (rcPage.right - rcPage.left) != (rcOrigTab.right - rcOrigTab.left) )
rc.right -= rc.left;
rc.bottom -= rc.top;
- TRACE("setting tab %p, rc (0,0)-(%ld,%ld)\n",
+ TRACE("setting tab %p, rc (0,0)-(%d,%d)\n",
hwndTabCtrl, rc.right, rc.bottom);
SetWindowPos(hwndTabCtrl, 0, 0, 0, rc.right, rc.bottom,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
GetClientRect(hwndTabCtrl, &rc);
- TRACE("tab client rc %ld %ld %ld %ld\n",
+ TRACE("tab client rc %d %d %d %d\n",
rc.left, rc.top, rc.right, rc.bottom);
rc.right += ((padding.x * 2) + tabOffsetX);
/*
* Resize the property sheet.
*/
- TRACE("setting dialog %p, rc (0,0)-(%ld,%ld)\n",
+ TRACE("setting dialog %p, rc (0,0)-(%d,%d)\n",
hwndDlg, rc.right, rc.bottom);
SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
rc.bottom = psInfo->height;
MapDialogRect(hwndDlg, &rc);
- TRACE("Biggest page %ld %ld %ld %ld\n", rc.left, rc.top, rc.right, rc.bottom);
+ TRACE("Biggest page %d %d %d %d\n", rc.left, rc.top, rc.right, rc.bottom);
/* Add space for the buttons row */
GetWindowRect(hwndLine, &lineRect);
AdjustWindowRect(&rc, GetWindowLongW(hwndDlg, GWL_STYLE), FALSE);
/* Resize the property sheet */
- TRACE("setting dialog %p, rc (0,0)-(%ld,%ld)\n",
+ TRACE("setting dialog %p, rc (0,0)-(%d,%d)\n",
hwndDlg, rc.right, rc.bottom);
SetWindowPos(hwndDlg, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
p++;
break;
case 0xffff:
- TRACE("class ordinal 0x%08lx\n",*(DWORD*)p);
+ TRACE("class ordinal 0x%08x\n",*(DWORD*)p);
p += 2;
break;
default:
p++;
break;
case 0xffff:
- TRACE("text ordinal 0x%08lx\n",*(DWORD*)p);
+ TRACE("text ordinal 0x%08x\n",*(DWORD*)p);
p += 2;
break;
default:
if (!temp)
return FALSE;
- TRACE("copying pTemplate %p into temp %p (%ld)\n", pTemplate, temp, resSize);
+ TRACE("copying pTemplate %p into temp %p (%d)\n", pTemplate, temp, resSize);
memcpy(temp, pTemplate, resSize);
pTemplate = temp;
* NOTE: The resizing happens every time the page is selected and
* not only when it's created (some applications depend on it). */
PROPSHEET_GetPageRect(psInfo, hwndDlg, &rc, ppshpage);
- TRACE("setting page %p, rc (%ld,%ld)-(%ld,%ld) w=%ld, h=%ld\n",
+ TRACE("setting page %p, rc (%d,%d)-(%d,%d) w=%d, h=%d\n",
psInfo->proppage[index].hwndPage, rc.left, rc.top, rc.right, rc.bottom,
rc.right - rc.left, rc.bottom - rc.top);
SetWindowPos(psInfo->proppage[index].hwndPage, HWND_TOP,
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
WCHAR szTitle[256];
- TRACE("'%s' (style %08lx)\n", debugstr_w(lpszText), dwStyle);
+ TRACE("'%s' (style %08x)\n", debugstr_w(lpszText), dwStyle);
if (HIWORD(lpszText) == 0) {
if (!LoadStringW(psInfo->ppshheader.hInstance,
LOWORD(lpszText), szTitle, sizeof(szTitle)-sizeof(WCHAR)))
HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
- TRACE("%ld\n", dwFlags);
+ TRACE("%d\n", dwFlags);
EnableWindow(hwndBack, FALSE);
EnableWindow(hwndNext, FALSE);
*/
static LRESULT PROPSHEET_GetResult(HWND hwndDlg)
{
- FIXME("(%p): stub\n", hwndDlg);
- return -1;
+ PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
+ PropSheetInfoStr);
+ return psInfo->result;
}
/******************************************************************************
ret = -1;
}
+ if(ret != -1)
+ ret = psInfo->result;
+
DestroyWindow(hwnd);
return ret;
}
{
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
PropSheetInfoStr);
- int result = TRUE;
-
- if (psInfo->restartWindows)
- result = ID_PSRESTARTWINDOWS;
- /* reboot system takes precedence over restart windows */
- if (psInfo->rebootSystem)
- result = ID_PSREBOOTSYSTEM;
+ /* don't overwrite ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM */
+ if (psInfo->result == 0)
+ psInfo->result = IDOK;
if (psInfo->isModeless)
psInfo->activeValid = FALSE;
if (!psInfo)
return FALSE;
- psInfo->restartWindows = TRUE;
+ /* reboot system takes precedence over restart windows */
+ if (psInfo->result != ID_PSREBOOTSYSTEM)
+ psInfo->result = ID_PSRESTARTWINDOWS;
+
return TRUE;
}
if (!psInfo)
return FALSE;
- psInfo->rebootSystem = TRUE;
+ psInfo->result = ID_PSREBOOTSYSTEM;
+
return TRUE;
}
DWORD orgStyle; /* original style (dwStyle may change) */
SIZE calcSize; /* calculated rebar size */
SIZE oldSize; /* previous calculated rebar size */
- BOOL bUnicode; /* TRUE if this window is W type */
- BOOL NtfUnicode; /* TRUE if parent wants notify in W format */
+ BOOL bUnicode; /* TRUE if parent wants notify in W format */
BOOL DoRedraw; /* TRUE to acutally draw bands */
UINT fStatus; /* Status flags (see below) */
HCURSOR hcurArrow; /* handle to the arrow cursor */
#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0))
+static LRESULT REBAR_NotifyFormat(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam);
+
/* "constant values" retrieved when DLL was initialized */
/* FIXME we do this when the classes are registered. */
TRACE("ID=%u, ", pB->wID);
TRACE("size=%u, child=%p", pB->cbSize, pB->hwndChild);
if (pB->fMask & RBBIM_COLORS)
- TRACE(", clrF=0x%06lx, clrB=0x%06lx", pB->clrFore, pB->clrBack);
+ TRACE(", clrF=0x%06x, clrB=0x%06x", pB->clrFore, pB->clrBack);
TRACE("\n");
TRACE("band info: mask=0x%08x (%s)\n", pB->fMask, REBAR_FmtMask(pB->fMask));
if(! TRACE_ON(rebar) ) return;
- TRACE("hwnd=%p: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n",
+ TRACE("hwnd=%p: color=%08x/%08x, bands=%u, rows=%u, cSize=%d,%d\n",
iP->hwndSelf, iP->clrText, iP->clrBk, iP->uNumBands, iP->uNumRows,
iP->calcSize.cx, iP->calcSize.cy);
- TRACE("hwnd=%p: flags=%08x, dragStart=%ld,%ld, dragNow=%ld,%ld, iGrabbedBand=%d\n",
+ TRACE("hwnd=%p: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, iGrabbedBand=%d\n",
iP->hwndSelf, iP->fStatus, iP->dragStart.x, iP->dragStart.y,
iP->dragNow.x, iP->dragNow.y,
iP->iGrabbedBand);
- TRACE("hwnd=%p: style=%08lx, I'm Unicode=%s, notify in Unicode=%s, redraw=%s\n",
- iP->hwndSelf, iP->dwStyle, (iP->bUnicode)?"TRUE":"FALSE",
- (iP->NtfUnicode)?"TRUE":"FALSE", (iP->DoRedraw)?"TRUE":"FALSE");
+ TRACE("hwnd=%p: style=%08x, notify in Unicode=%s, redraw=%s\n",
+ iP->hwndSelf, iP->dwStyle, (iP->bUnicode)?"TRUE":"FALSE",
+ (iP->DoRedraw)?"TRUE":"FALSE");
for (i = 0; i < iP->uNumBands; i++) {
pB = &iP->bands[i];
TRACE("band # %u:", i);
if (pB->fMask & RBBIM_CHILD)
TRACE(" child=%p", pB->hwndChild);
if (pB->fMask & RBBIM_COLORS)
- TRACE(" clrF=0x%06lx clrB=0x%06lx", pB->clrFore, pB->clrBack);
+ TRACE(" clrF=0x%06x clrB=0x%06x", pB->clrFore, pB->clrBack);
TRACE("\n");
TRACE("band # %u: mask=0x%08x (%s)\n", i, pB->fMask, REBAR_FmtMask(pB->fMask));
if (pB->fMask & RBBIM_STYLE)
if (pB->fMask & RBBIM_TEXT)
TRACE("band # %u: text=%s\n",
i, (pB->lpText) ? debugstr_w(pB->lpText) : "(null)");
- TRACE("band # %u: lcx=%u, ccx=%u, hcx=%u, lcy=%u, ccy=%u, hcy=%u, offChild=%ld,%ld\n",
+ TRACE("band # %u: lcx=%u, ccx=%u, hcx=%u, lcy=%u, ccy=%u, hcy=%u, offChild=%d,%d\n",
i, pB->lcx, pB->ccx, pB->hcx, pB->lcy, pB->ccy, pB->hcy, pB->offChild.cx, pB->offChild.cy);
- TRACE("band # %u: fStatus=%08x, fDraw=%08x, Band=(%ld,%ld)-(%ld,%ld), Grip=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("band # %u: fStatus=%08x, fDraw=%08x, Band=(%d,%d)-(%d,%d), Grip=(%d,%d)-(%d,%d)\n",
i, pB->fStatus, pB->fDraw,
pB->rcBand.left, pB->rcBand.top, pB->rcBand.right, pB->rcBand.bottom,
pB->rcGripper.left, pB->rcGripper.top, pB->rcGripper.right, pB->rcGripper.bottom);
- TRACE("band # %u: Img=(%ld,%ld)-(%ld,%ld), Txt=(%ld,%ld)-(%ld,%ld), Child=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("band # %u: Img=(%d,%d)-(%d,%d), Txt=(%d,%d)-(%d,%d), Child=(%d,%d)-(%d,%d)\n",
i,
pB->rcCapImage.left, pB->rcCapImage.top, pB->rcCapImage.right, pB->rcCapImage.bottom,
pB->rcCapText.left, pB->rcCapText.top, pB->rcCapText.right, pB->rcCapText.bottom,
nmhdr->hwndFrom = infoPtr->hwndSelf;
nmhdr->code = code;
- TRACE("window %p, code=%08x, %s\n", parent, code,
- (infoPtr->NtfUnicode) ? "via Unicode" : "via ANSI");
+ TRACE("window %p, code=%08x, via %s\n", parent, code, (infoPtr->bUnicode)?"Unicode":"ANSI");
- if (infoPtr->NtfUnicode)
- return SendMessageW (parent, WM_NOTIFY, (WPARAM) nmhdr->idFrom,
- (LPARAM)nmhdr);
- else
- return SendMessageA (parent, WM_NOTIFY, (WPARAM) nmhdr->idFrom,
- (LPARAM)nmhdr);
+ return SendMessageW(parent, WM_NOTIFY, (WPARAM)nmhdr->idFrom, (LPARAM)nmhdr);
}
static INT
(lpBand->rcoldBand.right !=lpBand->rcBand.right) ||
(lpBand->rcoldBand.bottom !=lpBand->rcBand.bottom)) {
lpBand->fDraw |= NTF_INVALIDATE;
- TRACE("band %d row=%d: changed to (%ld,%ld)-(%ld,%ld) from (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("band %d row=%d: changed to (%d,%d)-(%d,%d) from (%d,%d)-(%d,%d)\n",
i, lpBand->iRow,
lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom,
lpBand->rcoldBand.right, lpBand->rcoldBand.bottom);
}
else
- TRACE("band %d row=%d: unchanged (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("band %d row=%d: unchanged (%d,%d)-(%d,%d)\n",
i, lpBand->iRow,
lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom);
lpBand->rcBand.bottom = lpBand->rcBand.top + curwidth;
else
lpBand->rcBand.right = lpBand->rcBand.left + curwidth;
- TRACE("Phase 1 band %d, (%ld,%ld)-(%ld,%ld), orig x=%d, xsep=%d\n",
+ TRACE("Phase 1 band %d, (%d,%d)-(%d,%d), orig x=%d, xsep=%d\n",
i, lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom, x, xsep);
x = rcBrb(lpBand);
lpBand->rcBand.bottom = lpBand->rcBand.top + curwidth;
else
lpBand->rcBand.right = lpBand->rcBand.left + curwidth;
- TRACE("Phase 2 band %d, (%ld,%ld)-(%ld,%ld), orig x=%d, xsep=%d\n",
+ TRACE("Phase 2 band %d, (%d,%d)-(%d,%d), orig x=%d, xsep=%d\n",
i, lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom, x, xsep);
x = rcBrb(lpBand);
((oldChild.right-oldChild.left != lpBand->rcChild.right-lpBand->rcChild.left) ||
(oldChild.bottom-oldChild.top != lpBand->rcChild.bottom-lpBand->rcChild.top))) {
TRACE("Child rectangle changed for band %u\n", i);
- TRACE(" from (%ld,%ld)-(%ld,%ld) to (%ld,%ld)-(%ld,%ld)\n",
+ TRACE(" from (%d,%d)-(%d,%d) to (%d,%d)-(%d,%d)\n",
oldChild.left, oldChild.top,
oldChild.right, oldChild.bottom,
lpBand->rcChild.left, lpBand->rcChild.top,
lpBand->rcChild.right, lpBand->rcChild.bottom);
}
if (lpBand->fDraw & NTF_INVALIDATE) {
- TRACE("invalidating (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("invalidating (%d,%d)-(%d,%d)\n",
lpBand->rcBand.left,
lpBand->rcBand.top,
lpBand->rcBand.right + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0),
((oldChild.right-oldChild.left != lpBand->rcChild.right-lpBand->rcChild.left) ||
(oldChild.bottom-oldChild.top != lpBand->rcChild.bottom-lpBand->rcChild.top))) {
TRACE("Child rectangle changed for band %u\n", i);
- TRACE(" from (%ld,%ld)-(%ld,%ld) to (%ld,%ld)-(%ld,%ld)\n",
+ TRACE(" from (%d,%d)-(%d,%d) to (%d,%d)-(%d,%d)\n",
oldChild.left, oldChild.top,
oldChild.right, oldChild.bottom,
lpBand->rcChild.left, lpBand->rcChild.top,
lpBand->rcChild.right, lpBand->rcChild.bottom);
}
if (lpBand->fDraw & NTF_INVALIDATE) {
- TRACE("invalidating (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("invalidating (%d,%d)-(%d,%d)\n",
lpBand->rcBand.left,
lpBand->rcBand.top,
lpBand->rcBand.right + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0),
GetClientRect (infoPtr->hwndSelf, &rc);
- TRACE( " old [%ld x %ld], new [%ld x %ld], client [%ld x %ld]\n",
+ TRACE( " old [%d x %d], new [%d x %d], client [%d x %d]\n",
infoPtr->oldSize.cx, infoPtr->oldSize.cy,
infoPtr->calcSize.cx, infoPtr->calcSize.cy,
rc.right, rc.bottom);
y = infoPtr->origin.y;
}
- TRACE("hwnd %p, style=%08lx, setting at (%d,%d) for (%d,%d)\n",
+ TRACE("hwnd %p, style=%08x, setting at (%d,%d) for (%d,%d)\n",
infoPtr->hwndSelf, infoPtr->dwStyle,
x, y, width, height);
SetWindowPos (infoPtr->hwndSelf, 0, x, y, width, height,
REBAR_Notify ((NMHDR *)&rbcz, infoPtr, RBN_CHILDSIZE);
if (!EqualRect (&lpBand->rcChild, &rbcz.rcChild)) {
TRACE("Child rect changed by NOTIFY for band %u\n", i);
- TRACE(" from (%ld,%ld)-(%ld,%ld) to (%ld,%ld)-(%ld,%ld)\n",
+ TRACE(" from (%d,%d)-(%d,%d) to (%d,%d)-(%d,%d)\n",
lpBand->rcChild.left, lpBand->rcChild.top,
lpBand->rcChild.right, lpBand->rcChild.bottom,
rbcz.rcChild.left, rbcz.rcChild.top,
yPos = (lpBand->rcChild.bottom + lpBand->rcChild.top - nEditHeight)/2;
/* center combo box inside child area */
- TRACE("moving child (Combo(Ex)) %p to (%ld,%d) for (%ld,%d)\n",
+ TRACE("moving child (Combo(Ex)) %p to (%d,%d) for (%d,%d)\n",
lpBand->hwndChild,
lpBand->rcChild.left, yPos,
lpBand->rcChild.right - lpBand->rcChild.left,
ERR("DeferWindowPos returned NULL\n");
}
else {
- TRACE("moving child (Other) %p to (%ld,%ld) for (%ld,%ld)\n",
+ TRACE("moving child (Other) %p to (%d,%d) for (%d,%d)\n",
lpBand->hwndChild,
lpBand->rcChild.left, lpBand->rcChild.top,
lpBand->rcChild.right - lpBand->rcChild.left,
if (!infoPtr->DoRedraw) infoPtr->fStatus |= BAND_NEEDS_REDRAW;
GetClientRect (infoPtr->hwndSelf, &rcClient);
- TRACE("Client is (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("Client is (%d,%d)-(%d,%d)\n",
rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
if (lpRect) {
rcAdj = *lpRect;
- TRACE("adjustment rect is (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("adjustment rect is (%d,%d)-(%d,%d)\n",
rcAdj.left, rcAdj.top, rcAdj.right, rcAdj.bottom);
}
else {
lpBand->uMinHeight = lpBand->lcy;
x = rightx;
}
- TRACE("P1 band %u, row %d, (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("P1 band %u, row %d, (%d,%d)-(%d,%d)\n",
i, row,
lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom);
current->rcBand.bottom = current->rcBand.top + new_rh;
y += adj_rh;
}
- TRACE("P2 moving band %d to own row at (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("P2 moving band %d to own row at (%d,%d)-(%d,%d)\n",
current_idx,
current->rcBand.left, current->rcBand.top,
current->rcBand.right, current->rcBand.bottom);
- TRACE("P2 prev band %d at (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("P2 prev band %d at (%d,%d)-(%d,%d)\n",
prev_idx,
prev->rcBand.left, prev->rcBand.top,
prev->rcBand.right, prev->rcBand.bottom);
lpBand->rcBand.right = lpBand->rcBand.left + j;
else
lpBand->rcBand.bottom = lpBand->rcBand.top + j;
- TRACE("P2b band %d, row %d changed to (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("P2b band %d, row %d changed to (%d,%d)-(%d,%d)\n",
i, lpBand->iRow,
lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom);
else
DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_BOTTOM);
}
- TRACE ("drawing band separator bottom (%ld,%ld)-(%ld,%ld)\n",
+ TRACE ("drawing band separator bottom (%d,%d)-(%d,%d)\n",
rcRowSep.left, rcRowSep.top,
rcRowSep.right, rcRowSep.bottom);
}
else
DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_RIGHT);
}
- TRACE("drawing band separator right (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("drawing band separator right (%d,%d)-(%d,%d)\n",
rcSep.left, rcSep.top, rcSep.right, rcSep.bottom);
}
else
{
old = SetBkColor (hdc, new);
- TRACE("%s background color=0x%06lx, band (%ld,%ld)-(%ld,%ld), clip (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("%s background color=0x%06x, band (%d,%d)-(%d,%d), clip (%d,%d)-(%d,%d)\n",
(lpBand->clrBack == CLR_NONE) ? "none" :
((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""),
GetBkColor(hdc),
LEADJ(band, Leadjust);
READJ(band, Readjust);
- TRACE("band %d: left=%d, right=%d, move=%d, rtn=%d, rcBand=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("band %d: left=%d, right=%d, move=%d, rtn=%d, rcBand=(%d,%d)-(%d,%d)\n",
i, Leadjust, Readjust, movement, ret,
band->rcBand.left, band->rcBand.top,
band->rcBand.right, band->rcBand.bottom);
infoPtr->ihitoffset);
infoPtr->dragNow = *ptsmove;
- TRACE("before: movement=%d (%ld,%ld), imindBand=%d, ihitBand=%d, imaxdBand=%d, LSum=%d, RSum=%d\n",
+ TRACE("before: movement=%d (%d,%d), imindBand=%d, ihitBand=%d, imaxdBand=%d, LSum=%d, RSum=%d\n",
movement, ptsmove->x, ptsmove->y, imindBand, ihitBand,
imaxdBand, LHeaderSum, RHeaderSum);
REBAR_DumpBand (infoPtr);
if (clr == CLR_DEFAULT)
clr = infoPtr->clrBtnFace;
- TRACE("background color 0x%06lx!\n", clr);
+ TRACE("background color 0x%06x!\n", clr);
return clr;
}
lpBand = &infoPtr->bands[iBand];
CopyRect (lprc, &lpBand->rcBand);
- TRACE("band %d, (%ld,%ld)-(%ld,%ld)\n", iBand,
+ TRACE("band %d, (%d,%d)-(%d,%d)\n", iBand,
lprc->left, lprc->top, lprc->right, lprc->bottom);
return TRUE;
inline static LRESULT
REBAR_GetTextColor (REBAR_INFO *infoPtr)
{
- TRACE("text color 0x%06lx!\n", infoPtr->clrText);
+ TRACE("text color 0x%06x!\n", infoPtr->clrText);
return infoPtr->clrText;
}
movement = lpBand->rcBand.right - lpBand->rcBand.left -
lpBand->cxHeader;
if (movement < 0) {
- ERR("something is wrong, band=(%ld,%ld)-(%ld,%ld), cxheader=%d\n",
+ ERR("something is wrong, band=(%d,%d)-(%d,%d), cxheader=%d\n",
lpBand->rcBand.left, lpBand->rcBand.top,
lpBand->rcBand.right, lpBand->rcBand.bottom,
lpBand->cxHeader);
infoPtr->imageSize.cx = 0;
infoPtr->imageSize.cy = 0;
}
- TRACE("new image cx=%ld, cy=%ld\n", infoPtr->imageSize.cx,
+ TRACE("new image cx=%d, cy=%d\n", infoPtr->imageSize.cx,
infoPtr->imageSize.cy);
}
clrTemp = infoPtr->clrBk;
infoPtr->clrBk = (COLORREF)lParam;
- TRACE("background color 0x%06lx!\n", infoPtr->clrBk);
+ TRACE("background color 0x%06x!\n", infoPtr->clrBk);
return clrTemp;
}
clrTemp = infoPtr->clrText;
infoPtr->clrText = (COLORREF)lParam;
- TRACE("text color 0x%06lx!\n", infoPtr->clrText);
+ TRACE("text color 0x%06x!\n", infoPtr->clrText);
return clrTemp;
}
if (lpRect == NULL)
return FALSE;
- TRACE("[%ld %ld %ld %ld]\n",
+ TRACE("[%d %d %d %d]\n",
lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
/* what is going on???? */
GetWindowRect(infoPtr->hwndSelf, &t1);
- TRACE("window rect [%ld %ld %ld %ld]\n",
+ TRACE("window rect [%d %d %d %d]\n",
t1.left, t1.top, t1.right, t1.bottom);
GetClientRect(infoPtr->hwndSelf, &t1);
- TRACE("client rect [%ld %ld %ld %ld]\n",
+ TRACE("client rect [%d %d %d %d]\n",
t1.left, t1.top, t1.right, t1.bottom);
/* force full _Layout processing */
if (TRACE_ON(rebar)) {
GetWindowRect(infoPtr->hwndSelf, &wnrc1);
GetClientRect(infoPtr->hwndSelf, &clrc1);
- TRACE("window=(%ld,%ld)-(%ld,%ld) client=(%ld,%ld)-(%ld,%ld) cs=(%d,%d %dx%d)\n",
+ TRACE("window=(%d,%d)-(%d,%d) client=(%d,%d)-(%d,%d) cs=(%d,%d %dx%d)\n",
wnrc1.left, wnrc1.top, wnrc1.right, wnrc1.bottom,
clrc1.left, clrc1.top, clrc1.right, clrc1.bottom,
cs->x, cs->y, cs->cx, cs->cy);
UINT htFlags;
INT iHitBand;
POINT ptMouseDown;
- ptMouseDown.x = (INT)LOWORD(lParam);
- ptMouseDown.y = (INT)HIWORD(lParam);
+ ptMouseDown.x = (short)LOWORD(lParam);
+ ptMouseDown.y = (short)HIWORD(lParam);
REBAR_InternalHitTest(infoPtr, &ptMouseDown, &htFlags, &iHitBand);
lpBand = &infoPtr->bands[iHitBand];
REBAR_NCCalcSize (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HTHEME theme;
+ RECT *rect = (RECT *)lParam;
+
if (infoPtr->dwStyle & WS_BORDER) {
- InflateRect((LPRECT)lParam, -GetSystemMetrics(SM_CXEDGE),
- -GetSystemMetrics(SM_CYEDGE));
+ rect->left = min(rect->left + GetSystemMetrics(SM_CXEDGE), rect->right);
+ rect->right = max(rect->right - GetSystemMetrics(SM_CXEDGE), rect->left);
+ rect->top = min(rect->top + GetSystemMetrics(SM_CYEDGE), rect->bottom);
+ rect->bottom = max(rect->bottom - GetSystemMetrics(SM_CYEDGE), rect->top);
}
else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
{
- ((LPRECT)lParam)->top++;
+ /* FIXME: should use GetThemeInt */
+ rect->top = min(rect->top + 1, rect->bottom);
}
- TRACE("new client=(%ld,%ld)-(%ld,%ld)\n",
- ((LPRECT)lParam)->left, ((LPRECT)lParam)->top,
- ((LPRECT)lParam)->right, ((LPRECT)lParam)->bottom);
+ TRACE("new client=(%d,%d)-(%d,%d)\n", rect->left, rect->top, rect->right, rect->bottom);
return 0;
}
RECT wnrc1, clrc1;
NONCLIENTMETRICSW ncm;
HFONT tfont;
- INT i;
if (infoPtr != NULL) {
ERR("Strange info structure pointer *not* NULL\n");
if (TRACE_ON(rebar)) {
GetWindowRect(hwnd, &wnrc1);
GetClientRect(hwnd, &clrc1);
- TRACE("window=(%ld,%ld)-(%ld,%ld) client=(%ld,%ld)-(%ld,%ld) cs=(%d,%d %dx%d)\n",
+ TRACE("window=(%d,%d)-(%d,%d) client=(%d,%d)-(%d,%d) cs=(%d,%d %dx%d)\n",
wnrc1.left, wnrc1.top, wnrc1.right, wnrc1.bottom,
clrc1.left, clrc1.top, clrc1.right, clrc1.bottom,
cs->x, cs->y, cs->cx, cs->cy);
infoPtr->hcurHorz = LoadCursorW (0, (LPWSTR)IDC_SIZEWE);
infoPtr->hcurVert = LoadCursorW (0, (LPWSTR)IDC_SIZENS);
infoPtr->hcurDrag = LoadCursorW (0, (LPWSTR)IDC_SIZE);
- infoPtr->bUnicode = IsWindowUnicode (hwnd);
infoPtr->fStatus = CREATE_RUNNING;
infoPtr->hFont = GetStockObject (SYSTEM_FONT);
/* issue WM_NOTIFYFORMAT to get unicode status of parent */
- i = SendMessageW(REBAR_GetNotifyParent (infoPtr),
- WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
- if ((i < NFR_ANSI) || (i > NFR_UNICODE)) {
- ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", i);
- i = NFR_ANSI;
- }
- infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0;
+ REBAR_NotifyFormat(infoPtr, 0, NF_REQUERY);
/* Stow away the original style */
infoPtr->orgStyle = cs->style;
ret, i);
ret = (LRESULT) i;
}
- TRACE("returning %ld, client point (%ld,%ld)\n", ret, clpt.x, clpt.y);
+ TRACE("returning %ld, client point (%d,%d)\n", ret, clpt.x, clpt.y);
return ret;
}
return 0;
GetWindowRect (infoPtr->hwndSelf, &rcWindow);
OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
- TRACE("rect (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("rect (%d,%d)-(%d,%d)\n",
rcWindow.left, rcWindow.top,
rcWindow.right, rcWindow.bottom);
DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_RECT);
return 0;
GetWindowRect (infoPtr->hwndSelf, &rcWindow);
OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
- TRACE("rect (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("rect (%d,%d)-(%d,%d)\n",
rcWindow.left, rcWindow.top,
rcWindow.right, rcWindow.bottom);
DrawThemeEdge (theme, hdc, 0, 0, &rcWindow, BDR_RAISEDINNER, BF_TOP, NULL);
if (lParam == NF_REQUERY) {
i = SendMessageW(REBAR_GetNotifyParent (infoPtr),
WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
- if ((i < NFR_ANSI) || (i > NFR_UNICODE)) {
+ if ((i != NFR_ANSI) && (i != NFR_UNICODE)) {
ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", i);
i = NFR_ANSI;
}
- infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0;
+ infoPtr->bUnicode = (i == NFR_UNICODE) ? 1 : 0;
return (LRESULT)i;
}
return (LRESULT)((infoPtr->bUnicode) ? NFR_UNICODE : NFR_ANSI);
GetClientRect(infoPtr->hwndSelf, &rc);
hdc = wParam==0 ? BeginPaint (infoPtr->hwndSelf, &ps) : (HDC)wParam;
- TRACE("painting (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("painting (%d,%d)-(%d,%d) client (%d,%d)-(%d,%d)\n",
ps.rcPaint.left, ps.rcPaint.top,
ps.rcPaint.right, ps.rcPaint.bottom,
rc.left, rc.top, rc.right, rc.bottom);
TRACE("still in CreateWindow\n");
infoPtr->fStatus &= ~CREATE_RUNNING;
GetWindowRect ( infoPtr->hwndSelf, &rcWin);
- TRACE("win rect (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("win rect (%d,%d)-(%d,%d)\n",
rcWin.left, rcWin.top, rcWin.right, rcWin.bottom);
if ((lParam == 0) && (rcWin.right-rcWin.left == 0) &&
(rcWin.bottom-rcWin.top == 0)) {
/* native control seems to do this */
GetClientRect (GetParent(infoPtr->hwndSelf), &rcClient);
- TRACE("sizing rebar, message and client zero, parent client (%ld,%ld)\n",
+ TRACE("sizing rebar, message and client zero, parent client (%d,%d)\n",
rcClient.right, rcClient.bottom);
}
else {
/* do the actual WM_SIZE request */
GetClientRect (infoPtr->hwndSelf, &rcClient);
- TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%ld,%ld)\n",
+ TRACE("sizing rebar from (%d,%d) to (%d,%d), client (%d,%d)\n",
infoPtr->calcSize.cx, infoPtr->calcSize.cy,
LOWORD(lParam), HIWORD(lParam),
rcClient.right, rcClient.bottom);
rcClient.right = 0;
else
rcClient.bottom = 0;
- TRACE("sizing rebar to parent (%ld,%ld) size is zero but AUTOSIZE set\n",
+ TRACE("sizing rebar to parent (%d,%d) size is zero but AUTOSIZE set\n",
rcClient.right, rcClient.bottom);
}
else {
- TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%ld,%ld)\n",
+ TRACE("sizing rebar from (%d,%d) to (%d,%d), client (%d,%d)\n",
infoPtr->calcSize.cx, infoPtr->calcSize.cy,
LOWORD(lParam), HIWORD(lParam),
rcClient.right, rcClient.bottom);
autosize.fChanged = 0; /* ??? */
autosize.rcActual = autosize.rcTarget; /* ??? */
REBAR_Notify((NMHDR *) &autosize, infoPtr, RBN_AUTOSIZE);
- TRACE("RBN_AUTOSIZE client=(%ld,%ld), lp=%08lx\n",
+ TRACE("RBN_AUTOSIZE client=(%d,%d), lp=%08lx\n",
autosize.rcTarget.right, autosize.rcTarget.bottom, lParam);
}
{
STYLESTRUCT *ss = (STYLESTRUCT *)lParam;
- TRACE("current style=%08lx, styleOld=%08lx, style being set to=%08lx\n",
+ TRACE("current style=%08x, styleOld=%08x, style being set to=%08x\n",
infoPtr->dwStyle, ss->styleOld, ss->styleNew);
infoPtr->orgStyle = infoPtr->dwStyle = ss->styleNew;
if (GetWindowTheme (infoPtr->hwndSelf))
ret = DefWindowProcW(infoPtr->hwndSelf, WM_WINDOWPOSCHANGED,
wParam, lParam);
GetWindowRect(infoPtr->hwndSelf, &rc);
- TRACE("hwnd %p new pos (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("hwnd %p new pos (%d,%d)-(%d,%d)\n",
infoPtr->hwndSelf, rc.left, rc.top, rc.right, rc.bottom);
return ret;
}
case WM_COMMAND:
case WM_DRAWITEM:
case WM_NOTIFY:
- if (infoPtr->NtfUnicode)
- return SendMessageW (REBAR_GetNotifyParent (infoPtr),
- uMsg, wParam, lParam);
- else
- return SendMessageA (REBAR_GetNotifyParent (infoPtr),
- uMsg, wParam, lParam);
+ return SendMessageW(REBAR_GetNotifyParent (infoPtr), uMsg, wParam, lParam);
/* case WM_CHARTOITEM: supported according to ControlSpy */
);
}
- FIXME("(hwnd=%p,flags=%lx,x2=%lx): should smooth scroll here.\n",
+ FIXME("(hwnd=%p,flags=%x,x2=%x): should smooth scroll here.\n",
smooth->hwnd,flags,smooth->x2
);
/* FIXME: do timer based smooth scrolling */
POINT pt;
INT i;
- TRACE("draw size grip %ld,%ld - %ld,%ld\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
+ TRACE("draw size grip %d,%d - %d,%d\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
if (theme)
{
HTHEME theme = GetWindowTheme (infoPtr->Self);
int themePart = SP_PANE;
- TRACE("part bound %ld,%ld - %ld,%ld\n", r.left, r.top, r.right, r.bottom);
+ TRACE("part bound %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom);
if (part->style & SBT_POPOUT)
border = BDR_RAISEDOUTER;
else if (part->style & SBT_NOBORDERS)
/* get our window size */
GetClientRect (infoPtr->Self, &rect);
- TRACE("client wnd size is %ld,%ld - %ld,%ld\n", rect.left, rect.top, rect.right, rect.bottom);
+ TRACE("client wnd size is %d,%d - %d,%d\n", rect.left, rect.top, rect.right, rect.bottom);
rect.left += infoPtr->horizontalBorder;
rect.top += infoPtr->verticalBorder;
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = GetMessageTime ();
- msg.pt.x = LOWORD(GetMessagePos ());
- msg.pt.y = HIWORD(GetMessagePos ());
+ msg.pt.x = (short)LOWORD(GetMessagePos ());
+ msg.pt.y = (short)HIWORD(GetMessagePos ());
return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
}
infoPtr->clrBk = color;
InvalidateRect(infoPtr->Self, NULL, FALSE);
- TRACE("CREF: %08lx -> %08lx\n", oldBkColor, infoPtr->clrBk);
+ TRACE("CREF: %08x -> %08x\n", oldBkColor, infoPtr->clrBk);
return oldBkColor;
}
if (dwStyle & SBT_TOOLTIPS) {
infoPtr->hwndToolTip =
- CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, 0,
+ CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, WS_POPUP | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, hwnd, 0,
(HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);
return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
case WM_NCHITTEST:
- res = STATUSBAR_WMNCHitTest(infoPtr, (INT)LOWORD(lParam),
- (INT)HIWORD(lParam));
+ res = STATUSBAR_WMNCHitTest(infoPtr, (short)LOWORD(lParam),
+ (short)HIWORD(lParam));
if (res != HTERROR) return res;
return DefWindowProcW (hwnd, msg, wParam, lParam);
#include "winuser.h"
#include "winnls.h"
+#include "comctl32.h"
+
#include "wine/unicode.h"
#include "wine/debug.h"
return COMCTL32_ChrCmpHelperW(ch1, ch2, NORM_IGNORECASE);
}
+/**************************************************************************
+ * Str_GetPtrA [COMCTL32.233]
+ *
+ * Copies a string into a destination buffer.
+ *
+ * PARAMS
+ * lpSrc [I] Source string
+ * lpDest [O] Destination buffer
+ * nMaxLen [I] Size of buffer in characters
+ *
+ * RETURNS
+ * The number of characters copied.
+ */
+INT WINAPI Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
+{
+ INT len;
+
+ TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
+
+ if ((!lpDest || nMaxLen == 0) && lpSrc)
+ return (strlen(lpSrc) + 1);
+
+ if (nMaxLen == 0)
+ return 0;
+
+ if (lpSrc == NULL) {
+ lpDest[0] = '\0';
+ return 0;
+ }
+
+ len = strlen(lpSrc) + 1;
+ if (len >= nMaxLen)
+ len = nMaxLen;
+
+ RtlMoveMemory (lpDest, lpSrc, len - 1);
+ lpDest[len - 1] = '\0';
+
+ return len;
+}
+
+/**************************************************************************
+ * Str_SetPtrA [COMCTL32.234]
+ *
+ * Makes a copy of a string, allocating memory if necessary.
+ *
+ * PARAMS
+ * lppDest [O] Pointer to destination string
+ * lpSrc [I] Source string
+ *
+ * RETURNS
+ * Success: TRUE
+ * Failure: FALSE
+ *
+ * NOTES
+ * Set lpSrc to NULL to free the memory allocated by a previous call
+ * to this function.
+ */
+BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
+{
+ TRACE("(%p %p)\n", lppDest, lpSrc);
+
+ if (lpSrc) {
+ LPSTR ptr = ReAlloc (*lppDest, strlen (lpSrc) + 1);
+ if (!ptr)
+ return FALSE;
+ strcpy (ptr, lpSrc);
+ *lppDest = ptr;
+ }
+ else {
+ if (*lppDest) {
+ Free (*lppDest);
+ *lppDest = NULL;
+ }
+ }
+
+ return TRUE;
+}
+
+/**************************************************************************
+ * Str_GetPtrW [COMCTL32.235]
+ *
+ * See Str_GetPtrA.
+ */
+INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
+{
+ INT len;
+
+ TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
+
+ if (!lpDest && lpSrc)
+ return strlenW (lpSrc);
+
+ if (nMaxLen == 0)
+ return 0;
+
+ if (lpSrc == NULL) {
+ lpDest[0] = L'\0';
+ return 0;
+ }
+
+ len = strlenW (lpSrc);
+ if (len >= nMaxLen)
+ len = nMaxLen - 1;
+
+ RtlMoveMemory (lpDest, lpSrc, len*sizeof(WCHAR));
+ lpDest[len] = L'\0';
+
+ return len;
+}
+
+/**************************************************************************
+ * Str_SetPtrW [COMCTL32.236]
+ *
+ * See Str_SetPtrA.
+ */
+BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
+{
+ TRACE("(%p %p)\n", lppDest, lpSrc);
+
+ if (lpSrc) {
+ INT len = strlenW (lpSrc) + 1;
+ LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR));
+ if (!ptr)
+ return FALSE;
+ strcpyW (ptr, lpSrc);
+ *lppDest = ptr;
+ }
+ else {
+ if (*lppDest) {
+ Free (*lppDest);
+ *lppDest = NULL;
+ }
+ }
+
+ return TRUE;
+}
+
/**************************************************************************
* StrChrA [COMCTL32.350]
*
case WM_LBUTTONDOWN:
{
POINT pt;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
return SYSLINK_LButtonDown(infoPtr, wParam, &pt);
}
case WM_LBUTTONUP:
{
POINT pt;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
return SYSLINK_LButtonUp(infoPtr, wParam, &pt);
}
{
POINT pt;
RECT rc;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
GetClientRect(infoPtr->Self, &rc);
ScreenToClient(infoPtr->Self, &pt);
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = GetMessageTime ();
- msg.pt.x = LOWORD(GetMessagePos ());
- msg.pt.y = HIWORD(GetMessagePos ());
+ msg.pt.x = (short)LOWORD(GetMessagePos ());
+ msg.pt.y = (short)HIWORD(GetMessagePos ());
SendMessageW (hwndTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
}
TAB_DumpItemExternalT(TCITEMW *pti, UINT iItem, BOOL isW)
{
if (TRACE_ON(tab)) {
- TRACE("external tab %d, mask=0x%08x, dwState=0x%08lx, dwStateMask=0x%08lx, cchTextMax=0x%08x\n",
+ TRACE("external tab %d, mask=0x%08x, dwState=0x%08x, dwStateMask=0x%08x, cchTextMax=0x%08x\n",
iItem, pti->mask, pti->dwState, pti->dwStateMask, pti->cchTextMax);
TRACE("external tab %d, iImage=%d, lParam=0x%08lx, pszTextW=%s\n",
iItem, pti->iImage, pti->lParam, isW ? debugstr_w(pti->pszText) : debugstr_a((LPSTR)pti->pszText));
TAB_ITEM *ti;
ti = TAB_GetItem(infoPtr, iItem);
- TRACE("tab %d, mask=0x%08x, dwState=0x%08lx, pszText=%s, iImage=%d\n",
+ TRACE("tab %d, mask=0x%08x, dwState=0x%08x, pszText=%s, iImage=%d\n",
iItem, ti->mask, ti->dwState, debugstr_w(ti->pszText),
ti->iImage);
- TRACE("tab %d, rect.left=%ld, rect.top(row)=%ld\n",
+ TRACE("tab %d, rect.left=%d, rect.top(row)=%d\n",
iItem, ti->rect.left, ti->rect.top);
}
}
SELECTED_TAB_OFFSET,
0);
}
- TRACE("item %d tab h=%d, rect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("item %d tab h=%d, rect=(%d,%d)-(%d,%d)\n",
itemIndex, infoPtr->tabHeight,
itemRect->left, itemRect->top, itemRect->right, itemRect->bottom);
*/
if (isVisible)
{
- TRACE("invalidate (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("invalidate (%d,%d)-(%d,%d)\n",
selectedRect.left,selectedRect.top,
selectedRect.right,selectedRect.bottom);
InvalidateRect(infoPtr->hwnd, &selectedRect, TRUE);
POINT pt;
UINT dummyflag;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
ScreenToClient(infoPtr->hwnd, &pt);
if (TAB_InternalHitTest(infoPtr, pt, &dummyflag) == -1)
TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,
WM_LBUTTONDOWN, wParam, lParam);
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
newItem = TAB_InternalHitTest (infoPtr, pt, &dummy);
}
else
{
- pt.x = LOWORD(*pos);
- pt.y = HIWORD(*pos);
+ pt.x = (short)LOWORD(*pos);
+ pt.y = (short)HIWORD(*pos);
}
item = TAB_InternalHitTest(infoPtr, pt, &flags);
DWORD lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
LONG *iRightBottom, *iLeftTop;
- TRACE ("hwnd=%p fLarger=%d (%ld,%ld)-(%ld,%ld)\n", infoPtr->hwnd, fLarger, prc->left, prc->top, prc->right, prc->bottom);
+ TRACE ("hwnd=%p fLarger=%d (%d,%d)-(%d,%d)\n", infoPtr->hwnd, fLarger, prc->left, prc->top, prc->right, prc->bottom);
if(lStyle & TCS_VERTICAL)
{
((lStyle & TCS_BUTTONS) ? 2 : 1) *
infoPtr->uVItemPadding;
- TRACE("tabH=%d, tmH=%ld, iconh=%d\n",
+ TRACE("tabH=%d, tmH=%d, iconh=%d\n",
infoPtr->tabHeight, fontMetrics.tmHeight, icon_height);
}
- TRACE("client right=%ld\n", clientRect.right);
+ TRACE("client right=%d\n", clientRect.right);
/* Get the icon width */
if (infoPtr->himl)
tabwidth = max(tabwidth, infoPtr->tabMinWidth);
curr->rect.right = curr->rect.left + tabwidth;
- TRACE("for <%s>, l,r=%ld,%ld\n",
+ TRACE("for <%s>, l,r=%d,%d\n",
debugstr_w(curr->pszText), curr->rect.left, curr->rect.right);
}
curr->rect.left = 0;
curItemRowCount++;
- TRACE("wrapping <%s>, l,r=%ld,%ld\n", debugstr_w(curr->pszText),
+ TRACE("wrapping <%s>, l,r=%d,%d\n", debugstr_w(curr->pszText),
curr->rect.left, curr->rect.right);
}
curr->rect.bottom = 0;
curr->rect.top = curItemRowCount - 1;
- TRACE("Rect: T %li, L %li, B %li, R %li\n", curr->rect.top,
+ TRACE("Rect: T %i, L %i, B %i, R %i\n", curr->rect.top,
curr->rect.left, curr->rect.bottom, curr->rect.right);
/*
curr->rect.right -= curr->rect.left;
curr->rect.left = 0;
- TRACE("r=%ld, cl=%d, cl.r=%ld, iCount=%d, iRow=%d, uNumRows=%d, remTab=%d, tabPerRow=%d\n",
+ TRACE("r=%d, cl=%d, cl.r=%d, iCount=%d, iRow=%d, uNumRows=%d, remTab=%d, tabPerRow=%d\n",
curr->rect.right, curItemLeftPos, clientRect.right,
iCount, iRow, infoPtr->uNumRows, remTab, tabPerRow);
else
curItemLeftPos = curr->rect.right;
- TRACE("arranging <%s>, l,r=%ld,%ld, row=%ld\n",
+ TRACE("arranging <%s>, l,r=%d,%d, row=%d\n",
debugstr_w(curr->pszText), curr->rect.left,
curr->rect.right, curr->rect.top);
}
item->rect.left += iCount * widthDiff;
item->rect.right += (iCount + 1) * widthDiff;
- TRACE("adjusting 1 <%s>, l,r=%ld,%ld\n",
+ TRACE("adjusting 1 <%s>, l,r=%d,%d\n",
debugstr_w(item->pszText),
item->rect.left, item->rect.right);
start->rect.left = clientRect.left;
start->rect.right = clientRect.right - 4;
- TRACE("adjusting 2 <%s>, l,r=%ld,%ld\n",
+ TRACE("adjusting 2 <%s>, l,r=%d,%d\n",
debugstr_w(start->pszText),
start->rect.left, start->rect.right);
}
}
}
- TRACE("drawRect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("drawRect=(%d,%d)-(%d,%d)\n",
drawRect->left, drawRect->top, drawRect->right, drawRect->bottom);
/* Clear interior */
if (center_offset_v < 0)
center_offset_v = 0;
- TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%ld,%ld)-(%ld,%ld), textlen=%ld\n",
+ TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%d,%d)-(%d,%d), textlen=%d\n",
debugstr_w(item->pszText), center_offset_h, center_offset_v,
drawRect->left, drawRect->top, drawRect->right, drawRect->bottom,
(rcText.right-rcText.left));
drawRect->left += cx + infoPtr->uHItemPadding;
}
- TRACE("drawing image=%d, left=%ld, top=%ld\n",
+ TRACE("drawing image=%d, left=%d, top=%d\n",
item->iImage, rcImage.left, rcImage.top-1);
ImageList_Draw
(
}
else
{
- TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%ld,%ld)-(%ld,%ld), textlen=%ld\n",
+ TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%d,%d)-(%d,%d), textlen=%d\n",
debugstr_w(item->pszText), center_offset_h, center_offset_v,
drawRect->left, drawRect->top, drawRect->right, drawRect->bottom,
(rcText.right-rcText.left));
/* Adjust both rectangles to match native */
r.left += (1-ZZ);
- TRACE("<right> item=%d, fill=(%ld,%ld)-(%ld,%ld), edge=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("<right> item=%d, fill=(%d,%d)-(%d,%d), edge=(%d,%d)-(%d,%d)\n",
iItem,
fillRect.left,fillRect.top,fillRect.right,fillRect.bottom,
r.left,r.top,r.right,r.bottom);
}
else
{
- TRACE("<left> item=%d, fill=(%ld,%ld)-(%ld,%ld), edge=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("<left> item=%d, fill=(%d,%d)-(%d,%d), edge=(%d,%d)-(%d,%d)\n",
iItem,
fillRect.left,fillRect.top,fillRect.right,fillRect.bottom,
r.left,r.top,r.right,r.bottom);
r.top -= 1;
}
- TRACE("<bottom> item=%d, fill=(%ld,%ld)-(%ld,%ld), edge=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("<bottom> item=%d, fill=(%d,%d)-(%d,%d), edge=(%d,%d)-(%d,%d)\n",
iItem,
fillRect.left,fillRect.top,fillRect.right,fillRect.bottom,
r.left,r.top,r.right,r.bottom);
r.bottom += 2;
}
- TRACE("<top> item=%d, fill=(%ld,%ld)-(%ld,%ld), edge=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("<top> item=%d, fill=(%d,%d)-(%d,%d), edge=(%d,%d)-(%d,%d)\n",
iItem,
fillRect.left,fillRect.top,fillRect.right,fillRect.bottom,
r.left,r.top,r.right,r.bottom);
rect.top += infoPtr->tabHeight * infoPtr->uNumRows + CONTROL_BORDER_SIZEX;
}
- TRACE("border=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("border=(%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
if (theme)
rInvalidate.right = clientRect.right - r.left;
}
- TRACE("invalidate (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("invalidate (%d,%d)-(%d,%d)\n",
rInvalidate.left, rInvalidate.top,
rInvalidate.right, rInvalidate.bottom);
else
{
hdc = BeginPaint (infoPtr->hwnd, &ps);
- TRACE("erase %d, rect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("erase %d, rect=(%d,%d)-(%d,%d)\n",
ps.fErase,
ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right,ps.rcPaint.bottom);
}
RECT rect;
GetClientRect (infoPtr->hwnd, &rect);
- TRACE("Rect: %p T %li, L %li, B %li, R %li\n", infoPtr->hwnd,
+ TRACE("Rect: %p T %i, L %i, B %i, R %i\n", infoPtr->hwnd,
rect.top, rect.left, rect.bottom, rect.right);
pti = (TCITEMW *)lParam;
if (dwStyle & TCS_TOOLTIPS) {
/* Create tooltip control */
infoPtr->hwndToolTip =
- CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, 0,
+ CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hwnd, 0, 0, 0);
{
/* Dropdown button hot-tracking */
COMBOBOXINFO cbi;
- POINT pt = {LOWORD(lParam), HIWORD(lParam)};
-
+ POINT pt;
+
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
cbi.cbSize = sizeof (cbi);
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
{ \
LRESULT result; \
ULONG_PTR refData; \
- SetPropW (wnd, MAKEINTATOMW (atSubclassProp), (HANDLE)N); \
- refData = (ULONG_PTR)GetPropW (wnd, MAKEINTATOMW (atRefDataProp)); \
+ SetPropW (wnd, (LPCWSTR)MAKEINTATOM(atSubclassProp), (HANDLE)N); \
+ refData = (ULONG_PTR)GetPropW (wnd, (LPCWSTR)MAKEINTATOM(atRefDataProp)); \
TRACE ("%d; (%p, %x, %x, %lx, %lx)\n", N, wnd, msg, wParam, lParam, \
refData); \
result = subclasses[N].subclassProc (wnd, msg, wParam, lParam, refData);\
if (!RegisterClassExW (&class))
{
- ERR("Could not re-register class %s: %lx\n",
+ ERR("Could not re-register class %s: %x\n",
debugstr_w (subclasses[i].className), GetLastError ());
}
else
*/
LRESULT THEMING_CallOriginalClass (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- INT_PTR subclass = (INT_PTR)GetPropW (wnd, MAKEINTATOMW (atSubclassProp));
+ INT_PTR subclass = (INT_PTR)GetPropW (wnd, (LPCWSTR)MAKEINTATOM(atSubclassProp));
WNDPROC oldProc = originalProcs[subclass];
return CallWindowProcW (oldProc, wnd, msg, wParam, lParam);
}
*/
void THEMING_SetSubclassData (HWND wnd, ULONG_PTR refData)
{
- SetPropW (wnd, MAKEINTATOMW (atRefDataProp), (HANDLE)refData);
+ SetPropW (wnd, (LPCWSTR)MAKEINTATOM(atRefDataProp), (HANDLE)refData);
}
BYTE fsStyle;
BYTE bHot;
BYTE bDropDownPressed;
- DWORD dwData;
+ DWORD_PTR dwData;
INT_PTR iString;
INT nRow;
RECT rect;
INT nButtonHeight;
INT nButtonWidth;
INT nBitmapHeight;
+ INT nVBitmapHeight; /* see TOOLBAR_Create for an explanation */
INT nBitmapWidth;
INT nIndent;
INT nRows; /* number of button rows */
INT nOldHit;
INT nHotItem; /* index of the "hot" item */
SIZE szPadding; /* padding values around button */
+ INT iTopMargin; /* the top margin */
INT iListGap; /* default gap between text and image for toolbar with list style */
HFONT hDefaultFont;
HFONT hFont; /* text font */
static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIST himl, INT id);
static LRESULT TOOLBAR_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam);
static void TOOLBAR_SetHotItemEx (TOOLBAR_INFO *infoPtr, INT nHit, DWORD dwReason);
+static void TOOLBAR_LayoutToolbar(HWND hwnd);
static LRESULT TOOLBAR_AutoSize(HWND hwnd);
static void TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr);
static void TOOLBAR_TooltipSetRect(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *button);
static LRESULT
TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam);
+inline static int default_top_margin(TOOLBAR_INFO *infoPtr)
+{
+ return (infoPtr->dwStyle & TBSTYLE_FLAT ? 0 : TOP_BORDER);
+}
static LPWSTR
TOOLBAR_GetText(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
TOOLBAR_DumpButton(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *bP, INT btn_num, BOOL internal)
{
if (TRACE_ON(toolbar)){
- TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08x\n",
+ TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08x\n",
btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap),
bP->fsState, bP->fsStyle, bP->dwData, bP->iString);
TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP)));
if (internal)
- TRACE("button %d id %d, hot=%s, row=%d, rect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("button %d id %d, hot=%s, row=%d, rect=(%d,%d)-(%d,%d)\n",
btn_num, bP->idCommand,
(bP->bHot) ? "TRUE":"FALSE", bP->nRow,
bP->rect.left, bP->rect.top,
if (TRACE_ON(toolbar)) {
INT i;
- TRACE("toolbar %p at line %d, exStyle=%08lx, buttons=%d, bitmaps=%d, strings=%d, style=%08lx\n",
+ TRACE("toolbar %p at line %d, exStyle=%08x, buttons=%d, bitmaps=%d, strings=%d, style=%08x\n",
iP->hwndSelf, line,
iP->dwExStyle, iP->nNumButtons, iP->nNumBitmaps,
iP->nNumStrings, iP->dwStyle);
if (nmgd.dwMask & TBNF_DI_SETITEM)
btnPtr->iBitmap = nmgd.iImage;
ret = nmgd.iImage;
- TRACE("TBN_GETDISPINFO returned bitmap id %d, mask=%08lx, nNumBitmaps=%d\n",
+ TRACE("TBN_GETDISPINFO returned bitmap id %d, mask=%08x, nNumBitmaps=%d\n",
ret, nmgd.dwMask, infoPtr->nNumBitmaps);
}
InflateRect (&myrect, -2, 0);
- TRACE("rect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("rect=(%d,%d)-(%d,%d)\n",
myrect.left, myrect.top, myrect.right, myrect.bottom);
newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
/* draw text */
if (lpText) {
- TRACE("string=%s rect=(%ld,%ld)-(%ld,%ld)\n", debugstr_w(lpText),
+ TRACE("string=%s rect=(%d,%d)-(%d,%d)\n", debugstr_w(lpText),
rcText->left, rcText->top, rcText->right, rcText->bottom);
hOldFont = SelectObject (hdc, infoPtr->hFont);
rcBitmap.left += GetSystemMetrics(SM_CXEDGE) + infoPtr->iListGap / 2;
}
else
- rcBitmap.left += (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2;
+ rcBitmap.left += ((rc.right - rc.left) - infoPtr->nBitmapWidth) / 2;
rcBitmap.top += infoPtr->szPadding.cy / 2;
- TRACE("iBitmap=%d, start=(%ld,%ld) w=%d, h=%d\n",
+ TRACE("iBitmap=%d, start=(%d,%d) w=%d, h=%d\n",
btnPtr->iBitmap, rcBitmap.left, rcBitmap.top,
infoPtr->nBitmapWidth, infoPtr->nBitmapHeight);
TRACE("Text=%s\n", debugstr_w(lpText));
- TRACE("iListGap=%d, padding = { %ld, %ld }\n", infoPtr->iListGap, infoPtr->szPadding.cx, infoPtr->szPadding.cy);
+ TRACE("iListGap=%d, padding = { %d, %d }\n", infoPtr->iListGap, infoPtr->szPadding.cx, infoPtr->szPadding.cy);
/* calculate text position */
if (lpText)
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
{
BOOL bDraw;
+ if (!RectVisible(hdc, &btnPtr->rect))
+ continue;
if (infoPtr->dwExStyle & TBSTYLE_EX_HIDECLIPPEDBUTTONS)
{
IntersectRect(&rcTemp, &rcClient, &btnPtr->rect);
}
}
- TRACE("string size %ld x %ld!\n", lpSize->cx, lpSize->cy);
+ TRACE("string size %d x %d!\n", lpSize->cx, lpSize->cy);
}
/***********************************************************************
hdc = GetDC (hwnd);
hOldFont = SelectObject (hdc, infoPtr->hFont);
- if (infoPtr->nNumButtons == 0)
+ if (infoPtr->nNumButtons == 0 && infoPtr->nNumStrings > 0)
{
TEXTMETRICW tm;
SelectObject (hdc, hOldFont);
ReleaseDC (hwnd, hdc);
- TRACE("max string size %ld x %ld!\n", lpSize->cx, lpSize->cy);
+ TRACE("max string size %d x %d!\n", lpSize->cx, lpSize->cy);
}
/***********************************************************************
if (infoPtr->dwStyle & TBSTYLE_LIST)
{
/* set button height from bitmap / text height... */
- sizeButton.cy = max((bHasBitmap ? infoPtr->nBitmapHeight : 0),
+ sizeButton.cy = max((bHasBitmap ? infoPtr->nVBitmapHeight : 0),
sizeString.cy);
/* ... add on the necessary padding */
{
if (bHasBitmap)
{
- sizeButton.cy = infoPtr->nBitmapHeight + 1 +
- sizeString.cy + DEFPAD_CY;
+ sizeButton.cy = infoPtr->nVBitmapHeight + DEFPAD_CY;
+ if (sizeString.cy > 0)
+ sizeButton.cy += 1 + sizeString.cy;
sizeButton.cx = infoPtr->szPadding.cx +
max(sizeString.cx, infoPtr->nBitmapWidth);
}
TOOLBAR_CalcToolbar (HWND hwnd)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
- DWORD dwStyle = infoPtr->dwStyle;
- TBUTTON_INFO *btnPtr;
- INT i, nRows, nSepRows;
- INT x, y, cx, cy;
SIZE sizeString, sizeButton;
- BOOL bWrap;
BOOL validImageList = FALSE;
- BOOL hasDropDownArrows = TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle);
TOOLBAR_CalcStrings (hwnd, &sizeString);
sizeButton = TOOLBAR_MeasureButton(infoPtr, sizeString, TRUE, validImageList);
infoPtr->nButtonWidth = sizeButton.cx;
infoPtr->nButtonHeight = sizeButton.cy;
+ infoPtr->iTopMargin = default_top_margin(infoPtr);
if ( infoPtr->cxMin >= 0 && infoPtr->nButtonWidth < infoPtr->cxMin )
infoPtr->nButtonWidth = infoPtr->cxMin;
if ( infoPtr->cxMax > 0 && infoPtr->nButtonWidth > infoPtr->cxMax )
infoPtr->nButtonWidth = infoPtr->cxMax;
- TOOLBAR_WrapToolbar( hwnd, dwStyle );
+ TOOLBAR_LayoutToolbar(hwnd);
+}
- x = infoPtr->nIndent;
- if (infoPtr->dwStyle & TBSTYLE_FLAT)
- y = 0;
- else
- y = TOP_BORDER;
+static void
+TOOLBAR_LayoutToolbar(HWND hwnd)
+{
+ TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
+ TBUTTON_INFO *btnPtr;
+ SIZE sizeButton;
+ INT i, nRows, nSepRows;
+ INT x, y, cx, cy;
+ BOOL bWrap;
+ BOOL validImageList = TOOLBAR_IsValidImageList(infoPtr, 0);
+ BOOL hasDropDownArrows = TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle);
+
+ TOOLBAR_WrapToolbar(hwnd, infoPtr->dwStyle);
- /* from above, minimum is a button, and possible text */
+ x = infoPtr->nIndent;
+ y = infoPtr->iTopMargin;
cx = infoPtr->nButtonWidth;
cy = infoPtr->nButtonHeight;
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = GetMessageTime ();
- msg.pt.x = LOWORD(GetMessagePos ());
- msg.pt.y = HIWORD(GetMessagePos ());
+ msg.pt.x = (short)LOWORD(GetMessagePos ());
+ msg.pt.y = (short)HIWORD(GetMessagePos ());
SendMessageW (hwndTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
}
int i;
NMTOOLTIPSCREATED nmttc;
- infoPtr->hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, 0,
+ infoPtr->hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
infoPtr->hwndSelf, 0, 0, 0);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBBUTTON lpTbb = (LPTBBUTTON)lParam;
INT nOldButtons, nNewButtons, nAddButtons, nCount;
+ BOOL fHasString = FALSE;
TRACE("adding %d buttons (unicode=%d)!\n", wParam, fUnicode);
Str_SetPtrW ((LPWSTR*)&btnPtr->iString, (LPWSTR)lpTbb[nCount].iString );
else
Str_SetPtrAtoW((LPWSTR*)&btnPtr->iString, (LPSTR)lpTbb[nCount].iString);
+ fHasString = TRUE;
}
else
btnPtr->iString = lpTbb[nCount].iString;
TOOLBAR_TooltipAddTool(infoPtr, btnPtr);
}
- TOOLBAR_CalcToolbar (hwnd);
+ if (infoPtr->nNumStrings > 0 || fHasString)
+ TOOLBAR_CalcToolbar(hwnd);
+ else
+ TOOLBAR_LayoutToolbar(hwnd);
TOOLBAR_AutoSize (hwnd);
TOOLBAR_DumpToolbar (infoPtr, __LINE__);
{
#define MAX_RESOURCE_STRING_LENGTH 512
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
+ BOOL fFirstString = (infoPtr->nNumStrings == 0);
INT nIndex = infoPtr->nNumStrings;
if ((wParam) && (HIWORD(lParam) == 0)) {
}
}
+ if (fFirstString)
+ TOOLBAR_CalcToolbar(hwnd);
return nIndex;
}
TOOLBAR_AddStringA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
+ BOOL fFirstString = (infoPtr->nNumStrings == 0);
LPSTR p;
INT nIndex;
INT len;
p += (len+1);
}
+ if (fFirstString)
+ TOOLBAR_CalcToolbar(hwnd);
return nIndex;
}
INT x, y;
INT cx, cy;
- TRACE("auto sizing, style=%lx!\n", infoPtr->dwStyle);
+ TRACE("auto sizing, style=%x!\n", infoPtr->dwStyle);
parent = GetParent (hwnd);
if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1))
{
- TOOLBAR_CalcToolbar(hwnd);
+ TOOLBAR_LayoutToolbar(hwnd);
InvalidateRect( hwnd, NULL, TRUE );
}
Free (oldButtons);
}
- TOOLBAR_CalcToolbar (hwnd);
+ TOOLBAR_LayoutToolbar(hwnd);
InvalidateRect (hwnd, NULL, TRUE);
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
- if (infoPtr->nNumButtons > 0)
- return MAKELONG((WORD)infoPtr->nButtonWidth,
- (WORD)infoPtr->nButtonHeight);
- else
- return MAKELONG(23,22);
+ return MAKELONG((WORD)infoPtr->nButtonWidth,
+ (WORD)infoPtr->nButtonHeight);
}
lpSize->cx = infoPtr->rcBound.right - infoPtr->rcBound.left;
lpSize->cy = infoPtr->rcBound.bottom - infoPtr->rcBound.top;
- TRACE("maximum size %ld x %ld\n",
+ TRACE("maximum size %d x %d\n",
infoPtr->rcBound.right - infoPtr->rcBound.left,
infoPtr->rcBound.bottom - infoPtr->rcBound.top);
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
+ if ((infoPtr->dwStyle & TBSTYLE_TOOLTIPS) && (infoPtr->hwndToolTip == NULL))
+ TOOLBAR_TooltipCreateControl(infoPtr);
return (LRESULT)infoPtr->hwndToolTip;
}
TOOLBAR_TooltipAddTool(infoPtr, &infoPtr->buttons[nIndex]);
- TOOLBAR_CalcToolbar (hwnd);
+ if (infoPtr->nNumStrings > 0)
+ TOOLBAR_CalcToolbar(hwnd);
+ else
+ TOOLBAR_LayoutToolbar(hwnd);
TOOLBAR_AutoSize (hwnd);
InvalidateRect (hwnd, NULL, TRUE);
LOWORD(lParam), HIWORD(lParam));
infoPtr->nBitmapWidth = (INT)LOWORD(lParam);
- infoPtr->nBitmapHeight = (INT)HIWORD(lParam);
-
+ infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight = (INT)HIWORD(lParam);
if ((himlDef == infoPtr->himlInt) &&
(ImageList_GetImageCount(infoPtr->himlInt) == 0))
infoPtr->nBitmapHeight);
}
+ TOOLBAR_CalcToolbar(hwnd);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;
}
TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
- INT cx = LOWORD(lParam), cy = HIWORD(lParam);
+ INT cx = (short)LOWORD(lParam), cy = (short)HIWORD(lParam);
if ((cx < 0) || (cy < 0))
{
- ERR("invalid parameter 0x%08lx\n", (DWORD)lParam);
+ ERR("invalid parameter 0x%08x\n", (DWORD)lParam);
return FALSE;
}
* either size, the system changes it to the default of 24 wide and
* 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02
*/
- infoPtr->nButtonWidth = (cx) ? cx : 24;
- infoPtr->nButtonHeight = (cy) ? cy : 22;
+ if (cx == 0) cx = 24;
+ if (cy == 0) cx = 22;
+
+ cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
+ cy = max(cy, infoPtr->szPadding.cy + infoPtr->nVBitmapHeight);
+
+ infoPtr->nButtonWidth = cx;
+ infoPtr->nButtonHeight = cy;
+
+ infoPtr->iTopMargin = default_top_margin(infoPtr);
+ TOOLBAR_LayoutToolbar(hwnd);
return TRUE;
}
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
/* if setting to current values, ignore */
- if ((infoPtr->cxMin == (INT)LOWORD(lParam)) &&
- (infoPtr->cxMax == (INT)HIWORD(lParam))) {
+ if ((infoPtr->cxMin == (short)LOWORD(lParam)) &&
+ (infoPtr->cxMax == (short)HIWORD(lParam))) {
TRACE("matches current width, min=%d, max=%d, no recalc\n",
infoPtr->cxMin, infoPtr->cxMax);
return TRUE;
}
/* save new values */
- infoPtr->cxMin = (INT)LOWORD(lParam);
- infoPtr->cxMax = (INT)HIWORD(lParam);
+ infoPtr->cxMin = (short)LOWORD(lParam);
+ infoPtr->cxMax = (short)HIWORD(lParam);
/* otherwise we need to recalc the toolbar and in some cases
recalc the bounding rectangle (does DrawText w/ DT_CALCRECT
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwTemp;
- TRACE("hwnd = %p, dwMask = 0x%08lx, dwDTFlags = 0x%08lx\n", hwnd, (DWORD)wParam, (DWORD)lParam);
+ TRACE("hwnd = %p, dwMask = 0x%08x, dwDTFlags = 0x%08x\n", hwnd, (DWORD)wParam, (DWORD)lParam);
dwTemp = infoPtr->dwDTFlags;
infoPtr->dwDTFlags =
infoPtr->dwExStyle &= ~wParam;
infoPtr->dwExStyle |= (DWORD)lParam;
- TRACE("new style 0x%08lx\n", infoPtr->dwExStyle);
+ TRACE("new style 0x%08x\n", infoPtr->dwExStyle);
if (infoPtr->dwExStyle & ~TBSTYLE_EX_ALL)
- FIXME("Unknown Toolbar Extended Style 0x%08lx. Please report.\n",
+ FIXME("Unknown Toolbar Extended Style 0x%08x. Please report.\n",
(infoPtr->dwExStyle & ~TBSTYLE_EX_ALL));
TOOLBAR_CalcToolbar (hwnd);
{
NMTBHOTITEM nmhotitem;
TBUTTON_INFO *btnPtr = NULL, *oldBtnPtr = NULL;
- LRESULT no_highlight;
- /* Remove the effect of an old hot button if the button was
- drawn with the hot button effect */
+ nmhotitem.dwFlags = dwReason;
if(infoPtr->nHotItem >= 0)
{
oldBtnPtr = &infoPtr->buttons[infoPtr->nHotItem];
- oldBtnPtr->bHot = FALSE;
+ nmhotitem.idOld = oldBtnPtr->idCommand;
+ }
+ else
+ {
+ nmhotitem.dwFlags |= HICF_ENTERING;
+ nmhotitem.idOld = 0;
}
- infoPtr->nHotItem = nHit;
-
- /* It's not a separator or in nowhere. It's a hot button. */
if (nHit >= 0)
+ {
btnPtr = &infoPtr->buttons[nHit];
-
- nmhotitem.dwFlags = dwReason;
- if (oldBtnPtr)
- nmhotitem.idOld = oldBtnPtr->idCommand;
- else
- nmhotitem.dwFlags |= HICF_ENTERING;
- if (btnPtr)
- nmhotitem.idNew = btnPtr->idCommand;
+ nmhotitem.idNew = btnPtr->idCommand;
+ }
else
+ {
nmhotitem.dwFlags |= HICF_LEAVING;
+ nmhotitem.idNew = 0;
+ }
- no_highlight = TOOLBAR_SendNotify(&nmhotitem.hdr, infoPtr, TBN_HOTITEMCHANGE);
-
- /* now invalidate the old and new buttons so they will be painted,
- * but only if they are enabled - disabled buttons cannot become hot */
- if (oldBtnPtr && (oldBtnPtr->fsState & TBSTATE_ENABLED))
- InvalidateRect(infoPtr->hwndSelf, &oldBtnPtr->rect, TRUE);
- if (btnPtr && !no_highlight && (btnPtr->fsState & TBSTATE_ENABLED))
+ /* now change the hot and invalidate the old and new buttons - if the
+ * parent agrees */
+ if (!TOOLBAR_SendNotify(&nmhotitem.hdr, infoPtr, TBN_HOTITEMCHANGE))
{
- btnPtr->bHot = TRUE;
- InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE);
+ if (oldBtnPtr) {
+ oldBtnPtr->bHot = FALSE;
+ InvalidateRect(infoPtr->hwndSelf, &oldBtnPtr->rect, TRUE);
+ }
+ /* setting disabled buttons as hot fails even if the notify contains the button id */
+ if (btnPtr && (btnPtr->fsState & TBSTATE_ENABLED)) {
+ btnPtr->bHot = TRUE;
+ InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE);
+ infoPtr->nHotItem = nHit;
+ }
+ else
+ infoPtr->nHotItem = -1;
}
}
}
TRACE("hwnd = %p, nHit = %d\n", hwnd, (INT)wParam);
- if ((INT) wParam < 0 || (INT)wParam > infoPtr->nNumButtons)
+ if ((INT)wParam > infoPtr->nNumButtons)
+ return infoPtr->nHotItem;
+
+ if ((INT)wParam < 0)
wParam = -1;
/* NOTE: an application can still remove the hot item even if anchor
* highlighting is enabled */
- if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
- TOOLBAR_SetHotItemEx(infoPtr, wParam, HICF_OTHER);
+ TOOLBAR_SetHotItemEx(infoPtr, wParam, HICF_OTHER);
if (nOldHotItem < 0)
return -1;
infoPtr->nBitmapWidth = 1;
infoPtr->nBitmapHeight = 1;
}
+ infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight;
TRACE("hwnd %p, new himl=%p, id = %d, count=%d, bitmap w=%d, h=%d\n",
hwnd, infoPtr->himlDef, id, infoPtr->nNumBitmaps,
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBINSERTMARK *lptbim = (TBINSERTMARK*)lParam;
- TRACE("hwnd = %p, lptbim = { %d, 0x%08lx}\n", hwnd, lptbim->iButton, lptbim->dwFlags);
+ TRACE("hwnd = %p, lptbim = { %d, 0x%08x}\n", hwnd, lptbim->iButton, lptbim->dwFlags);
if ((lptbim->dwFlags & ~TBIMHT_AFTER) != 0)
{
- FIXME("Unrecognized flag(s): 0x%08lx\n", (lptbim->dwFlags & ~TBIMHT_AFTER));
+ FIXME("Unrecognized flag(s): 0x%08x\n", (lptbim->dwFlags & ~TBIMHT_AFTER));
return 0;
}
oldPad = MAKELONG(infoPtr->szPadding.cx, infoPtr->szPadding.cy);
infoPtr->szPadding.cx = min(LOWORD((DWORD)lParam), GetSystemMetrics(SM_CXEDGE));
infoPtr->szPadding.cy = min(HIWORD((DWORD)lParam), GetSystemMetrics(SM_CYEDGE));
- TRACE("cx=%ld, cy=%ld\n",
+ TRACE("cx=%d, cy=%d\n",
infoPtr->szPadding.cx, infoPtr->szPadding.cy);
return (LRESULT) oldPad;
}
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
- TRACE("new colors Hl=%lx Shd=%lx, old colors Hl=%lx Shd=%lx\n",
+ TRACE("new colors Hl=%x Shd=%x, old colors Hl=%x Shd=%x\n",
lParam->clrBtnHighlight, lParam->clrBtnShadow,
infoPtr->clrBtnHighlight, infoPtr->clrBtnShadow);
TRACE("returning %s\n", debugstr_a(str));
}
else
- ERR("String index %d out of range (largest is %d)\n", iString, infoPtr->nNumStrings - 1);
+ WARN("String index %d out of range (largest is %d)\n", iString, infoPtr->nNumStrings - 1);
return ret;
}
static LRESULT TOOLBAR_Unkwn45D(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
SIZE * pSize = (SIZE*)lParam;
- FIXME("hwnd=%p, wParam=0x%08x, size.cx=%ld, size.cy=%ld stub!\n", hwnd, wParam, pSize->cx, pSize->cy);
+ FIXME("hwnd=%p, wParam=0x%08x, size.cx=%d, size.cy=%d stub!\n", hwnd, wParam, pSize->cx, pSize->cy);
return 0;
}
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
INT nOldHotItem = infoPtr->nHotItem;
- TRACE("old item=%d, new item=%d, flags=%08lx\n",
+ TRACE("old item=%d, new item=%d, flags=%08x\n",
nOldHotItem, infoPtr->nHotItem, (DWORD)lParam);
if ((INT) wParam < 0 || (INT)wParam > infoPtr->nNumButtons)
* lParam pointer to SIZE structure
*
*/
- TRACE("[0463] wParam %d, lParam 0x%08lx -> 0x%08lx 0x%08lx\n",
+ TRACE("[0463] wParam %d, lParam 0x%08lx -> 0x%08x 0x%08x\n",
wParam, lParam, lpsize->cx, lpsize->cy);
switch(wParam) {
GetWindowRect(hwnd, &rc);
MapWindowPoints(0, hwndParent, (LPPOINT)&rc, 2);
- TRACE("mapped to (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("mapped to (%d,%d)-(%d,%d)\n",
rc.left, rc.top, rc.right, rc.bottom);
lpsize->cx = max(rc.right-rc.left,
infoPtr->rcBound.right - infoPtr->rcBound.left);
wParam);
return 0;
}
- TRACE("[0463] set to -> 0x%08lx 0x%08lx\n",
+ TRACE("[0463] set to -> 0x%08x 0x%08x\n",
lpsize->cx, lpsize->cy);
return 1;
}
TRACE("hwnd = %p\n", hwnd);
/* initialize info structure */
+ infoPtr->nButtonWidth = 23;
infoPtr->nButtonHeight = 22;
- infoPtr->nButtonWidth = 24;
infoPtr->nBitmapHeight = 15;
infoPtr->nBitmapWidth = 16;
+ /* By default Windows creates an image list with 16x15 icons but computes the button size as
+ * if the icons were 16x16. That's why we keep infoPtr->nVBitmapHeight. After a call to
+ * TB_SETBITMAPSIZE or TB_SETIMAGELIST the nVBitmapHeight = nBitmapHeight.
+ */
+ infoPtr->nVBitmapHeight = 16;
infoPtr->nMaxTextRows = 1;
infoPtr->cxMin = -1;
infoPtr->szPadding.cx = DEFPAD_CX;
infoPtr->szPadding.cy = DEFPAD_CY;
infoPtr->iListGap = DEFLISTGAP;
+ infoPtr->iTopMargin = default_top_margin(infoPtr);
infoPtr->dwStyle = dwStyle;
infoPtr->tbim.iButton = -1;
GetClientRect(hwnd, &infoPtr->client_rect);
TOOLBAR_CheckStyle (hwnd, dwStyle);
- TOOLBAR_CalcToolbar(hwnd);
-
return 0;
}
TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot);
/* delete default font */
- if (infoPtr->hFont)
- DeleteObject (infoPtr->hDefaultFont);
+ DeleteObject (infoPtr->hDefaultFont);
CloseThemeData (GetWindowTheme (hwnd));
case CDRF_SKIPDEFAULT:
return TRUE;
default:
- FIXME("[%p] response %ld not handled to NM_CUSTOMDRAW (CDDS_PREERASE)\n",
+ FIXME("[%p] response %d not handled to NM_CUSTOMDRAW (CDDS_PREERASE)\n",
hwnd, ntfret);
}
}
case CDRF_SKIPDEFAULT:
return TRUE;
default:
- FIXME("[%p] response %ld not handled to NM_CUSTOMDRAW (CDDS_POSTERASE)\n",
+ FIXME("[%p] response %d not handled to NM_CUSTOMDRAW (CDDS_POSTERASE)\n",
hwnd, ntfret);
}
}
POINT pt;
INT nHit;
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if (nHit >= 0)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_LBUTTONDOWN, wParam, lParam);
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
btnPtr = &infoPtr->buttons[nHit];
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_LBUTTONUP, wParam, lParam);
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if (!infoPtr->bAnchor || (nHit >= 0))
NMMOUSE nmmouse;
POINT pt;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest(hwnd, &pt);
nmmouse.dwHitInfo = nHit;
TOOLBAR_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
- TBUTTON_INFO *hotBtnPtr;
-
- hotBtnPtr = &infoPtr->buttons[infoPtr->nOldHit];
/* don't remove hot effects when in anchor highlighting mode or when a
* drop-down button is pressed */
- if (!infoPtr->bAnchor && (infoPtr->nOldHit < 0 || !hotBtnPtr->bDropDownPressed))
- TOOLBAR_SetHotItemEx(infoPtr, TOOLBAR_NOWHERE, HICF_MOUSE);
+ if (infoPtr->nHotItem >= 0 && !infoPtr->bAnchor)
+ {
+ TBUTTON_INFO *hotBtnPtr = &infoPtr->buttons[infoPtr->nHotItem];
+ if (!hotBtnPtr->bDropDownPressed)
+ TOOLBAR_SetHotItemEx(infoPtr, TOOLBAR_NOWHERE, HICF_MOUSE);
+ }
if (infoPtr->nOldHit < 0)
return TRUE;
btnPtr->fsState &= ~TBSTATE_PRESSED;
- rc1 = hotBtnPtr->rect;
+ rc1 = btnPtr->rect;
InflateRect (&rc1, 1, 1);
InvalidateRect (hwnd, &rc1, TRUE);
}
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_MOUSEMOVE, wParam, lParam);
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
hdc = wParam==0 ? BeginPaint(hwnd, &ps) : (HDC)wParam;
- TRACE("psrect=(%ld,%ld)-(%ld,%ld)\n",
+ TRACE("psrect=(%d,%d)-(%d,%d)\n",
ps.rcPaint.left, ps.rcPaint.top,
ps.rcPaint.right, ps.rcPaint.bottom);
return 0;
}
+static LRESULT
+TOOLBAR_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
+{
+ TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
+
+ TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam);
+
+ if (wParam == 0)
+ infoPtr->hFont = infoPtr->hDefaultFont;
+ else
+ infoPtr->hFont = (HFONT)wParam;
+
+ TOOLBAR_CalcToolbar(hwnd);
+
+ if (lParam)
+ InvalidateRect(hwnd, NULL, TRUE);
+ return 1;
+}
static LRESULT
TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_CheckStyle (hwnd, lpStyle->styleNew);
- TRACE("new style 0x%08lx\n", lpStyle->styleNew);
+ TRACE("new style 0x%08x\n", lpStyle->styleNew);
infoPtr->dwStyle = lpStyle->styleNew;
+ if ((dwOldStyle ^ lpStyle->styleNew) & (TBSTYLE_WRAPABLE | CCS_VERT))
+ TOOLBAR_LayoutToolbar(hwnd);
+
/* only resize if one of the CCS_* styles was changed */
if ((dwOldStyle ^ lpStyle->styleNew) & COMMON_STYLES)
{
case WM_SETFOCUS:
return TOOLBAR_SetFocus (hwnd, wParam);
+ case WM_SETFONT:
+ return TOOLBAR_SetFont(hwnd, wParam, lParam);
+
case WM_SETREDRAW:
return TOOLBAR_SetRedraw (hwnd, wParam, lParam);
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
- RECT rect, wndrect;
+ HMONITOR monitor;
+ MONITORINFO mon_info;
+ RECT rect;
SIZE size;
NMHDR hdr;
int ptfx = 0;
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
- TRACE("size %ld x %ld\n", size.cx, size.cy);
+ TRACE("size %d x %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_CENTERTIP) {
RECT rc;
}
}
- TRACE("pos %ld - %ld\n", rect.left, rect.top);
+ TRACE("pos %d - %d\n", rect.left, rect.top);
rect.right = rect.left + size.cx;
rect.bottom = rect.top + size.cy;
/* check position */
- wndrect.right = GetSystemMetrics( SM_CXSCREEN );
- if( rect.right > wndrect.right ) {
- rect.left -= rect.right - wndrect.right + 2;
- rect.right = wndrect.right - 2;
+
+ monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
+ mon_info.cbSize = sizeof(mon_info);
+ GetMonitorInfoW( monitor, &mon_info );
+
+ if( rect.right > mon_info.rcWork.right ) {
+ rect.left -= rect.right - mon_info.rcWork.right + 2;
+ rect.right = mon_info.rcWork.right - 2;
}
- wndrect.bottom = GetSystemMetrics( SM_CYSCREEN );
- if( rect.bottom > wndrect.bottom ) {
+ if (rect.left < mon_info.rcWork.left) rect.left = mon_info.rcWork.left;
+
+ if( rect.bottom > mon_info.rcWork.bottom ) {
RECT rc;
if (toolPtr->uFlags & TTF_IDISHWND)
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
- TRACE("size %ld x %ld\n", size.cx, size.cy);
+ TRACE("size %d x %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_ABSOLUTE) {
rect.left = infoPtr->xTrackPos;
rect.left = rcTool.right;
}
- TRACE("pos %ld - %ld\n", rect.left, rect.top);
+ TRACE("pos %d - %d\n", rect.left, rect.top);
rect.right = rect.left + size.cx;
rect.bottom = rect.top + size.cy;
TRACE("tool %d\n", nTool);
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
- TRACE("size %ld x %ld\n", size.cx, size.cy);
+ TRACE("size %d x %d\n", size.cx, size.cy);
return MAKELRESULT(size.cx, size.cy);
}
break;
case WM_MOUSEMOVE:
- pt.x = LOWORD(lpMsg->lParam);
- pt.y = HIWORD(lpMsg->lParam);
+ pt.x = (short)LOWORD(lpMsg->lParam);
+ pt.y = (short)HIWORD(lpMsg->lParam);
nOldTool = infoPtr->nTool;
infoPtr->nTool = TOOLTIPS_GetToolFromPoint(infoPtr, lpMsg->hwnd,
&pt);
TRACE("tool (%p) %d %d %d\n", hwnd, nOldTool,
infoPtr->nTool, infoPtr->nCurrentTool);
- TRACE("WM_MOUSEMOVE (%p %ld %ld)\n", hwnd, pt.x, pt.y);
+ TRACE("WM_MOUSEMOVE (%p %d %d)\n", hwnd, pt.x, pt.y);
if (infoPtr->nTool != nOldTool) {
if(infoPtr->nTool == -1) { /* Moved out of all tools */
}
}
- TRACE("selection[left=%ld, top=%ld, right=%ld, bottom=%ld]\n",
+ TRACE("selection[left=%d, top=%d, right=%d, bottom=%d]\n",
selection->left, selection->top, selection->right, selection->bottom);
}
LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint);
LONG prevPos = infoPtr->lPos;
- TRACE("x=%ld, y=%ld, dir=%ld\n", clickPoint.x, clickPoint.y, dir);
+ TRACE("x=%d, y=%d, dir=%d\n", clickPoint.x, clickPoint.y, dir);
if (dir > 0 && (infoPtr->flags & TB_AUTO_PAGE_RIGHT))
TRACKBAR_PageDown(infoPtr);
const DWORD a = *(const DWORD *)ap;
const DWORD b = *(const DWORD *)bp;
- TRACE("(a=%ld, b=%ld)\n", a, b);
+ TRACE("(a=%d, b=%d)\n", a, b);
if (a < b) return -1;
if (a > b) return 1;
return 0;
if ((lPos < infoPtr->lRangeMin) || (lPos> infoPtr->lRangeMax))
return FALSE;
- TRACE("lPos=%ld\n", lPos);
+ TRACE("lPos=%d\n", lPos);
infoPtr->uNumTics++;
infoPtr->tics=ReAlloc( infoPtr->tics,
if (dwStyle & TBS_TOOLTIPS) {
infoPtr->hwndToolTip =
- CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, 0,
+ CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hwnd, 0, 0, 0);
NMTVCUSTOMDRAW nmcdhdr;
LPNMCUSTOMDRAW nmcd;
- TRACE("drawstage:%lx hdc:%p\n", dwDrawStage, hdc);
+ TRACE("drawstage:%x hdc:%p\n", dwDrawStage, hdc);
nmcd = &nmcdhdr.nmcd;
nmcd->hdr.hwndFrom = hwnd;
nmcd->lItemlParam = wineItem->lParam;
nmcdhdr->iLevel = wineItem->iLevel;
- TRACE("drawstage:%lx hdc:%p item:%lx, itemstate:%x, lItemlParam:%lx\n",
+ TRACE("drawstage:%x hdc:%p item:%lx, itemstate:%x, lItemlParam:%lx\n",
nmcd->dwDrawStage, nmcd->hdc, nmcd->dwItemSpec,
nmcd->uItemState, nmcd->lItemlParam);
{
COLORREF prevColor = infoPtr->clrInsertMark;
- TRACE("%lx\n", color);
+ TRACE("%x\n", color);
infoPtr->clrInsertMark = color;
return (LRESULT)prevColor;
*lpRect = wineItem->rect;
}
- TRACE("%s [L:%ld R:%ld T:%ld B:%ld]\n", fTextRect ? "text" : "item",
+ TRACE("%s [L:%d R:%d T:%d B:%d]\n", fTextRect ? "text" : "item",
lpRect->left, lpRect->right, lpRect->top, lpRect->bottom);
return TRUE;
rcText.left = wineItem->textOffset;
rcText.right = rcText.left + wineItem->textWidth + 4;
- TRACE("drawing text %s at (%ld,%ld)-(%ld,%ld)\n",
+ TRACE("drawing text %s at (%d,%d)-(%d,%d)\n",
debugstr_w(wineItem->pszText),
rcText.left, rcText.top, rcText.right, rcText.bottom);
}
lpht->hItem = wineItem;
- TRACE("(%ld,%ld):result %x\n", lpht->pt.x, lpht->pt.y, lpht->flags);
+ TRACE("(%d,%d):result %x\n", lpht->pt.x, lpht->pt.y, lpht->flags);
return (LRESULT)wineItem;
}
hOldFont = SelectObject(hdc, infoPtr->hFont);
GetTextExtentPoint32W(hdc, dragItem->pszText, strlenW(dragItem->pszText),
&size);
- TRACE("%ld %ld %s %d\n", size.cx, size.cy, debugstr_w(dragItem->pszText),
+ TRACE("%d %d %s %d\n", size.cx, size.cy, debugstr_w(dragItem->pszText),
strlenW(dragItem->pszText));
hbmp = CreateCompatibleBitmap(htopdc, size.cx, size.cy);
hOldbmp = SelectObject(hdc, hbmp);
viscount = TREEVIEW_GetVisibleCount(infoPtr);
- TRACE("%p (%s) %ld - %ld viscount(%d)\n", item, TREEVIEW_ItemName(item), item->visibleOrder,
+ TRACE("%p (%s) %d - %d viscount(%d)\n", item, TREEVIEW_ItemName(item), item->visibleOrder,
hasFirstVisible ? infoPtr->firstVisible->visibleOrder : -1, viscount);
if (hasFirstVisible)
TREEVIEW_INFO *infoPtr;
LOGFONTW lf;
- TRACE("wnd %p, style %lx\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
+ TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
infoPtr = (TREEVIEW_INFO *)Alloc(sizeof(TREEVIEW_INFO));
_TrackMouseEvent(&trackinfo);
}
- pt.x = (INT)LOWORD(lParam);
- pt.y = (INT)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
item = TREEVIEW_HitTestPoint(infoPtr, pt);
if (lppgc->dwFlag == PGF_CALCWIDTH) {
lppgc->iWidth = infoPtr->treeWidth;
- TRACE("got PGN_CALCSIZE, returning horz size = %ld, client=%ld\n",
+ TRACE("got PGN_CALCSIZE, returning horz size = %d, client=%d\n",
infoPtr->treeWidth, infoPtr->clientWidth);
}
else {
lppgc->iHeight = infoPtr->treeHeight;
- TRACE("got PGN_CALCSIZE, returning vert size = %ld, client=%ld\n",
+ TRACE("got PGN_CALCSIZE, returning vert size = %d, client=%d\n",
infoPtr->treeHeight, infoPtr->clientHeight);
}
return 0;
int WINAPI MessageBoxIndirectW(CONST MSGBOXPARAMSW*);
BOOL WINAPI ModifyMenuA(HMENU,UINT,UINT,UINT,LPCSTR);
BOOL WINAPI ModifyMenuW(HMENU,UINT,UINT,UINT,LPCWSTR);
+HMONITOR WINAPI MonitorFromPoint(POINT,DWORD);
+HMONITOR WINAPI MonitorFromRect(LPCRECT,DWORD);
+HMONITOR WINAPI MonitorFromWindow(HWND,DWORD);
void WINAPI mouse_event(DWORD,DWORD,DWORD,DWORD,ULONG_PTR);
BOOL WINAPI MoveWindow(HWND,int,int,int,int,BOOL);
DWORD WINAPI MsgWaitForMultipleObjects(DWORD,CONST HANDLE*,BOOL,DWORD,DWORD);