Author: rharabien Date: Sun May 1 12:49:38 2011 New Revision: 51522 URL: http://svn.reactos.org/svn/reactos?rev=51522&view=rev Log: [COMCTL32] * Sync Rebar to Wine 1.3.19 * Properly support WM_SYSCOLORCHANGE in Rebars * Update comctl32_ros.diff
Modified: trunk/reactos/dll/win32/comctl32/comctl32_ros.diff trunk/reactos/dll/win32/comctl32/listview.c trunk/reactos/dll/win32/comctl32/rebar.c Modified: trunk/reactos/dll/win32/comctl32/comctl32_ros.diff URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl32_ros.diff?rev=51522&r1=51521&r2=51522&view=diff ============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32_ros.diff [iso-8859-1] Sun May 1 12:49:38 2011 @@ -143,7 +143,15 @@ =================================================================== --- listview.c (revision 51320) +++ listview.c (working copy) -@@ -1634,8 +1635,19 @@ +@@ -315,6 +315,7 @@ + COLORREF clrBk; + COLORREF clrText; + COLORREF clrTextBk; ++ BOOL bDefaultBkColor; + + /* font */ + HFONT hDefaultFont; +@@ -1635,8 +1636,19 @@ /* used to handle collapse main item column case */ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc) { @@ -165,7 +173,7 @@ } /* Listview invalidation functions: use _only_ these functions to invalidate */ -@@ -5041,7 +5053,11 @@ +@@ -5042,7 +5054,11 @@ /* Draw marquee rectangle if appropriate */ if (infoPtr->bMarqueeSelect) @@ -177,3 +185,65 @@ if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); +@@ -7856,6 +7872,7 @@ + { + TRACE("(clrBk=%x)\n", clrBk); + ++ infoPtr->bDefaultBkColor = FALSE; + if(infoPtr->clrBk != clrBk) { + if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); + infoPtr->clrBk = clrBk; +@@ -9248,6 +9265,7 @@ + infoPtr->clrText = CLR_DEFAULT; + infoPtr->clrTextBk = CLR_DEFAULT; + LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); ++ infoPtr->bDefaultBkColor = TRUE; + + /* set default values */ + infoPtr->nFocusedItem = -1; +@@ -11510,6 +11528,11 @@ + + case WM_SYSCOLORCHANGE: + COMCTL32_RefreshSysColors(); ++ if (infoPtr->bDefaultBkColor) ++ { ++ LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); ++ infoPtr->bDefaultBkColor = TRUE; ++ } + return 0; + + /* case WM_TIMER: */ +Index: rebar.c +=================================================================== +--- rebar.c (revision 51320) ++++ rebar.c (working copy) +@@ -51,7 +51,6 @@ + * - WM_QUERYNEWPALETTE + * - WM_RBUTTONDOWN + * - WM_RBUTTONUP +- * - WM_SYSCOLORCHANGE + * - WM_VKEYTOITEM + * - WM_WININICHANGE + * Notifications: +@@ -2540,10 +2539,8 @@ + + /* initialize band */ + memset(lpBand, 0, sizeof(*lpBand)); +- lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText : +- infoPtr->clrText; +- lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace : +- infoPtr->clrBk; ++ lpBand->clrFore = infoPtr->clrText; ++ lpBand->clrBack = infoPtr->clrBk; + lpBand->iImage = -1; + + REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand); +@@ -3793,6 +3790,8 @@ + + case WM_SYSCOLORCHANGE: + COMCTL32_RefreshSysColors(); ++ infoPtr->clrBtnText = comctl32_color.clrBtnText; ++ infoPtr->clrBtnFace = comctl32_color.clrBtnFace; + return 0; + + /* case WM_VKEYTOITEM: supported according to ControlSpy */ Modified: trunk/reactos/dll/win32/comctl32/listview.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listview.c?rev=51522&r1=51521&r2=51522&view=diff ============================================================================== --- trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] Sun May 1 12:49:38 2011 @@ -7871,7 +7871,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrBk) { TRACE("(clrBk=%x)\n", clrBk); - + infoPtr->bDefaultBkColor = FALSE; if(infoPtr->clrBk != clrBk) { if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); Modified: trunk/reactos/dll/win32/comctl32/rebar.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c?rev=51522&r1=51521&r2=51522&view=diff ============================================================================== --- trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] Sun May 1 12:49:38 2011 @@ -51,7 +51,6 @@ * - WM_QUERYNEWPALETTE * - WM_RBUTTONDOWN * - WM_RBUTTONUP - * - WM_SYSCOLORCHANGE * - WM_VKEYTOITEM * - WM_WININICHANGE * Notifications: @@ -1524,8 +1523,9 @@ for (i = prev_visible(infoPtr, infoPtr->uNumBands); i > 0; i = prev_visible(infoPtr, i)) { REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, i); - int height = lpBand->rcBand.bottom - lpBand->rcBand.top; int cyBreakExtra; /* additional cy for the rebar after a RBBS_BREAK on this band */ + + height = lpBand->rcBand.bottom - lpBand->rcBand.top; if (infoPtr->dwStyle & RBS_VARHEIGHT) cyBreakExtra = lpBand->cyRowSoFar; /* 'height' => 'lpBand->cyRowSoFar' + 'height'*/ @@ -1846,8 +1846,7 @@ return uChanged; } -static LRESULT -REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc, const RECT *clip) +static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc) /* Function: This erases the background rectangle by drawing */ /* each band with its background color (or the default) and */ /* draws each bands right separator if necessary. The row */ @@ -1950,14 +1949,10 @@ else { old = SetBkColor (hdc, new); - TRACE("%s background color=0x%06x, band (%d,%d)-(%d,%d), clip (%d,%d)-(%d,%d)\n", + TRACE("%s background color=0x%06x, band %s\n", (lpBand->clrBack == CLR_NONE) ? "none" : ((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""), - GetBkColor(hdc), - rcBand.left,rcBand.top, - rcBand.right,rcBand.bottom, - clip->left, clip->top, - clip->right, clip->bottom); + GetBkColor(hdc), wine_dbgstr_rect(&rcBand)); ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rcBand, NULL, 0, 0); if (lpBand->clrBack != CLR_NONE) SetBkColor (hdc, old); @@ -2120,7 +2115,7 @@ REBAR_BAND *hitBand, *rowBeginBand; if(infoPtr->uNumBands <= 0) - ERR("There are no bands in this rebar"); + ERR("There are no bands in this rebar\n"); /* Up/down dragging can only occur when there is more than one * band in the rebar */ @@ -2544,10 +2539,8 @@ /* initialize band */ memset(lpBand, 0, sizeof(*lpBand)); - lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText : - infoPtr->clrText; - lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace : - infoPtr->clrBk; + lpBand->clrFore = infoPtr->clrText; + lpBand->clrBack = infoPtr->clrBk; lpBand->iImage = -1; REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand); @@ -2999,18 +2992,6 @@ TRACE("destroyed!\n"); return 0; } - - -static LRESULT -REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc) -{ - RECT cliprect; - - if (GetClipBox ( hdc, &cliprect)) - return REBAR_InternalEraseBkGnd (infoPtr, hdc, &cliprect); - return 0; -} - static LRESULT REBAR_GetFont (const REBAR_INFO *infoPtr) @@ -3454,7 +3435,7 @@ TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint)); if (ps.fErase) { /* Erase area of paint if requested */ - REBAR_InternalEraseBkGnd (infoPtr, hdc, &ps.rcPaint); + REBAR_EraseBkGnd (infoPtr, hdc); } REBAR_Refresh (infoPtr, hdc); EndPaint (infoPtr->hwndSelf, &ps); @@ -3809,6 +3790,8 @@ case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); + infoPtr->clrBtnText = comctl32_color.clrBtnText; + infoPtr->clrBtnFace = comctl32_color.clrBtnFace; return 0; /* case WM_VKEYTOITEM: supported according to ControlSpy */