From aa6974689d9ed506c104b630a7c5db16cdd2d087 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 19 Mar 2015 12:07:32 +0000 Subject: [PATCH] [COMCTL32] Sync with Wine Staging 1.7.37. CORE-9246 svn path=/trunk/; revision=66800 --- reactos/dll/win32/comctl32/CMakeLists.txt | 2 + reactos/dll/win32/comctl32/comctl32_ros.diff | 1226 ++++++++++++++++-- reactos/dll/win32/comctl32/comctl32undoc.c | 4 +- reactos/dll/win32/comctl32/commctrl.c | 9 + reactos/dll/win32/comctl32/header.c | 5 +- reactos/dll/win32/comctl32/imagelist.c | 16 +- reactos/dll/win32/comctl32/ipaddress.c | 54 +- reactos/dll/win32/comctl32/listview.c | 3 - reactos/dll/win32/comctl32/progress.c | 18 +- reactos/dll/win32/comctl32/propsheet.c | 22 +- reactos/dll/win32/comctl32/string.c | 45 +- reactos/dll/win32/comctl32/syslink.c | 28 +- reactos/dll/win32/comctl32/theme_button.c | 86 +- reactos/dll/win32/comctl32/theme_edit.c | 2 + reactos/dll/win32/comctl32/theming.c | 9 +- reactos/dll/win32/comctl32/toolbar.c | 2 - reactos/dll/win32/comctl32/tooltips.c | 16 +- reactos/media/doc/README.WINE | 2 +- 18 files changed, 1352 insertions(+), 197 deletions(-) diff --git a/reactos/dll/win32/comctl32/CMakeLists.txt b/reactos/dll/win32/comctl32/CMakeLists.txt index 22d9f72492b..b72044b8024 100644 --- a/reactos/dll/win32/comctl32/CMakeLists.txt +++ b/reactos/dll/win32/comctl32/CMakeLists.txt @@ -22,6 +22,7 @@ list(APPEND SOURCE flatsb.c header.c hotkey.c + icon.c imagelist.c ipaddress.c listview.c @@ -41,6 +42,7 @@ list(APPEND SOURCE theme_dialog.c theme_edit.c theme_listbox.c + theme_scrollbar.c theming.c toolbar.c tooltips.c diff --git a/reactos/dll/win32/comctl32/comctl32_ros.diff b/reactos/dll/win32/comctl32/comctl32_ros.diff index 4e888ef073a..41b61c804f3 100644 --- a/reactos/dll/win32/comctl32/comctl32_ros.diff +++ b/reactos/dll/win32/comctl32/comctl32_ros.diff @@ -1,53 +1,6 @@ -diff -prudN e:\Wine\dlls\comctl32/comctl32.spec e:\reactos\dll\win32\comctl32/comctl32.spec ---- e:\Wine\dlls\comctl32/comctl32.spec 2014-04-04 14:12:39.665980800 +0100 -+++ e:\reactos\dll\win32\comctl32/comctl32.spec 2014-03-27 14:27:25.808903400 +0100 -@@ -15,7 +15,7 @@ - 11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long) - #12 stub Cctl1632_ThunkData32 - 13 stdcall MakeDragList(long) -- 14 stdcall LBItemFromPt(long int64 long) -+ 14 stdcall LBItemFromPt(long double long) #(long int64 long) - 15 stdcall DrawInsert(long long long) - 16 stdcall CreateUpDownControl(long long long long long long long long long long long long) - 17 stdcall InitCommonControls() -@@ -30,8 +30,8 @@ - 155 stdcall -noname FindMRUStringA(long str ptr) - 156 stdcall -noname DelMRUString(long long) - 157 stdcall -noname CreateMRUListLazyA(ptr long long long) --163 stub -noname CreatePage --164 stub -noname CreateProxyPage -+163 stdcall -noname CreatePage(long ptr) -+164 stdcall -noname CreateProxyPage(long long) - 167 stdcall -noname AddMRUData(long ptr long) - 169 stdcall -noname FindMRUData(long ptr long ptr) - 233 stdcall -noname Str_GetPtrA(str str long) -@@ -89,13 +89,13 @@ - 376 stdcall -noname -private IntlStrEqWorkerA(long str str long) - 377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long) - 382 stdcall -noname SmoothScrollWindow(ptr) --383 stub -noname DoReaderMode -+383 stdcall -noname DoReaderMode(ptr) - 384 stdcall -noname SetPathWordBreakProc(ptr long) - 385 stdcall -ordinal DPA_EnumCallback(long long long) - 386 stdcall -ordinal DPA_DestroyCallback(ptr ptr long) - 387 stdcall -ordinal DSA_EnumCallback(ptr ptr long) - 388 stdcall -ordinal DSA_DestroyCallback(ptr ptr long) --389 stub -noname SHGetProcessDword -+389 stdcall -noname SHGetProcessDword(long long) - 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr) - 400 stdcall -ordinal CreateMRUListW(ptr) - 401 stdcall -ordinal AddMRUStringW(long wstr) -@@ -189,5 +189,6 @@ - @ stdcall PropertySheet(ptr) PropertySheetA - @ stdcall PropertySheetA(ptr) - @ stdcall PropertySheetW(ptr) -+@ stdcall RegisterClassNameW(wstr) - @ stdcall UninitializeFlatSB(long) - @ stdcall _TrackMouseEvent(ptr) - -diff -prudN e:\Wine\dlls\comctl32/commctrl.c e:\reactos\dll\win32\comctl32/commctrl.c ---- e:\Wine\dlls\comctl32/commctrl.c 2014-04-04 14:12:39.666981500 +0100 -+++ e:\reactos\dll\win32\comctl32/commctrl.c 2014-04-06 12:07:15.451048000 +0100 +diff -pudN E:\wine\dlls\comctl32/commctrl.c E:\reactos\dll\win32\comctl32/commctrl.c +--- E:\wine\dlls\comctl32/commctrl.c 2015-02-21 17:13:08.585542200 +0100 ++++ E:\reactos\dll\win32\comctl32/commctrl.c 2015-03-18 17:10:39.955584600 +0100 @@ -52,25 +52,26 @@ * -- ICC_WIN95_CLASSES */ @@ -289,9 +242,9 @@ diff -prudN e:\Wine\dlls\comctl32/commctrl.c e:\reactos\dll\win32\comctl32/commc } /*********************************************************************** -@@ -1637,3 +1807,15 @@ HRESULT WINAPI TaskDialogIndirect(const - if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE; - return S_OK; +@@ -1646,3 +1816,15 @@ HRESULT WINAPI LoadIconWithScaleDown(HIN + FIXME("stub: %p %s %d %d %p\n", hinst, wine_dbgstr_w(name), cx, cy, icon); + return E_NOTIMPL; } + +/*********************************************************************** @@ -305,10 +258,180 @@ diff -prudN e:\Wine\dlls\comctl32/commctrl.c e:\reactos\dll\win32\comctl32/commc + comctl32 classes are registered by this module anyway */ + return TRUE; +} - -diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listview.c ---- e:\Wine\dlls\comctl32/listview.c 2014-04-18 20:39:25.506861000 +0100 -+++ e:\reactos\dll\win32\comctl32/listview.c 2014-04-22 13:09:20.504496900 +0100 +diff -pudN E:\wine\dlls\comctl32/imagelist.c E:\reactos\dll\win32\comctl32/imagelist.c +--- E:\wine\dlls\comctl32/imagelist.c 2015-02-21 17:13:08.589542200 +0100 ++++ E:\reactos\dll\win32\comctl32/imagelist.c 2015-03-18 17:15:00.458921400 +0100 +@@ -33,27 +33,14 @@ + * + * TODO: + * - Add support for ILD_PRESERVEALPHA, ILD_SCALE, ILD_DPISCALE +- * - Add support for ILS_GLOW, ILS_SHADOW, ILS_SATURATE ++ * - Add support for ILS_GLOW, ILS_SHADOW + * - Thread-safe locking + */ + +-#include +-#include +-#include +- +-#define COBJMACROS +- +-#include "winerror.h" +-#include "windef.h" +-#include "winbase.h" +-#include "objbase.h" +-#include "wingdi.h" +-#include "winuser.h" +-#include "commctrl.h" + #include "comctl32.h" +-#include "commoncontrols.h" +-#include "wine/debug.h" +-#include "wine/exception.h" ++ ++#include ++#include + + WINE_DEFAULT_DEBUG_CHANNEL(imagelist); + +@@ -1246,7 +1233,7 @@ ImageList_DrawEx (HIMAGELIST himl, INT i + } + + +-static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int dest_y, ++static BOOL alpha_blend_image( HIMAGELIST himl, HDC srce_dc, HDC dest_dc, int dest_x, int dest_y, + int src_x, int src_y, int cx, int cy, BLENDFUNCTION func, + UINT style, COLORREF blend_col ) + { +@@ -1271,9 +1258,9 @@ static BOOL alpha_blend_image( HIMAGELIS + info->bmiHeader.biYPelsPerMeter = 0; + info->bmiHeader.biClrUsed = 0; + info->bmiHeader.biClrImportant = 0; +- if (!(bmp = CreateDIBSection( himl->hdcImage, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done; ++ if (!(bmp = CreateDIBSection( srce_dc, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done; + SelectObject( hdc, bmp ); +- BitBlt( hdc, 0, 0, cx, cy, himl->hdcImage, src_x, src_y, SRCCOPY ); ++ BitBlt( hdc, 0, 0, cx, cy, srce_dc, src_x, src_y, SRCCOPY ); + + if (blend_col != CLR_NONE) + { +@@ -1346,6 +1333,66 @@ done: + return ret; + } + ++HDC saturate_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int dest_y, ++ int src_x, int src_y, int cx, int cy, COLORREF rgbFg) ++{ ++ HDC hdc = NULL; ++ HBITMAP bmp = 0; ++ BITMAPINFO *info; ++ ++ unsigned int *ptr; ++ void *bits; ++ int i; ++ ++ /* create a dc and its device independent bitmap for doing the work, ++ shamelessly copied from the alpha-blending function above */ ++ if (!(hdc = CreateCompatibleDC( 0 ))) return FALSE; ++ if (!(info = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )))) goto done; ++ info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ++ info->bmiHeader.biWidth = cx; ++ info->bmiHeader.biHeight = cy; ++ info->bmiHeader.biPlanes = 1; ++ info->bmiHeader.biBitCount = 32; ++ info->bmiHeader.biCompression = BI_RGB; ++ info->bmiHeader.biSizeImage = cx * cy * 4; ++ info->bmiHeader.biXPelsPerMeter = 0; ++ info->bmiHeader.biYPelsPerMeter = 0; ++ info->bmiHeader.biClrUsed = 0; ++ info->bmiHeader.biClrImportant = 0; ++ if (!(bmp = CreateDIBSection(himl->hdcImage, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done; ++ ++ /* bind both surfaces */ ++ SelectObject(hdc, bmp); ++ ++ /* copy into our dc the section that covers just the icon we we're asked for */ ++ BitBlt(hdc, 0, 0, cx, cy, himl->hdcImage, src_x, src_y, SRCCOPY); ++ ++ /* loop every pixel of the bitmap */ ++ for (i = 0, ptr = bits; i < cx * cy; i++, ptr++) ++ { ++ COLORREF orig_color = *ptr; ++ ++ /* calculate the effective luminance using the constants from here, adapted to the human eye: ++ */ ++ float mixed_color = (GetRValue(orig_color) * .30 + ++ GetGValue(orig_color) * .59 + ++ GetBValue(orig_color) * .11); ++ ++ *ptr = RGBA(mixed_color, mixed_color, mixed_color, GetAValue(orig_color)); ++ } ++ ++done: ++ ++ if (bmp) ++ DeleteObject(bmp); ++ ++ if (info) ++ HeapFree(GetProcessHeap(), 0, info); ++ ++ /* return the handle to our desaturated dc, that will substitute its original counterpart in the next calls */ ++ return hdc; ++} ++ + /************************************************************************* + * ImageList_DrawIndirect [COMCTL32.@] + * +@@ -1422,6 +1469,21 @@ ImageList_DrawIndirect (IMAGELISTDRAWPAR + oldImageFg = SetTextColor( hImageDC, RGB( 0, 0, 0 ) ); + oldImageBk = SetBkColor( hImageDC, RGB( 0xff, 0xff, 0xff ) ); + ++ /* ++ * If the ILS_SATURATE bit is enabled we should multiply the ++ * RGB colors of the original image by the contents of rgbFg. ++ */ ++ if (fState & ILS_SATURATE) ++ { ++ hImageListDC = saturate_image(himl, pimldp->hdcDst, pimldp->x, pimldp->y, ++ pt.x, pt.y, cx, cy, pimldp->rgbFg); ++ ++ /* shitty way of getting subroutines to blit at the right place (top left corner), ++ as our modified imagelist only contains a single image for performance reasons */ ++ pt.x = 0; ++ pt.y = 0; ++ } ++ + has_alpha = (himl->has_alpha && himl->has_alpha[pimldp->i]); + if (!bMask && (has_alpha || (fState & ILS_ALPHA))) + { +@@ -1442,7 +1504,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPAR + + if (bIsTransparent) + { +- bResult = alpha_blend_image( himl, pimldp->hdcDst, pimldp->x, pimldp->y, ++ bResult = alpha_blend_image( himl, hImageListDC, pimldp->hdcDst, pimldp->x, pimldp->y, + pt.x, pt.y, cx, cy, func, fStyle, blend_col ); + goto end; + } +@@ -1452,7 +1514,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPAR + + hOldBrush = SelectObject (hImageDC, CreateSolidBrush (colour)); + PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY ); +- alpha_blend_image( himl, hImageDC, 0, 0, pt.x, pt.y, cx, cy, func, fStyle, blend_col ); ++ alpha_blend_image( himl, hImageListDC, hImageDC, 0, 0, pt.x, pt.y, cx, cy, func, fStyle, blend_col ); + DeleteObject (SelectObject (hImageDC, hOldBrush)); + bResult = BitBlt( pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, SRCCOPY ); + goto end; +@@ -1546,7 +1608,6 @@ ImageList_DrawIndirect (IMAGELISTDRAWPAR + } + } + +- if (fState & ILS_SATURATE) FIXME("ILS_SATURATE: unimplemented!\n"); + if (fState & ILS_GLOW) FIXME("ILS_GLOW: unimplemented!\n"); + if (fState & ILS_SHADOW) FIXME("ILS_SHADOW: unimplemented!\n"); + +diff -pudN E:\wine\dlls\comctl32/listview.c E:\reactos\dll\win32\comctl32/listview.c +--- E:\wine\dlls\comctl32/listview.c 2015-02-21 17:13:08.593542200 +0100 ++++ E:\reactos\dll\win32\comctl32/listview.c 2015-03-18 17:19:17.656744600 +0100 @@ -307,6 +288,7 @@ typedef struct tagLISTVIEW_INFO COLORREF clrBk; COLORREF clrText; @@ -317,7 +440,7 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv /* font */ HFONT hDefaultFont; -@@ -1693,8 +1675,19 @@ static inline BOOL LISTVIEW_GetItemW(con +@@ -1699,8 +1681,19 @@ static inline BOOL LISTVIEW_GetItemW(con /* used to handle collapse main item column case */ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc) { @@ -339,21 +462,21 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv } /* Listview invalidation functions: use _only_ these functions to invalidate */ -@@ -4727,7 +4720,12 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I +@@ -4669,7 +4662,12 @@ static void LISTVIEW_DrawItemPart(LISTVI if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) rcLabel.bottom--; -- DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat); +- DrawTextW(nmlvcd->nmcd.hdc, item->pszText, -1, &rcLabel, format); +#ifdef __REACTOS__ -+ if ((!(lvItem.state & LVIS_SELECTED) || !infoPtr->bFocus) && (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTSHADOWTEXT)) -+ DrawShadowText(hdc, lvItem.pszText, -1, &rcLabel, uFormat, RGB(255, 255, 255), RGB(0, 0, 0), 2, 2); ++ if ((!(item->state & LVIS_SELECTED) || !infoPtr->bFocus) && (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTSHADOWTEXT)) ++ DrawShadowText(nmlvcd->nmcd.hdc, item->pszText, -1, &rcLabel, format, RGB(255, 255, 255), RGB(0, 0, 0), 2, 2); + else +#endif -+ DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat); ++ DrawTextW(nmlvcd->nmcd.hdc, item->pszText, -1, &rcLabel, format); + } - postpaint: - if (cdsubitemmode & CDRF_NOTIFYPOSTPAINT) -@@ -5136,7 +5134,11 @@ enddraw: + /*** +@@ -5214,7 +5212,11 @@ enddraw: /* Draw marquee rectangle if appropriate */ if (infoPtr->bMarqueeSelect) @@ -365,7 +488,7 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); -@@ -7939,6 +7941,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW +@@ -8017,6 +8019,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW { TRACE("(color=%x)\n", color); @@ -373,7 +496,7 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv if(infoPtr->clrBk != color) { if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); infoPtr->clrBk = color; -@@ -8600,7 +8603,7 @@ static DWORD LISTVIEW_SetIconSpacing(LIS +@@ -8678,7 +8681,7 @@ static DWORD LISTVIEW_SetIconSpacing(LIS return oldspacing; } @@ -382,7 +505,7 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv { INT cx, cy; -@@ -8611,8 +8614,8 @@ static inline void set_icon_size(SIZE *s +@@ -8689,8 +8692,8 @@ static inline void set_icon_size(SIZE *s } else { @@ -393,7 +516,7 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv } } -@@ -9349,6 +9352,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hw +@@ -9427,6 +9430,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hw infoPtr->clrText = CLR_DEFAULT; infoPtr->clrTextBk = CLR_DEFAULT; LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); @@ -401,7 +524,7 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv /* set default values */ infoPtr->nFocusedItem = -1; -@@ -11631,6 +11635,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg +@@ -11709,6 +11713,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); @@ -414,42 +537,41 @@ diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listv return 0; /* case WM_TIMER: */ - -diff -prudN e:\Wine\dlls\comctl32/propsheet.c e:\reactos\dll\win32\comctl32/propsheet.c ---- e:\Wine\dlls\comctl32/propsheet.c 2014-04-04 14:12:39.676987100 +0100 -+++ e:\reactos\dll\win32\comctl32/propsheet.c 2014-04-22 13:11:33.830045900 +0100 -@@ -2430,6 +2414,11 @@ static void PROPSHEET_SetWizButtons(HWND - HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); - HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); +diff -pudN E:\wine\dlls\comctl32/propsheet.c E:\reactos\dll\win32\comctl32/propsheet.c +--- E:\wine\dlls\comctl32/propsheet.c 2015-02-21 17:13:08.597542200 +0100 ++++ E:\reactos\dll\win32\comctl32/propsheet.c 2015-03-18 17:24:03.692899000 +0100 +@@ -2432,12 +2416,19 @@ static void PROPSHEET_SetWizButtons(HWND HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); + BOOL enable_finish = ((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH); + +#ifdef __REACTOS__ + HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL); + INT iDefItem = 0; + HWND hwndFocus; +#endif - ++ TRACE("%d\n", dwFlags); -@@ -2437,6 +2426,7 @@ static void PROPSHEET_SetWizButtons(HWND - EnableWindow(hwndNext, FALSE); - EnableWindow(hwndFinish, FALSE); + EnableWindow(hwndBack, dwFlags & PSWIZB_BACK); + EnableWindow(hwndNext, dwFlags & PSWIZB_NEXT); + EnableWindow(hwndFinish, enable_finish); +#ifndef __REACTOS__ /* set the default pushbutton to an enabled button */ - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + if (enable_finish) SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); -@@ -2446,6 +2436,7 @@ static void PROPSHEET_SetWizButtons(HWND +@@ -2447,6 +2438,7 @@ static void PROPSHEET_SetWizButtons(HWND SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); else SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); +#endif - - if (dwFlags & PSWIZB_BACK) -@@ -2477,6 +2468,25 @@ static void PROPSHEET_SetWizButtons(HWND + if (!psInfo->hasFinish) + { +@@ -2466,6 +2458,25 @@ static void PROPSHEET_SetWizButtons(HWND + ShowWindow(hwndNext, SW_SHOW); + } } - else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) - EnableWindow(hwndFinish, TRUE); + +#ifdef __REACTOS__ + /* set the default pushbutton to an enabled button */ @@ -472,9 +594,9 @@ diff -prudN e:\Wine\dlls\comctl32/propsheet.c e:\reactos\dll\win32\comctl32/prop } /****************************************************************************** -diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c ---- e:\Wine\dlls\comctl32/rebar.c 2014-04-04 14:12:39.678989500 +0100 -+++ e:\reactos\dll\win32\comctl32/rebar.c 2014-04-22 13:17:59.092589800 +0100 +diff -pudN E:\wine\dlls\comctl32/rebar.c E:\reactos\dll\win32\comctl32/rebar.c +--- E:\wine\dlls\comctl32/rebar.c 2015-02-21 17:13:08.597542200 +0100 ++++ E:\reactos\dll\win32\comctl32/rebar.c 2015-02-26 09:25:01.687100100 +0100 @@ -50,7 +50,6 @@ * - WM_QUERYNEWPALETTE * - WM_RBUTTONDOWN @@ -483,7 +605,78 @@ diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c * - WM_VKEYTOITEM * - WM_WININICHANGE * Notifications: -@@ -2912,12 +2896,22 @@ REBAR_ShowBand (REBAR_INFO *infoPtr, INT +@@ -1844,16 +1828,24 @@ static LRESULT REBAR_EraseBkGnd (const R + RECT cr; + COLORREF old = CLR_NONE, new; + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); ++ HRGN hrgn; + + GetClientRect (infoPtr->hwndSelf, &cr); ++ hrgn = CreateRectRgn(cr.left, cr.top, cr.right, cr.bottom); + + oldrow = -1; + for(i=0; iuNumBands; i++) { + RECT rcBand; ++ RECT rcBandReal; ++ HRGN hrgnBand; ++ + lpBand = REBAR_GetBand(infoPtr, i); ++ + if (HIDDENBAND(lpBand)) continue; + translate_rect(infoPtr, &rcBand, &lpBand->rcBand); + ++ rcBandReal = rcBand; ++ + /* draw band separator between rows */ + if (lpBand->iRow != oldrow) { + oldrow = lpBand->iRow; +@@ -1878,6 +1870,7 @@ static LRESULT REBAR_EraseBkGnd (const R + } + TRACE ("drawing band separator bottom (%s)\n", + wine_dbgstr_rect(&rcRowSep)); ++ rcBandReal = rcRowSep; + } + } + +@@ -1888,6 +1881,7 @@ static LRESULT REBAR_EraseBkGnd (const R + if (infoPtr->dwStyle & CCS_VERT) { + rcSep.bottom = rcSep.top; + rcSep.top -= SEP_WIDTH_SIZE; ++ rcBandReal.top -= SEP_WIDTH_SIZE; + if (theme) + DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL); + else +@@ -1896,6 +1890,7 @@ static LRESULT REBAR_EraseBkGnd (const R + else { + rcSep.right = rcSep.left; + rcSep.left -= SEP_WIDTH_SIZE; ++ rcBandReal.left -= SEP_WIDTH_SIZE; + if (theme) + DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL); + else +@@ -1943,7 +1938,21 @@ static LRESULT REBAR_EraseBkGnd (const R + if (lpBand->clrBack != CLR_NONE) + SetBkColor (hdc, old); + } ++ ++ hrgnBand = CreateRectRgn(rcBandReal.left, rcBandReal.top, rcBandReal.right, rcBandReal.bottom); ++ CombineRgn(hrgn, hrgn, hrgnBand, RGN_DIFF); ++ DeleteObject(hrgnBand); + } ++ ++#if 1 ++ { ++ //FIXME: Apparently painting the remaining area is a v6 feature ++ HBRUSH hbrush = CreateSolidBrush(new); ++ FillRgn(hdc, hrgn, hbrush); ++ DeleteObject(hbrush); ++ DeleteObject(hrgn); ++ } ++#endif + return TRUE; + } + +@@ -2912,12 +2921,22 @@ REBAR_ShowBand (REBAR_INFO *infoPtr, INT static LRESULT @@ -507,7 +700,7 @@ diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c return TRUE; } -@@ -3675,7 +3669,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, +@@ -3675,7 +3694,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, return REBAR_ShowBand (infoPtr, wParam, lParam); case RB_SIZETORECT: @@ -516,7 +709,7 @@ diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c /* Messages passed to parent */ -@@ -3758,6 +3752,11 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, +@@ -3758,6 +3777,11 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); @@ -528,10 +721,837 @@ diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c return 0; /* case WM_VKEYTOITEM: supported according to ControlSpy */ - -diff -prudN e:\Wine\dlls\comctl32/tooltips.c e:\reactos\dll\win32\comctl32/tooltips.c ---- e:\Wine\dlls\comctl32/tooltips.c 2014-04-04 14:12:39.707008100 +0100 -+++ e:\reactos\dll\win32\comctl32/tooltips.c 2014-04-06 12:20:33.342535700 +0100 +diff -pudN E:\wine\dlls\comctl32/toolbar.c E:\reactos\dll\win32\comctl32/toolbar.c +--- E:\wine\dlls\comctl32/toolbar.c 2015-02-21 17:13:08.617542200 +0100 ++++ E:\reactos\dll\win32\comctl32/toolbar.c 2015-03-18 17:50:35.210152200 +0100 +@@ -33,11 +33,9 @@ + * - TBSTYLE_REGISTERDROP + * - TBSTYLE_EX_DOUBLEBUFFER + * - Messages: +- * - TB_GETMETRICS + * - TB_GETOBJECT + * - TB_INSERTMARKHITTEST + * - TB_SAVERESTORE +- * - TB_SETMETRICS + * - WM_WININICHANGE + * - Notifications: + * - NM_CHAR +@@ -140,6 +124,8 @@ typedef struct + INT nOldHit; + INT nHotItem; /* index of the "hot" item */ + SIZE szPadding; /* padding values around button */ ++ SIZE szBarPadding; /* padding values around the toolbar (NOT USED BUT STORED) */ ++ SIZE szSpacing; /* spacing values between buttons */ + INT iTopMargin; /* the top margin */ + INT iListGap; /* default gap between text and image for toolbar with list style */ + HFONT hDefaultFont; +@@ -205,12 +191,18 @@ typedef enum + #define ARROW_HEIGHT 3 + #define INSERTMARK_WIDTH 2 + ++/* default padding inside a button */ + #define DEFPAD_CX 7 + #define DEFPAD_CY 6 ++ ++/* default space between buttons and between rows */ ++#define DEFSPACE_CX 7 ++#define DEFSPACE_CY 6 ++ + #define DEFLISTGAP 4 + + /* vertical padding used in list mode when image is present */ +-#define LISTPAD_CY 9 ++#define LISTPAD_CY 2 + + /* how wide to treat the bitmap if it isn't present */ + #define NONLIST_NOTEXT_OFFSET 2 +@@ -252,7 +244,12 @@ static void TOOLBAR_TooltipSetRect(const + + static inline int default_top_margin(const TOOLBAR_INFO *infoPtr) + { ++#ifndef __REACTOS__ + return (infoPtr->dwStyle & TBSTYLE_FLAT ? 0 : TOP_BORDER); ++#else /* r65766 */ ++ /* This is the behaviour in comctl32 v6 */ ++ return 0; ++#endif + } + + static inline BOOL TOOLBAR_HasDropDownArrows(DWORD exStyle) +@@ -699,10 +696,12 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *in + const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag) + { + HIMAGELIST himl = NULL; +- BOOL draw_masked = FALSE; ++ BOOL draw_masked = FALSE, draw_desaturated = FALSE; + INT index; + INT offset = 0; + UINT draw_flags = ILD_TRANSPARENT; ++ IMAGEINFO info = {0}; ++ BITMAP bm = {0}; + + if (tbcd->nmcd.uItemState & (CDIS_DISABLED | CDIS_INDETERMINATE)) + { +@@ -710,7 +709,18 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *in + if (!himl) + { + himl = TOOLBAR_GetImageListForDrawing(infoPtr, btnPtr, IMAGE_LIST_DEFAULT, &index); +- draw_masked = TRUE; ++ ++ ImageList_GetImageInfo(himl, index, &info); ++ GetObjectW(info.hbmImage, sizeof(bm), &bm); ++ ++ if (bm.bmBitsPixel == 32) ++ { ++ draw_desaturated = TRUE; ++ } ++ else ++ { ++ draw_masked = TRUE; ++ } + } + } + else if (tbcd->nmcd.uItemState & CDIS_CHECKED || +@@ -741,9 +751,34 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *in + index, himl, left, top, offset); + + if (draw_masked) ++ { ++ /* code path for drawing flat disabled icons without alpha channel */ + TOOLBAR_DrawMasked (himl, index, tbcd->nmcd.hdc, left + offset, top + offset, draw_flags); ++ } ++ else if (draw_desaturated) ++ { ++ /* code path for drawing disabled, alpha-blended (32bpp) icons */ ++ IMAGELISTDRAWPARAMS imldp = {0}; ++ ++ imldp.cbSize = sizeof(imldp); ++ imldp.himl = himl; ++ imldp.i = index; ++ imldp.hdcDst = tbcd->nmcd.hdc, ++ imldp.x = offset + left; ++ imldp.y = offset + top; ++ imldp.rgbBk = CLR_NONE; ++ imldp.rgbFg = CLR_DEFAULT; ++ imldp.fStyle = ILD_TRANSPARENT; ++ imldp.fState = ILS_ALPHA | ILS_SATURATE; ++ imldp.Frame = 192; ++ ++ ImageList_DrawIndirect (&imldp); ++ } + else ++ { ++ /* code path for drawing standard icons as-is */ + ImageList_Draw (himl, index, tbcd->nmcd.hdc, left + offset, top + offset, draw_flags); ++ } + } + + /* draws a blank frame for a toolbar button */ +@@ -862,14 +897,15 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO * + InflateRect(&rcsep, -infoPtr->szPadding.cx, -infoPtr->szPadding.cy); + TOOLBAR_DrawFlatHorizontalSeparator (&rcsep, hdc, infoPtr); + } +- else +- TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr); +- } +- else if (btnPtr->fsStyle != BTNS_SEP) { +- FIXME("Draw some kind of separator: fsStyle=%x\n", +- btnPtr->fsStyle); +- } +- return; ++ else { ++ TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr); ++ } ++ } ++ else if (btnPtr->fsStyle != BTNS_SEP) { ++ FIXME("Draw some kind of separator: fsStyle=%x\n", ++ btnPtr->fsStyle); ++ } ++ return; + } + + /* get a pointer to the text */ +@@ -1289,11 +1325,11 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPt + /* When the toolbar window style is not TBSTYLE_WRAPABLE, */ + /* no layout is necessary. Applications may use this style */ + /* to perform their own layout on the toolbar. */ +- if( !(infoPtr->dwStyle & TBSTYLE_WRAPABLE) && +- !(infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL) ) return; ++ if (!(infoPtr->dwStyle & TBSTYLE_WRAPABLE) && ++ !(infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL)) return; + + btnPtr = infoPtr->buttons; +- x = infoPtr->nIndent; ++ x = infoPtr->nIndent; + + if (GetParent(infoPtr->hwndSelf)) + { +@@ -1301,144 +1337,145 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPt + * this toolbar. We cannot use its height, as there may be multiple + * toolbars in a rebar control + */ +- GetClientRect( GetParent(infoPtr->hwndSelf), &rc ); ++ GetClientRect(GetParent(infoPtr->hwndSelf), &rc); + infoPtr->nWidth = rc.right - rc.left; + } + else + { +- GetWindowRect( infoPtr->hwndSelf, &rc ); ++ GetWindowRect(infoPtr->hwndSelf, &rc); + infoPtr->nWidth = rc.right - rc.left; + } + + bButtonWrap = FALSE; + + TRACE("start ButtonWidth=%d, BitmapWidth=%d, nWidth=%d, nIndent=%d\n", +- infoPtr->nButtonWidth, infoPtr->nBitmapWidth, infoPtr->nWidth, +- infoPtr->nIndent); ++ infoPtr->nButtonWidth, infoPtr->nBitmapWidth, infoPtr->nWidth, ++ infoPtr->nIndent); + +- for (i = 0; i < infoPtr->nNumButtons; i++ ) ++ for (i = 0; i < infoPtr->nNumButtons; i++) + { +- btnPtr[i].fsState &= ~TBSTATE_WRAP; ++ btnPtr[i].fsState &= ~TBSTATE_WRAP; + +- if (btnPtr[i].fsState & TBSTATE_HIDDEN) +- continue; ++ if (btnPtr[i].fsState & TBSTATE_HIDDEN) ++ continue; + + if (btnPtr[i].cx > 0) + cx = btnPtr[i].cx; + /* horizontal separators are treated as buttons for width */ +- else if ((btnPtr[i].fsStyle & BTNS_SEP) && +- !(infoPtr->dwStyle & CCS_VERT)) ++ else if ((btnPtr[i].fsStyle & BTNS_SEP) && ++ !(infoPtr->dwStyle & CCS_VERT)) + cx = (btnPtr[i].iBitmap > 0) ? btnPtr[i].iBitmap : SEPARATOR_WIDTH; +- else +- cx = infoPtr->nButtonWidth; ++ else ++ cx = infoPtr->nButtonWidth; + +- /* Two or more adjacent separators form a separator group. */ +- /* The first separator in a group should be wrapped to the */ +- /* next row if the previous wrapping is on a button. */ +- if( bButtonWrap && +- (btnPtr[i].fsStyle & BTNS_SEP) && +- (i + 1 < infoPtr->nNumButtons ) && +- (btnPtr[i + 1].fsStyle & BTNS_SEP) ) +- { +- TRACE("wrap point 1 btn %d style %02x\n", i, btnPtr[i].fsStyle); +- btnPtr[i].fsState |= TBSTATE_WRAP; +- x = infoPtr->nIndent; +- i++; +- bButtonWrap = FALSE; +- continue; +- } ++ /* Two or more adjacent separators form a separator group. */ ++ /* The first separator in a group should be wrapped to the */ ++ /* next row if the previous wrapping is on a button. */ ++ if (bButtonWrap && ++ (btnPtr[i].fsStyle & BTNS_SEP) && ++ (i + 1 < infoPtr->nNumButtons) && ++ (btnPtr[i + 1].fsStyle & BTNS_SEP)) ++ { ++ TRACE("wrap point 1 btn %d style %02x\n", i, btnPtr[i].fsStyle); ++ btnPtr[i].fsState |= TBSTATE_WRAP; ++ x = infoPtr->nIndent; ++ i++; ++ bButtonWrap = FALSE; ++ continue; ++ } + +- /* The layout makes sure the bitmap is visible, but not the button. */ +- /* Test added to also wrap after a button that starts a row but */ +- /* is bigger than the area. - GA 8/01 */ +- if (( x + cx - (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2 +- > infoPtr->nWidth ) || +- ((x == infoPtr->nIndent) && (cx > infoPtr->nWidth))) +- { +- BOOL bFound = FALSE; ++ /* The layout makes sure the bitmap is visible, but not the button. */ ++ /* Test added to also wrap after a button that starts a row but */ ++ /* is bigger than the area. - GA 8/01 */ ++ if ((x + cx - (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2 ++ > infoPtr->nWidth) || ++ ((x == infoPtr->nIndent) && (cx > infoPtr->nWidth))) ++ { ++ BOOL bFound = FALSE; + +- /* If the current button is a separator and not hidden, */ +- /* go to the next until it reaches a non separator. */ +- /* Wrap the last separator if it is before a button. */ +- while( ( ((btnPtr[i].fsStyle & BTNS_SEP) && +- !(btnPtr[i].fsStyle & BTNS_DROPDOWN)) || +- (btnPtr[i].fsState & TBSTATE_HIDDEN) ) && +- i < infoPtr->nNumButtons ) +- { +- i++; +- bFound = TRUE; +- } ++ /* If the current button is a separator and not hidden, */ ++ /* go to the next until it reaches a non separator. */ ++ /* Wrap the last separator if it is before a button. */ ++ while ((((btnPtr[i].fsStyle & BTNS_SEP) && ++ !(btnPtr[i].fsStyle & BTNS_DROPDOWN)) || ++ (btnPtr[i].fsState & TBSTATE_HIDDEN)) && ++ i < infoPtr->nNumButtons) ++ { ++ i++; ++ bFound = TRUE; ++ } + +- if( bFound && i < infoPtr->nNumButtons ) +- { +- i--; +- TRACE("wrap point 2 btn %d style %02x, x=%d, cx=%d\n", +- i, btnPtr[i].fsStyle, x, cx); +- btnPtr[i].fsState |= TBSTATE_WRAP; +- x = infoPtr->nIndent; +- bButtonWrap = FALSE; +- continue; +- } +- else if ( i >= infoPtr->nNumButtons) +- break; ++ if (bFound && i < infoPtr->nNumButtons) ++ { ++ i--; ++ TRACE("wrap point 2 btn %d style %02x, x=%d, cx=%d\n", ++ i, btnPtr[i].fsStyle, x, cx); ++ btnPtr[i].fsState |= TBSTATE_WRAP; ++ x = infoPtr->nIndent; ++ bButtonWrap = FALSE; ++ continue; ++ } ++ else if (i >= infoPtr->nNumButtons) ++ break; + +- /* If the current button is not a separator, find the last */ +- /* separator and wrap it. */ +- for ( j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--) +- { +- if ((btnPtr[j].fsStyle & BTNS_SEP) && +- !(btnPtr[j].fsState & TBSTATE_HIDDEN)) +- { +- bFound = TRUE; +- i = j; +- TRACE("wrap point 3 btn %d style %02x, x=%d, cx=%d\n", +- i, btnPtr[i].fsStyle, x, cx); +- x = infoPtr->nIndent; +- btnPtr[j].fsState |= TBSTATE_WRAP; +- bButtonWrap = FALSE; +- break; +- } +- } ++ /* If the current button is not a separator, find the last */ ++ /* separator and wrap it. */ ++ for (j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--) ++ { ++ if ((btnPtr[j].fsStyle & BTNS_SEP) && ++ !(btnPtr[j].fsState & TBSTATE_HIDDEN)) ++ { ++ bFound = TRUE; ++ i = j; ++ TRACE("wrap point 3 btn %d style %02x, x=%d, cx=%d\n", ++ i, btnPtr[i].fsStyle, x, cx); ++ x = infoPtr->nIndent; ++ btnPtr[j].fsState |= TBSTATE_WRAP; ++ bButtonWrap = FALSE; ++ break; ++ } ++ } + +- /* If no separator available for wrapping, wrap one of */ +- /* non-hidden previous button. */ +- if (!bFound) +- { +- for ( j = i - 1; +- j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--) +- { +- if (btnPtr[j].fsState & TBSTATE_HIDDEN) +- continue; ++ /* If no separator available for wrapping, wrap one of */ ++ /* non-hidden previous button. */ ++ if (!bFound) ++ { ++ for (j = i - 1; ++ j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--) ++ { ++ if (btnPtr[j].fsState & TBSTATE_HIDDEN) ++ continue; + +- bFound = TRUE; +- i = j; +- TRACE("wrap point 4 btn %d style %02x, x=%d, cx=%d\n", +- i, btnPtr[i].fsStyle, x, cx); +- x = infoPtr->nIndent; +- btnPtr[j].fsState |= TBSTATE_WRAP; +- bButtonWrap = TRUE; +- break; +- } +- } ++ bFound = TRUE; ++ i = j; ++ TRACE("wrap point 4 btn %d style %02x, x=%d, cx=%d\n", ++ i, btnPtr[i].fsStyle, x, cx); ++ x = infoPtr->nIndent; ++ btnPtr[j].fsState |= TBSTATE_WRAP; ++ bButtonWrap = TRUE; ++ break; ++ } ++ } + +- /* If all above failed, wrap the current button. */ +- if (!bFound) +- { +- TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n", +- i, btnPtr[i].fsStyle, x, cx); +- btnPtr[i].fsState |= TBSTATE_WRAP; +- x = infoPtr->nIndent; +- if (btnPtr[i].fsStyle & BTNS_SEP ) +- bButtonWrap = FALSE; +- else +- bButtonWrap = TRUE; +- } +- } +- else { +- TRACE("wrap point 6 btn %d style %02x, x=%d, cx=%d\n", +- i, btnPtr[i].fsStyle, x, cx); +- x += cx; +- } ++ /* If all above failed, wrap the current button. */ ++ if (!bFound) ++ { ++ TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n", ++ i, btnPtr[i].fsStyle, x, cx); ++ btnPtr[i].fsState |= TBSTATE_WRAP; ++ x = infoPtr->nIndent; ++ if (btnPtr[i].fsStyle & BTNS_SEP) ++ bButtonWrap = FALSE; ++ else ++ bButtonWrap = TRUE; ++ } ++ } ++ else ++ { ++ TRACE("wrap point 6 btn %d style %02x, x=%d, cx=%d\n", ++ i, btnPtr[i].fsStyle, x, cx); ++ x += cx; ++ } + } + } + +@@ -1564,9 +1601,8 @@ static inline SIZE TOOLBAR_MeasureButton + /* ... add on the necessary padding */ + if (bValidImageList) + { +- if (bHasBitmap) +- sizeButton.cy += DEFPAD_CY; +- else ++ sizeButton.cy += infoPtr->szPadding.cy; ++ if (!bHasBitmap) + sizeButton.cy += LISTPAD_CY; + } + else +@@ -1583,7 +1619,7 @@ static inline SIZE TOOLBAR_MeasureButton + { + if (bHasBitmap) + { +- sizeButton.cy = infoPtr->nBitmapHeight + DEFPAD_CY; ++ sizeButton.cy = infoPtr->nBitmapHeight + infoPtr->szPadding.cy; + if (sizeString.cy > 0) + sizeButton.cy += 1 + sizeString.cy; + sizeButton.cx = infoPtr->szPadding.cx + +@@ -1640,17 +1676,17 @@ static void + TOOLBAR_LayoutToolbar(TOOLBAR_INFO *infoPtr) + { + 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); ++ 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(infoPtr); + +- x = infoPtr->nIndent; +- y = infoPtr->iTopMargin; ++ x = infoPtr->nIndent; ++ y = infoPtr->iTopMargin; + cx = infoPtr->nButtonWidth; + cy = infoPtr->nButtonHeight; + +@@ -1665,106 +1701,112 @@ TOOLBAR_LayoutToolbar(TOOLBAR_INFO *info + + TRACE("cy=%d\n", cy); + +- for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++ ) ++ for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) + { +- bWrap = FALSE; +- if (btnPtr->fsState & TBSTATE_HIDDEN) +- { +- SetRectEmpty (&btnPtr->rect); +- continue; +- } ++ bWrap = FALSE; ++ if (btnPtr->fsState & TBSTATE_HIDDEN) ++ { ++ SetRectEmpty(&btnPtr->rect); ++ continue; ++ } + +- cy = infoPtr->nButtonHeight; ++ cy = infoPtr->nButtonHeight; + +- if (btnPtr->fsStyle & BTNS_SEP) { +- if (infoPtr->dwStyle & CCS_VERT) { ++ if (btnPtr->fsStyle & BTNS_SEP) ++ { ++ if (infoPtr->dwStyle & CCS_VERT) ++ { + cy = (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH; + cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nButtonWidth; +- } +- else ++ } ++ else ++ { + cx = (btnPtr->cx > 0) ? btnPtr->cx : + (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH; +- } +- else +- { ++ } ++ } ++ else ++ { + if (btnPtr->cx) +- cx = btnPtr->cx; +- else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || +- (btnPtr->fsStyle & BTNS_AUTOSIZE)) + { +- SIZE sz; +- HDC hdc; +- HFONT hOldFont; ++ cx = btnPtr->cx; ++ } ++ else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || ++ (btnPtr->fsStyle & BTNS_AUTOSIZE)) ++ { ++ SIZE sz; ++ HDC hdc; ++ HFONT hOldFont; + +- hdc = GetDC (infoPtr->hwndSelf); +- hOldFont = SelectObject (hdc, infoPtr->hFont); ++ hdc = GetDC(infoPtr->hwndSelf); ++ hOldFont = SelectObject(hdc, infoPtr->hFont); + +- TOOLBAR_MeasureString(infoPtr, btnPtr, hdc, &sz); ++ TOOLBAR_MeasureString(infoPtr, btnPtr, hdc, &sz); + +- SelectObject (hdc, hOldFont); +- ReleaseDC (infoPtr->hwndSelf, hdc); ++ SelectObject(hdc, hOldFont); ++ ReleaseDC(infoPtr->hwndSelf, hdc); + +- sizeButton = TOOLBAR_MeasureButton(infoPtr, sz, +- TOOLBAR_IsValidBitmapIndex(infoPtr, infoPtr->buttons[i].iBitmap), +- validImageList); +- cx = sizeButton.cx; ++ sizeButton = TOOLBAR_MeasureButton(infoPtr, sz, ++ TOOLBAR_IsValidBitmapIndex(infoPtr, infoPtr->buttons[i].iBitmap), ++ validImageList); ++ cx = sizeButton.cx; + } + else +- cx = infoPtr->nButtonWidth; ++ cx = infoPtr->nButtonWidth; + + /* if size has been set manually then don't add on extra space + * for the drop down arrow */ +- if (!btnPtr->cx && hasDropDownArrows && ++ if (!btnPtr->cx && hasDropDownArrows && + ((btnPtr->fsStyle & BTNS_DROPDOWN) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN))) +- cx += DDARROW_WIDTH; +- } +- if (btnPtr->fsState & TBSTATE_WRAP ) +- bWrap = TRUE; ++ cx += DDARROW_WIDTH; ++ } ++ if (btnPtr->fsState & TBSTATE_WRAP) ++ bWrap = TRUE; + +- SetRect (&btnPtr->rect, x, y, x + cx, y + cy); ++ SetRect(&btnPtr->rect, x, y, x + cx, y + cy); + +- if (infoPtr->rcBound.left > x) +- infoPtr->rcBound.left = x; +- if (infoPtr->rcBound.right < x + cx) +- infoPtr->rcBound.right = x + cx; +- if (infoPtr->rcBound.bottom < y + cy) +- infoPtr->rcBound.bottom = y + cy; ++ if (infoPtr->rcBound.left > x) ++ infoPtr->rcBound.left = x; ++ if (infoPtr->rcBound.right < x + cx) ++ infoPtr->rcBound.right = x + cx; ++ if (infoPtr->rcBound.bottom < y + cy) ++ infoPtr->rcBound.bottom = y + cy; + + TOOLBAR_TooltipSetRect(infoPtr, btnPtr); + +- /* btnPtr->nRow is zero based. The space between the rows is */ +- /* also considered as a row. */ +- btnPtr->nRow = nRows + nSepRows; ++ /* btnPtr->nRow is zero based. The space between the rows is */ ++ /* also considered as a row. */ ++ btnPtr->nRow = nRows + nSepRows; + +- TRACE("button %d style=%x, bWrap=%d, nRows=%d, nSepRows=%d, btnrow=%d, (%d,%d)-(%d,%d)\n", +- i, btnPtr->fsStyle, bWrap, nRows, nSepRows, btnPtr->nRow, +- x, y, x+cx, y+cy); ++ TRACE("button %d style=%x, bWrap=%d, nRows=%d, nSepRows=%d, btnrow=%d, (%d,%d)-(%d,%d)\n", ++ i, btnPtr->fsStyle, bWrap, nRows, nSepRows, btnPtr->nRow, ++ x, y, x + cx, y + cy); + +- if( bWrap ) +- { +- if ( !(btnPtr->fsStyle & BTNS_SEP) ) +- y += cy; +- else +- { +- if ( !(infoPtr->dwStyle & CCS_VERT)) +- y += cy + ( (btnPtr->cx > 0 ) ? +- btnPtr->cx : SEPARATOR_WIDTH) * 2 /3; +- else +- y += cy; ++ if (bWrap) ++ { ++ if (!(btnPtr->fsStyle & BTNS_SEP)) ++ y += cy; ++ else ++ { ++ if (!(infoPtr->dwStyle & CCS_VERT)) ++ y += cy + ((btnPtr->cx > 0) ? ++ btnPtr->cx : SEPARATOR_WIDTH) * 2 / 3; ++ else ++ y += cy; + +- /* nSepRows is used to calculate the extra height following */ +- /* the last row. */ +- nSepRows++; +- } +- x = infoPtr->nIndent; ++ /* nSepRows is used to calculate the extra height following */ ++ /* the last row. */ ++ nSepRows++; ++ } ++ x = infoPtr->nIndent; + +- /* Increment row number unless this is the last button */ +- /* and it has Wrap set. */ +- if (i != infoPtr->nNumButtons-1) +- nRows++; +- } +- else +- x += cx; ++ /* Increment row number unless this is the last button */ ++ /* and it has Wrap set. */ ++ if (i != infoPtr->nNumButtons - 1) ++ nRows++; ++ } ++ else ++ x += cx; + } + + /* infoPtr->nRows is the number of rows on the toolbar */ +@@ -1954,6 +1996,16 @@ TOOLBAR_RelayEvent (HWND hwndTip, HWND h + SendMessageW (hwndTip, TTM_RELAYEVENT, 0, (LPARAM)&msg); + } + ++ ++static LRESULT ++TOOLBAR_ThemeChanged(HWND hwnd) ++{ ++ HTHEME theme = GetWindowTheme(hwnd); ++ CloseThemeData(theme); ++ OpenThemeData(hwnd, themeClass); ++ return 0; ++} ++ + static void + TOOLBAR_TooltipAddTool(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *button) + { +@@ -3543,6 +3595,36 @@ TOOLBAR_GetMaxSize (const TOOLBAR_INFO * + } + + ++static LRESULT ++TOOLBAR_GetMetrics (const TOOLBAR_INFO *infoPtr, TBMETRICS *pMetrics) ++{ ++ if (pMetrics == NULL) ++ return FALSE; ++ ++ /* TODO: check if cbSize is a valid value */ ++ ++ if (pMetrics->dwMask & TBMF_PAD) ++ { ++ pMetrics->cxPad = infoPtr->szPadding.cx; ++ pMetrics->cyPad = infoPtr->szPadding.cy; ++ } ++ ++ if (pMetrics->dwMask & TBMF_BARPAD) ++ { ++ pMetrics->cxBarPad = infoPtr->szBarPadding.cx; ++ pMetrics->cyBarPad = infoPtr->szBarPadding.cy; ++ } ++ ++ if (pMetrics->dwMask & TBMF_BUTTONSPACING) ++ { ++ pMetrics->cxButtonSpacing = infoPtr->szSpacing.cx; ++ pMetrics->cyButtonSpacing = infoPtr->szSpacing.cy; ++ } ++ ++ return TRUE; ++} ++ ++ + /* << TOOLBAR_GetObject >> */ + + +@@ -4724,6 +4806,43 @@ TOOLBAR_SetMaxTextRows (TOOLBAR_INFO *in + } + + ++static LRESULT ++TOOLBAR_SetMetrics (TOOLBAR_INFO *infoPtr, TBMETRICS *pMetrics) ++{ ++ BOOL changed = FALSE; ++ ++ if (!pMetrics) ++ return FALSE; ++ ++ /* TODO: check if cbSize is a valid value */ ++ ++ if (pMetrics->dwMask & TBMF_PAD) ++ { ++ infoPtr->szPadding.cx = pMetrics->cxPad; ++ infoPtr->szPadding.cy = pMetrics->cyPad; ++ changed = TRUE; ++ } ++ ++ if (pMetrics->dwMask & TBMF_PAD) ++ { ++ infoPtr->szBarPadding.cx = pMetrics->cxBarPad; ++ infoPtr->szBarPadding.cy = pMetrics->cyBarPad; ++ changed = TRUE; ++ } ++ ++ if (pMetrics->dwMask & TBMF_BUTTONSPACING) ++ { ++ infoPtr->szSpacing.cx = pMetrics->cxButtonSpacing; ++ infoPtr->szSpacing.cy = pMetrics->cyButtonSpacing; ++ changed = TRUE; ++ } ++ ++ if (changed) ++ TOOLBAR_CalcToolbar(infoPtr); ++ ++ return TRUE; ++} ++ + /* MSDN gives slightly wrong info on padding. + * 1. It is not only used on buttons with the BTNS_AUTOSIZE style + * 2. It is not used to create a blank area between the edge of the button +@@ -5937,6 +6056,8 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wPar + infoPtr->clrBtnShadow = CLR_DEFAULT; + infoPtr->szPadding.cx = DEFPAD_CX; + infoPtr->szPadding.cy = DEFPAD_CY; ++ infoPtr->szSpacing.cx = DEFSPACE_CX; ++ infoPtr->szSpacing.cy = DEFSPACE_CY; + infoPtr->iListGap = DEFLISTGAP; + infoPtr->iTopMargin = default_top_margin(infoPtr); + infoPtr->dwStyle = lpcs->style; +@@ -6370,16 +6491,6 @@ TOOLBAR_SysColorChange (void) + } + + +-/* update theme after a WM_THEMECHANGED message */ +-static LRESULT theme_changed (HWND hwnd) +-{ +- HTHEME theme = GetWindowTheme (hwnd); +- CloseThemeData (theme); +- OpenThemeData (hwnd, themeClass); +- return 0; +-} +- +- + static LRESULT WINAPI + ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) + { +@@ -6483,6 +6594,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, + + case TB_GETMAXSIZE: + return TOOLBAR_GetMaxSize (infoPtr, (LPSIZE)lParam); ++ ++ case TB_GETMETRICS: ++ return TOOLBAR_GetMetrics (infoPtr, (TBMETRICS*)lParam); + + /* case TB_GETOBJECT: */ /* 4.71 */ + +@@ -6499,7 +6613,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, + return TOOLBAR_GetState (infoPtr, wParam); + + case TB_GETSTRINGA: +- return TOOLBAR_GetStringA (infoPtr, wParam, (LPSTR)lParam); ++ return TOOLBAR_GetStringA (infoPtr, wParam, (LPSTR)lParam); + + case TB_GETSTRINGW: + return TOOLBAR_GetStringW (infoPtr, wParam, (LPWSTR)lParam); +@@ -6624,6 +6738,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, + case TB_SETMAXTEXTROWS: + return TOOLBAR_SetMaxTextRows (infoPtr, wParam); + ++ case TB_SETMETRICS: ++ return TOOLBAR_SetMetrics (infoPtr, (TBMETRICS*)lParam); ++ + case TB_SETPADDING: + return TOOLBAR_SetPadding (infoPtr, lParam); + +@@ -6749,7 +6866,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, + return TOOLBAR_SetFocus (infoPtr); + + case WM_SETFONT: +- return TOOLBAR_SetFont(infoPtr, (HFONT)wParam, (WORD)lParam); ++ return TOOLBAR_SetFont(infoPtr, (HFONT)wParam, (WORD)lParam); + + case WM_SETREDRAW: + return TOOLBAR_SetRedraw (infoPtr, wParam); +@@ -6763,8 +6880,8 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, + case WM_SYSCOLORCHANGE: + return TOOLBAR_SysColorChange (); + +- case WM_THEMECHANGED: +- return theme_changed (hwnd); ++ case WM_THEMECHANGED: ++ return TOOLBAR_ThemeChanged(hwnd); + + /* case WM_WININICHANGE: */ + +diff -pudN E:\wine\dlls\comctl32/tooltips.c E:\reactos\dll\win32\comctl32/tooltips.c +--- E:\wine\dlls\comctl32/tooltips.c 2015-02-21 17:13:08.617542200 +0100 ++++ E:\reactos\dll\win32\comctl32/tooltips.c 2015-03-18 18:00:07.323512400 +0100 @@ -2007,7 +1994,32 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO static LRESULT TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam) @@ -566,10 +1586,10 @@ diff -prudN e:\Wine\dlls\comctl32/tooltips.c e:\reactos\dll\win32\comctl32/toolt return 0; } -diff -prudN e:\Wine\dlls\comctl32/treeview.c e:\reactos\dll\win32\comctl32/treeview.c ---- e:\Wine\dlls\comctl32/treeview.c 2014-04-04 14:12:39.709009500 +0100 -+++ e:\reactos\dll\win32\comctl32/treeview.c 2014-04-06 12:22:08.977839700 +0100 -@@ -2921,7 +2899,12 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, +diff -pudN E:\wine\dlls\comctl32/treeview.c E:\reactos\dll\win32\comctl32/treeview.c +--- E:\wine\dlls\comctl32/treeview.c 2015-02-21 17:13:08.621542200 +0100 ++++ E:\reactos\dll\win32\comctl32/treeview.c 2014-09-27 00:41:17.418102200 +0100 +@@ -2890,7 +2868,12 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, } } diff --git a/reactos/dll/win32/comctl32/comctl32undoc.c b/reactos/dll/win32/comctl32/comctl32undoc.c index 6c6cc77ba59..b12f6144124 100644 --- a/reactos/dll/win32/comctl32/comctl32undoc.c +++ b/reactos/dll/win32/comctl32/comctl32undoc.c @@ -666,8 +666,8 @@ static HANDLE create_mru_list(LPWINEMRULIST mp) /* get values from key 'MRUList' */ if (newkey) { datasize = (mp->extview.uMax + 1) * sizeof(WCHAR); - if((err=RegQueryValueExW( newkey, strMRUList, 0, &type, - (LPBYTE)mp->realMRU, &datasize))) { + if (RegQueryValueExW( newkey, strMRUList, 0, &type, + (LPBYTE)mp->realMRU, &datasize)) { /* not present - set size to 1 (will become 0 later) */ datasize = 1; *mp->realMRU = 0; diff --git a/reactos/dll/win32/comctl32/commctrl.c b/reactos/dll/win32/comctl32/commctrl.c index f8b8ab0fc95..086a92eafee 100644 --- a/reactos/dll/win32/comctl32/commctrl.c +++ b/reactos/dll/win32/comctl32/commctrl.c @@ -1808,6 +1808,15 @@ HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnBu return S_OK; } +/*********************************************************************** + * LoadIconWithScaleDown [COMCTL32.@] + */ +HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, PCWSTR name, int cx, int cy, HICON *icon) +{ + FIXME("stub: %p %s %d %d %p\n", hinst, wine_dbgstr_w(name), cx, cy, icon); + return E_NOTIMPL; +} + /*********************************************************************** * RegisterClassNameW [COMCTL32.@] * diff --git a/reactos/dll/win32/comctl32/header.c b/reactos/dll/win32/comctl32/header.c index ba20b177098..50733fbe325 100644 --- a/reactos/dll/win32/comctl32/header.c +++ b/reactos/dll/win32/comctl32/header.c @@ -378,10 +378,7 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU if (ret) return phdi->rect.right; } else - { - HEADER_FillItemFrame(infoPtr, hdc, &r, phdi, bHotTrack); HEADER_DrawItemFrame(infoPtr, hdc, &r, phdi); - } if (phdi->bDown) { r.left += 2; @@ -399,7 +396,7 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU BITMAP bmp; HEADER_PrepareCallbackItems(infoPtr, iItem, HDI_TEXT|HDI_IMAGE); - cw = tw = iw = bw = 0; + cw = iw = bw = 0; rw = r.right - r.left; rh = r.bottom - r.top; diff --git a/reactos/dll/win32/comctl32/imagelist.c b/reactos/dll/win32/comctl32/imagelist.c index 6a017d3d580..416c124304c 100644 --- a/reactos/dll/win32/comctl32/imagelist.c +++ b/reactos/dll/win32/comctl32/imagelist.c @@ -586,6 +586,7 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack, INT dxHotspot, INT dyHotspot) { INT cx, cy; + POINT src, dst; TRACE("(himlTrack=%p iTrack=%d dx=%d dy=%d)\n", himlTrack, iTrack, dxHotspot, dyHotspot); @@ -593,8 +594,11 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack, if (!is_valid(himlTrack)) return FALSE; + if (iTrack >= himlTrack->cCurImage) + return FALSE; + if (InternalDrag.himl) - ImageList_EndDrag (); + return FALSE; cx = himlTrack->cx; cy = himlTrack->cy; @@ -609,10 +613,12 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack, InternalDrag.dyHotspot = dyHotspot; /* copy image */ - BitBlt (InternalDrag.himl->hdcImage, 0, 0, cx, cy, himlTrack->hdcImage, iTrack * cx, 0, SRCCOPY); - - /* copy mask */ - BitBlt (InternalDrag.himl->hdcMask, 0, 0, cx, cy, himlTrack->hdcMask, iTrack * cx, 0, SRCCOPY); + imagelist_point_from_index(InternalDrag.himl, 0, &dst); + imagelist_point_from_index(himlTrack, iTrack, &src); + BitBlt(InternalDrag.himl->hdcImage, dst.x, dst.y, cx, cy, himlTrack->hdcImage, src.x, src.y, + SRCCOPY); + BitBlt(InternalDrag.himl->hdcMask, dst.x, dst.y, cx, cy, himlTrack->hdcMask, src.x, src.y, + SRCCOPY); InternalDrag.himl->cCurImage = 1; diff --git a/reactos/dll/win32/comctl32/ipaddress.c b/reactos/dll/win32/comctl32/ipaddress.c index 35e7f06eab8..a7a7ef36f16 100644 --- a/reactos/dll/win32/comctl32/ipaddress.c +++ b/reactos/dll/win32/comctl32/ipaddress.c @@ -136,36 +136,64 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) static const WCHAR dotW[] = { '.', 0 }; RECT rect, rcPart; COLORREF bgCol, fgCol; - int i; + HTHEME theme; + int i, state = ETS_NORMAL; TRACE("\n"); GetClientRect (infoPtr->Self, &rect); - if (infoPtr->Enabled) { - bgCol = comctl32_color.clrWindow; - fgCol = comctl32_color.clrWindowText; + theme = OpenThemeData(infoPtr->Self, WC_EDITW); + + if (theme) { + DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE); + + if (!infoPtr->Enabled) + state = ETS_DISABLED; + else if (dwStyle & ES_READONLY) + state = ETS_READONLY; + else if (GetFocus() == infoPtr->Self) + state = ETS_FOCUSED; + + GetThemeColor(theme, EP_EDITTEXT, state, TMT_FILLCOLOR, &bgCol); + GetThemeColor(theme, EP_EDITTEXT, state, TMT_TEXTCOLOR, &fgCol); + + if (IsThemeBackgroundPartiallyTransparent (theme, EP_EDITTEXT, state)) + DrawThemeParentBackground(infoPtr->Self, hdc, &rect); + DrawThemeBackground (theme, hdc, EP_EDITTEXT, state, &rect, 0); } else { - bgCol = comctl32_color.clr3dFace; - fgCol = comctl32_color.clrGrayText; + if (infoPtr->Enabled) { + bgCol = comctl32_color.clrWindow; + fgCol = comctl32_color.clrWindowText; + } else { + bgCol = comctl32_color.clr3dFace; + fgCol = comctl32_color.clrGrayText; + } + + FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); + DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); } - FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); - DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); - SetBkColor (hdc, bgCol); SetTextColor(hdc, fgCol); for (i = 0; i < 3; i++) { GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart); MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); - rect.left = rcPart.right; - GetWindowRect (infoPtr->Part[i+1].EditHwnd, &rcPart); + rect.left = rcPart.right; + GetWindowRect (infoPtr->Part[i+1].EditHwnd, &rcPart); MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); - rect.right = rcPart.left; - DrawTextW(hdc, dotW, 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); + rect.right = rcPart.left; + + if (theme) + DrawThemeText(theme, hdc, EP_EDITTEXT, state, dotW, 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, &rect); + else + DrawTextW(hdc, dotW, 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); } + if (theme) + CloseThemeData(theme); + return 0; } diff --git a/reactos/dll/win32/comctl32/listview.c b/reactos/dll/win32/comctl32/listview.c index 73d0fb5d6a7..e28f418628f 100644 --- a/reactos/dll/win32/comctl32/listview.c +++ b/reactos/dll/win32/comctl32/listview.c @@ -3998,10 +3998,7 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN rect.top = rect.bottom = infoPtr->ptClickPos.y; InflateRect(&rect, GetSystemMetrics(SM_CXDRAG), GetSystemMetrics(SM_CYDRAG)); - } - if (infoPtr->bLButtonDown) - { if (infoPtr->bMarqueeSelect) { POINT coords_orig; diff --git a/reactos/dll/win32/comctl32/progress.c b/reactos/dll/win32/comctl32/progress.c index 18aa4c99dd3..c83a8dea598 100644 --- a/reactos/dll/win32/comctl32/progress.c +++ b/reactos/dll/win32/comctl32/progress.c @@ -269,23 +269,33 @@ static void draw_theme_bar_V (const ProgressDrawInfo* di, int start, int end) /* draw themed horizontal background from 'start' to 'end' */ static void draw_theme_bkg_H (const ProgressDrawInfo* di, int start, int end) { - RECT r; + RECT bgrect, r; + r.left = di->rect.left + start; r.top = di->rect.top; r.right = di->rect.left + end; r.bottom = di->rect.bottom; - DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &di->bgRect, &r); + + bgrect = di->bgRect; + OffsetRect(&bgrect, -bgrect.left, -bgrect.top); + + DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &bgrect, &r); } /* draw themed vertical background from 'start' to 'end' */ static void draw_theme_bkg_V (const ProgressDrawInfo* di, int start, int end) { - RECT r; + RECT bgrect, r; + r.left = di->rect.left; r.top = di->rect.bottom - end; r.right = di->rect.right; r.bottom = di->rect.bottom - start; - DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &di->bgRect, &r); + + bgrect = di->bgRect; + OffsetRect(&bgrect, -bgrect.left, -bgrect.top); + + DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &bgrect, &r); } /* drawing functions for themed style */ diff --git a/reactos/dll/win32/comctl32/propsheet.c b/reactos/dll/win32/comctl32/propsheet.c index 23a5e91f5b4..d70cf351adc 100644 --- a/reactos/dll/win32/comctl32/propsheet.c +++ b/reactos/dll/win32/comctl32/propsheet.c @@ -2414,6 +2414,8 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); + BOOL enable_finish = ((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH); + #ifdef __REACTOS__ HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL); INT iDefItem = 0; @@ -2422,13 +2424,13 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) TRACE("%d\n", dwFlags); - EnableWindow(hwndBack, FALSE); - EnableWindow(hwndNext, FALSE); - EnableWindow(hwndFinish, FALSE); + EnableWindow(hwndBack, dwFlags & PSWIZB_BACK); + EnableWindow(hwndNext, dwFlags & PSWIZB_NEXT); + EnableWindow(hwndFinish, enable_finish); #ifndef __REACTOS__ /* set the default pushbutton to an enabled button */ - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + if (enable_finish) SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); else if (dwFlags & PSWIZB_NEXT) SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); @@ -2438,13 +2440,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); #endif - - if (dwFlags & PSWIZB_BACK) - EnableWindow(hwndBack, TRUE); - - if (dwFlags & PSWIZB_NEXT) - EnableWindow(hwndNext, TRUE); - if (!psInfo->hasFinish) { if ((dwFlags & PSWIZB_FINISH) || (dwFlags & PSWIZB_DISABLEDFINISH)) @@ -2454,9 +2449,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) /* Show the Finish button */ ShowWindow(hwndFinish, SW_SHOW); - - if (!(dwFlags & PSWIZB_DISABLEDFINISH)) - EnableWindow(hwndFinish, TRUE); } else { @@ -2466,8 +2458,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) ShowWindow(hwndNext, SW_SHOW); } } - else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) - EnableWindow(hwndFinish, TRUE); #ifdef __REACTOS__ /* set the default pushbutton to an enabled button */ diff --git a/reactos/dll/win32/comctl32/string.c b/reactos/dll/win32/comctl32/string.c index 0437cad522d..3a9b2f9ca84 100644 --- a/reactos/dll/win32/comctl32/string.c +++ b/reactos/dll/win32/comctl32/string.c @@ -275,7 +275,7 @@ LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch) * PARAMS * lpszStr [I] First string to compare * lpszComp [I] Second string to compare - * iLen [I] Maximum number of chars to compare. + * iLen [I] Number of chars to compare * * RETURNS * An integer less than, equal to or greater than 0, indicating that @@ -307,13 +307,15 @@ static LPSTR COMCTL32_StrStrHelperA(LPCSTR lpszStr, LPCSTR lpszSearch, INT (WINAPI *pStrCmpFn)(LPCSTR,LPCSTR,INT)) { size_t iLen; + LPCSTR end; if (!lpszStr || !lpszSearch || !*lpszSearch) return NULL; iLen = strlen(lpszSearch); + end = lpszStr + strlen(lpszStr); - while (*lpszStr) + while (lpszStr + iLen <= end) { if (!pStrCmpFn(lpszStr, lpszSearch, iLen)) return (LPSTR)lpszStr; @@ -366,6 +368,7 @@ INT WINAPI StrToIntA (LPCSTR lpszStr) LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch) { int iLen; + LPCWSTR end; TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch)); @@ -373,8 +376,9 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch) return NULL; iLen = strlenW(lpszSearch); + end = lpszStr + strlenW(lpszStr); - while (*lpszStr) + while (lpszStr + iLen <= end) { if (!StrCmpNIW(lpszStr, lpszSearch, iLen)) return (LPWSTR)lpszStr; @@ -464,7 +468,7 @@ LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch) * PARAMS * lpszStr [I] First string to compare * lpszComp [I] Second string to compare - * iLen [I] Maximum number of chars to compare. + * iLen [I] Number of chars to compare * * RETURNS * An integer less than, equal to or greater than 0, indicating that @@ -654,18 +658,20 @@ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch) if (!lpszStr || !lpszSearch || !*lpszSearch) return NULL; - if (!lpszEnd) - lpszEnd = lpszStr + lstrlenA(lpszStr); - if (IsDBCSLeadByte(*lpszSearch)) - ch1 = *lpszSearch << 8 | lpszSearch[1]; + ch1 = *lpszSearch << 8 | (UCHAR)lpszSearch[1]; else ch1 = *lpszSearch; iLen = lstrlenA(lpszSearch); - while (lpszStr <= lpszEnd && *lpszStr) + if (!lpszEnd) + lpszEnd = lpszStr + lstrlenA(lpszStr); + else /* reproduce the broken behaviour on Windows */ + lpszEnd += min(iLen - 1, lstrlenA(lpszEnd)); + + while (lpszStr + iLen <= lpszEnd && *lpszStr) { - ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | lpszStr[1] : *lpszStr; + ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | (UCHAR)lpszStr[1] : *lpszStr; if (!COMCTL32_ChrCmpIA(ch1, ch2)) { if (!StrCmpNIA(lpszStr, lpszSearch, iLen)) @@ -691,12 +697,15 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch) if (!lpszStr || !lpszSearch || !*lpszSearch) return NULL; - if (!lpszEnd) - lpszEnd = lpszStr + strlenW(lpszStr); - iLen = strlenW(lpszSearch); - while (lpszStr <= lpszEnd && *lpszStr) + if (!lpszEnd) + lpszEnd = lpszStr + strlenW(lpszStr); + else /* reproduce the broken behaviour on Windows */ + lpszEnd += min(iLen - 1, lstrlenW(lpszEnd)); + + + while (lpszStr + iLen <= lpszEnd && *lpszStr) { if (!COMCTL32_ChrCmpIW(*lpszSearch, *lpszStr)) { @@ -839,16 +848,15 @@ int WINAPI StrCSpnW(LPCWSTR lpszStr, LPCWSTR lpszMatch) BOOL WINAPI IntlStrEqWorkerA(BOOL bCase, LPCSTR lpszStr, LPCSTR lpszComp, int iLen) { - DWORD dwFlags = LOCALE_USE_CP_ACP; + DWORD dwFlags; int iRet; TRACE("(%d,%s,%s,%d)\n", bCase, debugstr_a(lpszStr), debugstr_a(lpszComp), iLen); /* FIXME: This flag is undocumented and unknown by our CompareString. - * We need a define for it. */ - dwFlags = 0x10000000; + dwFlags = LOCALE_RETURN_GENITIVE_NAMES; if (!bCase) dwFlags |= NORM_IGNORECASE; iRet = CompareStringA(GetThreadLocale(), @@ -875,9 +883,8 @@ BOOL WINAPI IntlStrEqWorkerW(BOOL bCase, LPCWSTR lpszStr, LPCWSTR lpszComp, debugstr_w(lpszStr),debugstr_w(lpszComp), iLen); /* FIXME: This flag is undocumented and unknown by our CompareString. - * We need a define for it. */ - dwFlags = 0x10000000; + dwFlags = LOCALE_RETURN_GENITIVE_NAMES; if (!bCase) dwFlags |= NORM_IGNORECASE; iRet = CompareStringW(GetThreadLocale(), diff --git a/reactos/dll/win32/comctl32/syslink.c b/reactos/dll/win32/comctl32/syslink.c index 75085197e5e..483fd11c84a 100644 --- a/reactos/dll/win32/comctl32/syslink.c +++ b/reactos/dll/win32/comctl32/syslink.c @@ -173,6 +173,26 @@ static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr) infoPtr->Items = NULL; } +/*********************************************************************** + * SYSLINK_StrCmpNIW + * Wrapper for StrCmpNIW to ensure 'len' is not too big. + */ +static INT SYSLINK_StrCmpNIW (LPCWSTR str, LPCWSTR comp, INT len) +{ + INT i; + + for(i = 0; i < len; i++) + { + if(!str[i]) + { + len = i + 1; + break; + } + } + + return StrCmpNIW(str, comp, len); +} + /*********************************************************************** * SYSLINK_ParseText * Parses the window text string and creates a document. Returns the @@ -193,7 +213,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text) { if(*current == '<') { - if(!StrCmpNIW(current, SL_LINKOPEN, 2) && (CurrentType == slText)) + if(!SYSLINK_StrCmpNIW(current, SL_LINKOPEN, 2) && (CurrentType == slText)) { BOOL ValidParam = FALSE, ValidLink = FALSE; @@ -221,14 +241,14 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text) CheckParameter: /* compare the current position with all known parameters */ - if(!StrCmpNIW(tmp, SL_HREF, 6)) + if(!SYSLINK_StrCmpNIW(tmp, SL_HREF, 6)) { taglen += 6; ValidParam = TRUE; CurrentParameter = &lpUrl; CurrentParameterLen = &lenUrl; } - else if(!StrCmpNIW(tmp, SL_ID, 4)) + else if(!SYSLINK_StrCmpNIW(tmp, SL_ID, 4)) { taglen += 4; ValidParam = TRUE; @@ -302,7 +322,7 @@ CheckParameter: } } } - else if(!StrCmpNIW(current, SL_LINKCLOSE, 4) && (CurrentType == slLink) && firsttag) + else if(!SYSLINK_StrCmpNIW(current, SL_LINKCLOSE, 4) && (CurrentType == slLink) && firsttag) { /* there's a tag opened, first add the previous text, if present */ if(textstart != NULL && textlen > 0 && firsttag > textstart) diff --git a/reactos/dll/win32/comctl32/theme_button.c b/reactos/dll/win32/comctl32/theme_button.c index ffbee17fb92..f06f512eef1 100644 --- a/reactos/dll/win32/comctl32/theme_button.c +++ b/reactos/dll/win32/comctl32/theme_button.c @@ -20,6 +20,7 @@ */ #include "comctl32.h" +WINE_DEFAULT_DEBUG_CHANNEL(theme_button); #define BUTTON_TYPE 0x0f /* bit mask for the available button types */ @@ -33,7 +34,7 @@ typedef enum STATE_DEFAULTED } ButtonState; -typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState drawState, UINT dtFlags); +typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState drawState, UINT dtFlags, BOOL focused); static UINT get_drawtext_flags(DWORD style, DWORD ex_style) { @@ -86,7 +87,7 @@ static inline WCHAR *get_button_text(HWND hwnd) return text; } -static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags) +static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) { static const int states[] = { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_DEFAULTED }; @@ -108,10 +109,25 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN HeapFree(GetProcessHeap(), 0, text); } + if (focused) + { + MARGINS margins; + RECT focusRect = bgRect; + + GetThemeMargins(theme, hDC, BP_PUSHBUTTON, state, TMT_CONTENTMARGINS, NULL, &margins); + + focusRect.left += margins.cxLeftWidth; + focusRect.top += margins.cyTopHeight; + focusRect.right -= margins.cxRightWidth; + focusRect.bottom -= margins.cyBottomHeight; + + DrawFocusRect( hDC, &focusRect ); + } + if (hPrevFont) SelectObject(hDC, hPrevFont); } -static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags) +static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) { static const int cb_states[3][5] = { @@ -129,8 +145,7 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN static const int cb_size = 13; RECT bgRect, textRect; - HFONT font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0); - HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL; + HFONT font, hPrevFont = NULL; LRESULT checkState = SendMessageW(hwnd, BM_GETCHECK, 0, 0); DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE); int part = ((dwStyle & BUTTON_TYPE) == BS_RADIOBUTTON) || ((dwStyle & BUTTON_TYPE) == BS_AUTORADIOBUTTON) @@ -140,6 +155,23 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN ? cb_states[ checkState ][ drawState ] : rb_states[ checkState ][ drawState ]; WCHAR *text = get_button_text(hwnd); + LOGFONTW lf; + BOOL created_font = FALSE; + + HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf); + if (SUCCEEDED(hr)) { + font = CreateFontIndirectW(&lf); + if (!font) + TRACE("Failed to create font\n"); + else { + TRACE("font = %s\n", debugstr_w(lf.lfFaceName)); + hPrevFont = SelectObject(hDC, font); + created_font = TRUE; + } + } else { + font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0); + hPrevFont = SelectObject(hDC, font); + } GetClientRect(hwnd, &bgRect); GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect); @@ -152,27 +184,58 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN bgRect.right = bgRect.left + cb_size; textRect.left = bgRect.right + 6; - if (IsThemeBackgroundPartiallyTransparent(theme, part, state)) - DrawThemeParentBackground(hwnd, hDC, NULL); + DrawThemeParentBackground(hwnd, hDC, NULL); + DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL); if (text) { DrawThemeText(theme, hDC, part, state, text, lstrlenW(text), dtFlags, 0, &textRect); + + if (focused) + { + RECT focusRect; + + focusRect = textRect; + + DrawTextW(hDC, text, lstrlenW(text), &focusRect, dtFlags | DT_CALCRECT); + + if (focusRect.right < textRect.right) focusRect.right++; + focusRect.bottom = textRect.bottom; + + DrawFocusRect( hDC, &focusRect ); + } + HeapFree(GetProcessHeap(), 0, text); } + if (created_font) DeleteObject(font); if (hPrevFont) SelectObject(hDC, hPrevFont); } -static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags) +static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) { static const int states[] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL }; RECT bgRect, textRect, contentRect; - HFONT font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0); - HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL; int state = states[ drawState ]; WCHAR *text = get_button_text(hwnd); + LOGFONTW lf; + HFONT font, hPrevFont = NULL; + BOOL created_font = FALSE; + + HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf); + if (SUCCEEDED(hr)) { + font = CreateFontIndirectW(&lf); + if (!font) + TRACE("Failed to create font\n"); + else { + hPrevFont = SelectObject(hDC, font); + created_font = TRUE; + } + } else { + font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0); + hPrevFont = SelectObject(hDC, font); + } GetClientRect(hwnd, &bgRect); textRect = bgRect; @@ -206,6 +269,7 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN HeapFree(GetProcessHeap(), 0, text); } + if (created_font) DeleteObject(font); if (hPrevFont) SelectObject(hDC, hPrevFont); } @@ -253,7 +317,7 @@ static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC) else drawState = STATE_DISABLED; hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps); - paint(theme, hwnd, hDC, drawState, dtFlags); + paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS); if (!hParamDC) EndPaint(hwnd, &ps); return TRUE; } diff --git a/reactos/dll/win32/comctl32/theme_edit.c b/reactos/dll/win32/comctl32/theme_edit.c index 83559411cc8..bbf5827b448 100644 --- a/reactos/dll/win32/comctl32/theme_edit.c +++ b/reactos/dll/win32/comctl32/theme_edit.c @@ -108,6 +108,8 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, break; case WM_ENABLE: + case WM_KILLFOCUS: + case WM_SETFOCUS: theme = GetWindowTheme( hwnd ); if (theme) RedrawWindow (hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); diff --git a/reactos/dll/win32/comctl32/theming.c b/reactos/dll/win32/comctl32/theming.c index 19481e5d285..48b03f71e41 100644 --- a/reactos/dll/win32/comctl32/theming.c +++ b/reactos/dll/win32/comctl32/theming.c @@ -36,6 +36,8 @@ extern LRESULT CALLBACK THEMING_EditSubclassProc (HWND, UINT, WPARAM, LPARAM, ULONG_PTR) DECLSPEC_HIDDEN; extern LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND, UINT, WPARAM, LPARAM, ULONG_PTR) DECLSPEC_HIDDEN; +extern LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND, UINT, WPARAM, LPARAM, + ULONG_PTR) DECLSPEC_HIDDEN; static const WCHAR dialogClass[] = {'#','3','2','7','7','0',0}; static const WCHAR comboLboxClass[] = {'C','o','m','b','o','L','b','o','x',0}; @@ -51,7 +53,8 @@ static const struct ThemingSubclass {WC_COMBOBOXW, THEMING_ComboSubclassProc}, {comboLboxClass, THEMING_ListBoxSubclassProc}, {WC_EDITW, THEMING_EditSubclassProc}, - {WC_LISTBOXW, THEMING_ListBoxSubclassProc} + {WC_LISTBOXW, THEMING_ListBoxSubclassProc}, + {WC_SCROLLBARW, THEMING_ScrollbarSubclassProc} }; #define NUM_SUBCLASSES (sizeof(subclasses)/sizeof(subclasses[0])) @@ -87,6 +90,7 @@ MAKE_SUBCLASS_PROC(2) MAKE_SUBCLASS_PROC(3) MAKE_SUBCLASS_PROC(4) MAKE_SUBCLASS_PROC(5) +MAKE_SUBCLASS_PROC(6) static const WNDPROC subclassProcs[NUM_SUBCLASSES] = { subclass_proc0, @@ -94,7 +98,8 @@ static const WNDPROC subclassProcs[NUM_SUBCLASSES] = { subclass_proc2, subclass_proc3, subclass_proc4, - subclass_proc5 + subclass_proc5, + subclass_proc6 }; /*********************************************************************** diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index cb7015a91af..549d43ad506 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -5186,8 +5186,6 @@ TOOLBAR_SetHotItem2 (TOOLBAR_INFO *infoPtr, INT nHotItem, LPARAM lParam) TOOLBAR_SetHotItemEx(infoPtr, nHotItem, lParam); - GetFocus(); - return (nOldHotItem < 0) ? -1 : (LRESULT)nOldHotItem; } diff --git a/reactos/dll/win32/comctl32/tooltips.c b/reactos/dll/win32/comctl32/tooltips.c index 3589e2839cf..9a98203b5e9 100644 --- a/reactos/dll/win32/comctl32/tooltips.c +++ b/reactos/dll/win32/comctl32/tooltips.c @@ -221,7 +221,7 @@ TOOLTIPS_customdraw_fill(const TOOLTIPS_INFO *infoPtr, NMTTCUSTOMDRAW *lpnmttcd, static inline DWORD TOOLTIPS_notify_customdraw (DWORD dwDrawStage, NMTTCUSTOMDRAW *lpnmttcd) { - LRESULT result = CDRF_DODEFAULT; + LRESULT result; lpnmttcd->nmcd.dwDrawStage = dwDrawStage; TRACE("Notifying stage %d, flags %x, id %x\n", lpnmttcd->nmcd.dwDrawStage, @@ -471,12 +471,13 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer) { TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool]; - if (IS_INTRESOURCE(toolPtr->lpszText) && toolPtr->hinst) { - /* load a resource */ - TRACE("load res string %p %x\n", - toolPtr->hinst, LOWORD(toolPtr->lpszText)); - LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText), - buffer, INFOTIPSIZE); + /* always NULL-terminate the buffer, just in case we fail to load the string */ + buffer[0] = '\0'; + if (IS_INTRESOURCE(toolPtr->lpszText)) { + HINSTANCE hinst = toolPtr->hinst ? toolPtr->hinst : GetModuleHandleW(NULL); + /* load a resource */ + TRACE("load res string %p %x\n", hinst, LOWORD(toolPtr->lpszText)); + LoadStringW (hinst, LOWORD(toolPtr->lpszText), buffer, INFOTIPSIZE); } else if (toolPtr->lpszText) { if (toolPtr->lpszText == LPSTR_TEXTCALLBACKW) { @@ -492,7 +493,6 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer) } else { /* no text available */ - buffer[0] = '\0'; } TRACE("%s\n", debugstr_w(buffer)); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 130c44278c5..93181728061 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -61,7 +61,7 @@ reactos/dll/win32/browseui # Out of sync reactos/dll/win32/cabinet # Synced to WineStaging-1.7.37 reactos/dll/win32/clusapi # Synced to Wine-1.7.27 reactos/dll/win32/comcat # Synced to Wine-1.7.27 -reactos/dll/win32/comctl32 # Synced to Wine-1.7.27 +reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.37 reactos/dll/win32/comdlg32 # Synced to Wine-1.7.27 reactos/dll/win32/compstui # Synced to Wine-1.7.27 reactos/dll/win32/credui # Synced to Wine-1.7.27