- Sync comctl32 with Wine 1.1.22 (without listview.c. Somebody help to sync listview! Now after sync listview there is a bug: http://opendn.org/listview.png)

svn path=/trunk/; revision=41068
This commit is contained in:
Dmitry Chapyshev 2009-05-23 10:39:30 +00:00
parent 1504605852
commit 55de54769e
11 changed files with 783 additions and 937 deletions

View file

@ -1535,11 +1535,11 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di
/* now draw the text */
if (!IsWindowVisible (infoPtr->hwndEdit)) {
nbkc = GetSysColor ((dis->itemState & ODS_SELECTED) ?
COLOR_HIGHLIGHT : COLOR_WINDOW);
nbkc = (dis->itemState & ODS_SELECTED) ?
comctl32_color.clrHighlight : comctl32_color.clrWindow;
bkc = SetBkColor (dis->hDC, nbkc);
ntxc = GetSysColor ((dis->itemState & ODS_SELECTED) ?
COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT);
ntxc = (dis->itemState & ODS_SELECTED) ?
comctl32_color.clrHighlightText : comctl32_color.clrWindowText;
txc = SetTextColor (dis->hDC, ntxc);
x = xbase + xioff;
y = dis->rcItem.top +
@ -1750,7 +1750,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
@ -1953,7 +1953,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
@ -2320,6 +2320,10 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SetFocus(infoPtr->hwndCombo);
return 0;
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",uMsg,wParam,lParam);

File diff suppressed because it is too large Load diff

View file

@ -158,18 +158,18 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
GetClientRect (infoPtr->Self, &rect);
if (infoPtr->Enabled) {
bgCol = COLOR_WINDOW;
fgCol = COLOR_WINDOWTEXT;
bgCol = comctl32_color.clrWindow;
fgCol = comctl32_color.clrWindowText;
} else {
bgCol = COLOR_3DFACE;
fgCol = COLOR_GRAYTEXT;
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);
SetBkColor (hdc, GetSysColor(bgCol));
SetTextColor(hdc, GetSysColor(fgCol));
SetBkColor (hdc, bgCol);
SetTextColor(hdc, fgCol);
for (i = 0; i < 3; i++) {
GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart);
@ -595,6 +595,10 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
case IPM_CLEARADDRESS:
IPADDRESS_ClearAddress (infoPtr);
break;

View file

@ -456,7 +456,7 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT
SYSTEMTIME localtime;
int startofprescal;
oldTextColor = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
oldTextColor = SetTextColor(hdc, comctl32_color.clrWindowText);
/* fill background */
hbr = CreateSolidBrush (infoPtr->bk);
@ -1926,12 +1926,12 @@ MONTHCAL_Create(HWND hwnd, LPARAM lParam)
infoPtr->monthRange = 3;
infoPtr->monthdayState = Alloc
(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
infoPtr->titlebk = GetSysColor(COLOR_ACTIVECAPTION);
infoPtr->titletxt = GetSysColor(COLOR_WINDOW);
infoPtr->monthbk = GetSysColor(COLOR_WINDOW);
infoPtr->trailingtxt = GetSysColor(COLOR_GRAYTEXT);
infoPtr->bk = GetSysColor(COLOR_WINDOW);
infoPtr->txt = GetSysColor(COLOR_WINDOWTEXT);
infoPtr->titlebk = comctl32_color.clrActiveCaption;
infoPtr->titletxt = comctl32_color.clrWindow;
infoPtr->monthbk = comctl32_color.clrWindow;
infoPtr->trailingtxt = comctl32_color.clrGrayText;
infoPtr->bk = comctl32_color.clrWindow;
infoPtr->txt = comctl32_color.clrWindowText;
/* set the current day for highlighing */
infoPtr->minSel.wDay = infoPtr->todaysDate.wDay;
@ -2082,6 +2082,10 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY:
return MONTHCAL_Destroy(infoPtr);
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR( "unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);

View file

@ -3190,8 +3190,8 @@ REBAR_NCCreate (HWND hwnd, LPARAM lParam)
/* initialize info structure - initial values are 0 */
infoPtr->clrBk = CLR_NONE;
infoPtr->clrText = CLR_NONE;
infoPtr->clrBtnText = GetSysColor (COLOR_BTNTEXT);
infoPtr->clrBtnFace = GetSysColor (COLOR_BTNFACE);
infoPtr->clrBtnText = comctl32_color.clrBtnText;
infoPtr->clrBtnFace = comctl32_color.clrBtnFace;
infoPtr->iOldBand = -1;
infoPtr->ichevronhotBand = -2;
infoPtr->iGrabbedBand = -1;
@ -3720,10 +3720,9 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_THEMECHANGED:
return theme_changed (infoPtr);
/* case WM_SYSCOLORCHANGE: supported according to ControlSpy */
/* "Applications that have brushes using the existing system colors
should delete those brushes and recreate them using the new
system colors." per MSDN */
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
/* case WM_VKEYTOITEM: supported according to ControlSpy */
/* case WM_WININICHANGE: */

View file

@ -167,7 +167,7 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
pt.x = lpRect->right - 1;
pt.y = lpRect->bottom - 1;
hPenFace = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_3DFACE ));
hPenFace = CreatePen( PS_SOLID, 1, comctl32_color.clr3dFace);
hOldPen = SelectObject( hdc, hPenFace );
MoveToEx (hdc, pt.x - 12, pt.y, NULL);
LineTo (hdc, pt.x, pt.y);
@ -176,7 +176,7 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
pt.x--;
pt.y--;
hPenShadow = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_3DSHADOW ));
hPenShadow = CreatePen( PS_SOLID, 1, comctl32_color.clr3dShadow);
SelectObject( hdc, hPenShadow );
for (i = 1; i < 11; i += 4) {
MoveToEx (hdc, pt.x - i, pt.y, NULL);
@ -186,7 +186,7 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
LineTo (hdc, pt.x + 1, pt.y - i - 2);
}
hPenHighlight = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_3DHIGHLIGHT ));
hPenHighlight = CreatePen( PS_SOLID, 1, comctl32_color.clr3dHilight);
SelectObject( hdc, hPenHighlight );
for (i = 3; i < 13; i += 4) {
MoveToEx (hdc, pt.x - i, pt.y, NULL);
@ -1313,6 +1313,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
return DefWindowProcW (hwnd, msg, wParam, lParam);
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
case WM_THEMECHANGED:
return theme_changed (infoPtr);

View file

@ -831,7 +831,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
hOldFont = SelectObject(hdc, infoPtr->Font);
OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
OldBkColor = SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
OldBkColor = SetBkColor(hdc, comctl32_color.clrBtnFace);
GetClientRect(infoPtr->Self, &rc);
rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN;
@ -1729,9 +1729,9 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
infoPtr->Items = NULL;
infoPtr->HasFocus = FALSE;
infoPtr->MouseDownID = -1;
infoPtr->TextColor = GetSysColor(COLOR_WINDOWTEXT);
infoPtr->LinkColor = GetSysColor(COLOR_HIGHLIGHT);
infoPtr->VisitedColor = GetSysColor(COLOR_HIGHLIGHT);
infoPtr->TextColor = comctl32_color.clrWindowText;
infoPtr->LinkColor = comctl32_color.clrHighlight;
infoPtr->VisitedColor = comctl32_color.clrHighlight;
infoPtr->BreakChar = ' ';
TRACE("SysLink Ctrl creation, hwnd=%p\n", hwnd);
SYSLINK_SetText(infoPtr, ((LPCREATESTRUCTW)lParam)->lpszName);
@ -1746,6 +1746,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
Free (infoPtr);
return 0;
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
default:
HandleDefaultMessage:
if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))

View file

@ -1668,7 +1668,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
/*
* Text pen
*/
htextPen = CreatePen( PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT) );
htextPen = CreatePen( PS_SOLID, 1, comctl32_color.clrBtnText );
holdPen = SelectObject(hdc, htextPen);
hOldFont = SelectObject(hdc, infoPtr->hFont);

File diff suppressed because it is too large Load diff

View file

@ -189,8 +189,8 @@ TOOLTIPS_InitSystemSettings (TOOLTIPS_INFO *infoPtr)
{
NONCLIENTMETRICSW nclm;
infoPtr->clrBk = GetSysColor (COLOR_INFOBK);
infoPtr->clrText = GetSysColor (COLOR_INFOTEXT);
infoPtr->clrBk = comctl32_color.clrInfoBk;
infoPtr->clrText = comctl32_color.clrInfoText;
DeleteObject (infoPtr->hFont);
nclm.cbSize = sizeof(nclm);
@ -2864,6 +2864,10 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SETFONT:
return TOOLTIPS_SetFont (hwnd, wParam, lParam);
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
case WM_TIMER:
return TOOLTIPS_Timer (hwnd, wParam, lParam);

View file

@ -2306,7 +2306,7 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
& (TVS_LINESATROOT|TVS_HASLINES|TVS_HASBUTTONS))
> TVS_LINESATROOT);
HBRUSH hbr, hbrOld;
COLORREF clrBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW):
COLORREF clrBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow:
infoPtr->clrBk;
if (!lar && item->iLevel == 0)
@ -2460,26 +2460,26 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem
{
if ((wineItem->state & TVIS_DROPHILITED) || inFocus)
{
nmcdhdr.clrTextBk = GetSysColor(COLOR_HIGHLIGHT);
nmcdhdr.clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
nmcdhdr.clrTextBk = comctl32_color.clrHighlight;
nmcdhdr.clrText = comctl32_color.clrHighlightText;
}
else
{
nmcdhdr.clrTextBk = GetSysColor(COLOR_BTNFACE);
nmcdhdr.clrTextBk = comctl32_color.clrBtnFace;
if (infoPtr->clrText == -1)
nmcdhdr.clrText = GetSysColor(COLOR_WINDOWTEXT);
nmcdhdr.clrText = comctl32_color.clrWindowText;
else
nmcdhdr.clrText = infoPtr->clrText;
}
}
else
{
nmcdhdr.clrTextBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW):
nmcdhdr.clrTextBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow:
infoPtr->clrBk;
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (wineItem == infoPtr->hotItem))
nmcdhdr.clrText = comctl32_color.clrHighlight;
else if (infoPtr->clrText == -1)
nmcdhdr.clrText = GetSysColor(COLOR_WINDOWTEXT);
nmcdhdr.clrText = comctl32_color.clrWindowText;
else
nmcdhdr.clrText = infoPtr->clrText;
}
@ -2786,7 +2786,7 @@ static LRESULT
TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC)
{
HBRUSH hBrush;
COLORREF clrBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW):
COLORREF clrBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow:
infoPtr->clrBk;
RECT rect;
@ -4890,7 +4890,7 @@ initialize_checkboxes(TREEVIEW_INFO *infoPtr)
SelectObject(hdc, hbmOld);
nIndex = ImageList_AddMasked(infoPtr->himlState, hbm,
GetSysColor(COLOR_WINDOW));
comctl32_color.clrWindow);
TRACE("checkbox index %d\n", nIndex);
DeleteObject(hbm);
@ -4954,7 +4954,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr->clrBk = -1; /* use system color */
infoPtr->clrText = -1; /* use system color */
infoPtr->clrLine = RGB(128, 128, 128);
infoPtr->clrInsertMark = GetSysColor(COLOR_BTNTEXT);
infoPtr->clrInsertMark = comctl32_color.clrBtnText;
/* hwndToolTip */
@ -5710,7 +5710,9 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_STYLECHANGED:
return TREEVIEW_StyleChanged(infoPtr, wParam, lParam);
/* WM_SYSCOLORCHANGE */
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
/* WM_SYSKEYDOWN */