Author: gedmurphy
Date: Wed Aug 30 23:18:49 2006
New Revision: 23807
URL:
http://svn.reactos.org/svn/reactos?rev=23807&view=rev
Log:
[WINESYNC]
update comctl32 to Wine_0.9.20
Modified:
trunk/reactos/dll/win32/comctl32/imagelist.c
trunk/reactos/dll/win32/comctl32/propsheet.c
trunk/reactos/dll/win32/comctl32/toolbar.c
Modified: trunk/reactos/dll/win32/comctl32/imagelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/imagelist.c (original)
+++ trunk/reactos/dll/win32/comctl32/imagelist.c Wed Aug 30 23:18:49 2006
@@ -2158,6 +2158,7 @@
{
HDC hdcImage;
BITMAP bmp;
+ HBITMAP hOldBitmap;
TRACE("%p %d %p %p\n", himl, i, hbmImage, hbmMask);
@@ -2175,29 +2176,34 @@
GetObjectA (hbmImage, sizeof(BITMAP), (LPVOID)&bmp);
/* Replace Image */
- SelectObject (hdcImage, hbmImage);
+ hOldBitmap = SelectObject (hdcImage, hbmImage);
StretchBlt (himl->hdcImage, i * himl->cx, 0, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
if (himl->hbmMask)
{
- /* Replace Mask */
- SelectObject (hdcImage, hbmMask);
+ HDC hdcTemp;
+ HBITMAP hOldBitmapTemp;
+
+ hdcTemp = CreateCompatibleDC(0);
+ hOldBitmapTemp = SelectObject(hdcTemp, hbmMask);
StretchBlt (himl->hdcMask, i * himl->cx, 0, himl->cx, himl->cy,
- hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
-
+ hdcTemp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
+ SelectObject(hdcTemp, hOldBitmapTemp);
+ DeleteDC(hdcTemp);
/* Remove the background from the image
*/
- StretchBlt (himl->hdcImage,
- i*himl->cx, 0, himl->cx, himl->cy,
- hdcImage,
- 0, 0, bmp.bmWidth, bmp.bmHeight,
+ BitBlt (himl->hdcImage,
+ i*himl->cx, 0, bmp.bmWidth, bmp.bmHeight,
+ himl->hdcMask,
+ i*himl->cx, 0,
0x220326); /* NOTSRCAND */
}
+ SelectObject (hdcImage, hOldBitmap);
DeleteDC (hdcImage);
return TRUE;
Modified: trunk/reactos/dll/win32/comctl32/propsheet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/propshe…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/propsheet.c (original)
+++ trunk/reactos/dll/win32/comctl32/propsheet.c Wed Aug 30 23:18:49 2006
@@ -2079,6 +2079,21 @@
continue;
}
}
+
+ /* Invalidate the header area */
+ if ( (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW))
&&
+ (psInfo->ppshheader.dwFlags & PSH_HEADER) )
+ {
+ HWND hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER);
+ RECT r;
+
+ GetClientRect(hwndLineHeader, &r);
+ MapWindowPoints(hwndLineHeader, hwndDlg, (LPPOINT) &r, 2);
+ SetRect(&r, 0, 0, r.right + 1, r.top - 1);
+
+ InvalidateRect(hwndDlg, &r, TRUE);
+ }
+
/*
* Display the new page.
*/
@@ -3254,15 +3269,16 @@
}
else
{
+ int margin;
hbr = GetSysColorBrush(COLOR_WINDOW);
FillRect(hdc, &rzone, hbr);
/* Draw the header bitmap. It's always centered like a
* common 49 x 49 bitmap. */
- BitBlt(hdc, rzone.right - 49 - ((rzone.bottom - 49) / 2),
- (rzone.bottom - 49) / 2,
- bm.bmWidth, bm.bmHeight,
- hdcSrc, 0, 0, SRCCOPY);
+ margin = (rzone.bottom - 49) / 2;
+ BitBlt(hdc, rzone.right - 49 - margin, margin,
+ min(bm.bmWidth, 49), min(bm.bmHeight, 49),
+ hdcSrc, 0, 0, SRCCOPY);
/* NOTE: Native COMCTL32 draws a white stripe over the bitmap
* if its height is smaller than 49 pixels. Because the reason
@@ -3276,22 +3292,14 @@
if (ppshpage->dwFlags & PSP_USEHEADERTITLE) {
SetRect(&r, 20, 10, 0, 0);
if (HIWORD(ppshpage->pszHeaderTitle))
- {
- if (psInfo->unicode)
- DrawTextW(hdc, (LPWSTR)ppshpage->pszHeaderTitle,
- -1, &r, DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
- else
- DrawTextA(hdc, (LPCSTR)ppshpage->pszHeaderTitle,
- -1, &r, DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
- }
+ DrawTextW(hdc, ppshpage->pszHeaderTitle, -1, &r, DT_LEFT |
DT_SINGLELINE | DT_NOCLIP);
else
{
nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderTitle,
szBuffer, 256);
if (nLength != 0)
{
- DrawTextW(hdc, szBuffer, nLength,
- &r, DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
+ DrawTextW(hdc, szBuffer, nLength, &r, DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
}
}
}
@@ -3300,22 +3308,14 @@
SelectObject(hdc, psInfo->hFont);
SetRect(&r, 40, 25, rzone.right - 69, rzone.bottom);
if (HIWORD(ppshpage->pszHeaderTitle))
- {
- if (psInfo->unicode)
- DrawTextW(hdc, (LPWSTR)ppshpage->pszHeaderSubTitle,
- -1, &r, DT_LEFT | DT_SINGLELINE);
- else
- DrawTextA(hdc, (LPCSTR)ppshpage->pszHeaderSubTitle,
- -1, &r, DT_LEFT | DT_SINGLELINE);
- }
+ DrawTextW(hdc, ppshpage->pszHeaderSubTitle, -1, &r, DT_LEFT |
DT_WORDBREAK);
else
{
nLength = LoadStringW(ppshpage->hInstance,
(UINT_PTR)ppshpage->pszHeaderSubTitle,
szBuffer, 256);
if (nLength != 0)
{
- DrawTextW(hdc, szBuffer, nLength,
- &r, DT_LEFT | DT_SINGLELINE);
+ DrawTextW(hdc, szBuffer, nLength, &r, DT_LEFT | DT_WORDBREAK);
}
}
}
@@ -3348,6 +3348,8 @@
GetObjectW(psInfo->ppshheader.u4.hbmWatermark, sizeof(BITMAP), (LPVOID)&bm);
hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u4.hbmWatermark);
+ /* The watermark is truncated to a width of 164 pixels */
+ r.right = min(r.right, 164);
BitBlt(hdc, 0, offsety, min(bm.bmWidth, r.right),
min(bm.bmHeight, r.bottom), hdcSrc, 0, 0, SRCCOPY);
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/toolbar.c (original)
+++ trunk/reactos/dll/win32/comctl32/toolbar.c Wed Aug 30 23:18:49 2006
@@ -696,8 +696,9 @@
draw_masked = TRUE;
}
}
- else if ((tbcd->nmcd.uItemState & CDIS_HOT)
- && ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme
(infoPtr->hwndSelf)))
+ else if (tbcd->nmcd.uItemState & CDIS_CHECKED ||
+ ((tbcd->nmcd.uItemState & CDIS_HOT)
+ && ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme
(infoPtr->hwndSelf))))
{
/* if hot, attempt to draw with hot image list, if fails,
use default image list */
@@ -2688,48 +2689,48 @@
switch (lpAddBmp->nID)
{
case IDB_STD_SMALL_COLOR:
- hbmLoad = LoadBitmapW (COMCTL32_hModule,
- MAKEINTRESOURCEW(IDB_STD_SMALL));
+ hbmLoad = CreateMappedBitmap (COMCTL32_hModule,
+ IDB_STD_SMALL, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef,
hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
break;
case IDB_STD_LARGE_COLOR:
- hbmLoad = LoadBitmapW (COMCTL32_hModule,
- MAKEINTRESOURCEW(IDB_STD_LARGE));
+ hbmLoad = CreateMappedBitmap (COMCTL32_hModule,
+ IDB_STD_LARGE, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef,
hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
break;
case IDB_VIEW_SMALL_COLOR:
- hbmLoad = LoadBitmapW (COMCTL32_hModule,
- MAKEINTRESOURCEW(IDB_VIEW_SMALL));
+ hbmLoad = CreateMappedBitmap (COMCTL32_hModule,
+ IDB_VIEW_SMALL, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef,
hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
break;
case IDB_VIEW_LARGE_COLOR:
- hbmLoad = LoadBitmapW (COMCTL32_hModule,
- MAKEINTRESOURCEW(IDB_VIEW_LARGE));
+ hbmLoad = CreateMappedBitmap (COMCTL32_hModule,
+ IDB_VIEW_LARGE, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef,
hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
break;
case IDB_HIST_SMALL_COLOR:
- hbmLoad = LoadBitmapW (COMCTL32_hModule,
- MAKEINTRESOURCEW(IDB_HIST_SMALL));
+ hbmLoad = CreateMappedBitmap (COMCTL32_hModule,
+ IDB_HIST_SMALL, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef,
hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
break;
case IDB_HIST_LARGE_COLOR:
- hbmLoad = LoadBitmapW (COMCTL32_hModule,
- MAKEINTRESOURCEW(IDB_HIST_LARGE));
+ hbmLoad = CreateMappedBitmap (COMCTL32_hModule,
+ IDB_HIST_LARGE, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef,
hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
@@ -2743,7 +2744,7 @@
}
else
{
- hbmLoad = LoadBitmapW (lpAddBmp->hInst, (LPWSTR)lpAddBmp->nID);
+ hbmLoad = CreateMappedBitmap(lpAddBmp->hInst, lpAddBmp->nID, 0, NULL, 0);
nIndex = ImageList_AddMasked (himlDef, hbmLoad, comctl32_color.clrBtnFace);
DeleteObject (hbmLoad);
}