Skip to content

Commit 8311cfe

Browse files
author
Rafal Harabien
committed
[COMCTL32]
* Sync Rebar to Wine 1.3.19 * Properly support WM_SYSCOLORCHANGE in Rebars * Update comctl32_ros.diff svn path=/trunk/; revision=51522
1 parent 0f43b7a commit 8311cfe

File tree

3 files changed

+84
-31
lines changed

3 files changed

+84
-31
lines changed

reactos/dll/win32/comctl32/comctl32_ros.diff

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,15 @@ Index: listview.c
143143
===================================================================
144144
--- listview.c (revision 51320)
145145
+++ listview.c (working copy)
146-
@@ -1634,8 +1635,19 @@
146+
@@ -315,6 +315,7 @@
147+
COLORREF clrBk;
148+
COLORREF clrText;
149+
COLORREF clrTextBk;
150+
+ BOOL bDefaultBkColor;
151+
152+
/* font */
153+
HFONT hDefaultFont;
154+
@@ -1635,8 +1636,19 @@
147155
/* used to handle collapse main item column case */
148156
static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
149157
{
@@ -165,7 +173,7 @@ Index: listview.c
165173
}
166174

167175
/* Listview invalidation functions: use _only_ these functions to invalidate */
168-
@@ -5041,7 +5053,11 @@
176+
@@ -5042,7 +5054,11 @@
169177

170178
/* Draw marquee rectangle if appropriate */
171179
if (infoPtr->bMarqueeSelect)
@@ -177,3 +185,65 @@ Index: listview.c
177185

178186
if (cdmode & CDRF_NOTIFYPOSTPAINT)
179187
notify_postpaint(infoPtr, &nmlvcd);
188+
@@ -7856,6 +7872,7 @@
189+
{
190+
TRACE("(clrBk=%x)\n", clrBk);
191+
192+
+ infoPtr->bDefaultBkColor = FALSE;
193+
if(infoPtr->clrBk != clrBk) {
194+
if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
195+
infoPtr->clrBk = clrBk;
196+
@@ -9248,6 +9265,7 @@
197+
infoPtr->clrText = CLR_DEFAULT;
198+
infoPtr->clrTextBk = CLR_DEFAULT;
199+
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
200+
+ infoPtr->bDefaultBkColor = TRUE;
201+
202+
/* set default values */
203+
infoPtr->nFocusedItem = -1;
204+
@@ -11510,6 +11528,11 @@
205+
206+
case WM_SYSCOLORCHANGE:
207+
COMCTL32_RefreshSysColors();
208+
+ if (infoPtr->bDefaultBkColor)
209+
+ {
210+
+ LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
211+
+ infoPtr->bDefaultBkColor = TRUE;
212+
+ }
213+
return 0;
214+
215+
/* case WM_TIMER: */
216+
Index: rebar.c
217+
===================================================================
218+
--- rebar.c (revision 51320)
219+
+++ rebar.c (working copy)
220+
@@ -51,7 +51,6 @@
221+
* - WM_QUERYNEWPALETTE
222+
* - WM_RBUTTONDOWN
223+
* - WM_RBUTTONUP
224+
- * - WM_SYSCOLORCHANGE
225+
* - WM_VKEYTOITEM
226+
* - WM_WININICHANGE
227+
* Notifications:
228+
@@ -2540,10 +2539,8 @@
229+
230+
/* initialize band */
231+
memset(lpBand, 0, sizeof(*lpBand));
232+
- lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText :
233+
- infoPtr->clrText;
234+
- lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace :
235+
- infoPtr->clrBk;
236+
+ lpBand->clrFore = infoPtr->clrText;
237+
+ lpBand->clrBack = infoPtr->clrBk;
238+
lpBand->iImage = -1;
239+
240+
REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
241+
@@ -3793,6 +3790,8 @@
242+
243+
case WM_SYSCOLORCHANGE:
244+
COMCTL32_RefreshSysColors();
245+
+ infoPtr->clrBtnText = comctl32_color.clrBtnText;
246+
+ infoPtr->clrBtnFace = comctl32_color.clrBtnFace;
247+
return 0;
248+
249+
/* case WM_VKEYTOITEM: supported according to ControlSpy */

reactos/dll/win32/comctl32/listview.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7871,7 +7871,7 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *infoPtr, INT dx, INT dy)
78717871
static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrBk)
78727872
{
78737873
TRACE("(clrBk=%x)\n", clrBk);
7874-
7874+
78757875
infoPtr->bDefaultBkColor = FALSE;
78767876
if(infoPtr->clrBk != clrBk) {
78777877
if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);

reactos/dll/win32/comctl32/rebar.c

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
* - WM_QUERYNEWPALETTE
5252
* - WM_RBUTTONDOWN
5353
* - WM_RBUTTONUP
54-
* - WM_SYSCOLORCHANGE
5554
* - WM_VKEYTOITEM
5655
* - WM_WININICHANGE
5756
* Notifications:
@@ -1524,9 +1523,10 @@ REBAR_SizeToHeight(REBAR_INFO *infoPtr, int height)
15241523
for (i = prev_visible(infoPtr, infoPtr->uNumBands); i > 0; i = prev_visible(infoPtr, i))
15251524
{
15261525
REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, i);
1527-
int height = lpBand->rcBand.bottom - lpBand->rcBand.top;
15281526
int cyBreakExtra; /* additional cy for the rebar after a RBBS_BREAK on this band */
15291527

1528+
height = lpBand->rcBand.bottom - lpBand->rcBand.top;
1529+
15301530
if (infoPtr->dwStyle & RBS_VARHEIGHT)
15311531
cyBreakExtra = lpBand->cyRowSoFar; /* 'height' => 'lpBand->cyRowSoFar' + 'height'*/
15321532
else
@@ -1846,8 +1846,7 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
18461846
return uChanged;
18471847
}
18481848

1849-
static LRESULT
1850-
REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc, const RECT *clip)
1849+
static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
18511850
/* Function: This erases the background rectangle by drawing */
18521851
/* each band with its background color (or the default) and */
18531852
/* draws each bands right separator if necessary. The row */
@@ -1950,14 +1949,10 @@ REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc, const RECT *clip)
19501949
else
19511950
{
19521951
old = SetBkColor (hdc, new);
1953-
TRACE("%s background color=0x%06x, band (%d,%d)-(%d,%d), clip (%d,%d)-(%d,%d)\n",
1952+
TRACE("%s background color=0x%06x, band %s\n",
19541953
(lpBand->clrBack == CLR_NONE) ? "none" :
19551954
((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""),
1956-
GetBkColor(hdc),
1957-
rcBand.left,rcBand.top,
1958-
rcBand.right,rcBand.bottom,
1959-
clip->left, clip->top,
1960-
clip->right, clip->bottom);
1955+
GetBkColor(hdc), wine_dbgstr_rect(&rcBand));
19611956
ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rcBand, NULL, 0, 0);
19621957
if (lpBand->clrBack != CLR_NONE)
19631958
SetBkColor (hdc, old);
@@ -2120,7 +2115,7 @@ REBAR_HandleUDDrag (REBAR_INFO *infoPtr, const POINT *ptsmove)
21202115
REBAR_BAND *hitBand, *rowBeginBand;
21212116

21222117
if(infoPtr->uNumBands <= 0)
2123-
ERR("There are no bands in this rebar");
2118+
ERR("There are no bands in this rebar\n");
21242119

21252120
/* Up/down dragging can only occur when there is more than one
21262121
* band in the rebar */
@@ -2544,10 +2539,8 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi,
25442539

25452540
/* initialize band */
25462541
memset(lpBand, 0, sizeof(*lpBand));
2547-
lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText :
2548-
infoPtr->clrText;
2549-
lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace :
2550-
infoPtr->clrBk;
2542+
lpBand->clrFore = infoPtr->clrText;
2543+
lpBand->clrBack = infoPtr->clrBk;
25512544
lpBand->iImage = -1;
25522545

25532546
REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
@@ -3000,18 +2993,6 @@ REBAR_Destroy (REBAR_INFO *infoPtr)
30002993
return 0;
30012994
}
30022995

3003-
3004-
static LRESULT
3005-
REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
3006-
{
3007-
RECT cliprect;
3008-
3009-
if (GetClipBox ( hdc, &cliprect))
3010-
return REBAR_InternalEraseBkGnd (infoPtr, hdc, &cliprect);
3011-
return 0;
3012-
}
3013-
3014-
30152996
static LRESULT
30162997
REBAR_GetFont (const REBAR_INFO *infoPtr)
30172998
{
@@ -3454,7 +3435,7 @@ REBAR_Paint (const REBAR_INFO *infoPtr, HDC hdc)
34543435
TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint));
34553436
if (ps.fErase) {
34563437
/* Erase area of paint if requested */
3457-
REBAR_InternalEraseBkGnd (infoPtr, hdc, &ps.rcPaint);
3438+
REBAR_EraseBkGnd (infoPtr, hdc);
34583439
}
34593440
REBAR_Refresh (infoPtr, hdc);
34603441
EndPaint (infoPtr->hwndSelf, &ps);
@@ -3809,6 +3790,8 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
38093790

38103791
case WM_SYSCOLORCHANGE:
38113792
COMCTL32_RefreshSysColors();
3793+
infoPtr->clrBtnText = comctl32_color.clrBtnText;
3794+
infoPtr->clrBtnFace = comctl32_color.clrBtnFace;
38123795
return 0;
38133796

38143797
/* case WM_VKEYTOITEM: supported according to ControlSpy */

0 commit comments

Comments
 (0)