Author: tkreuzer
Date: Sun Jan 11 17:08:47 2009
New Revision: 38712
URL:
http://svn.reactos.org/svn/reactos?rev=38712&view=rev
Log:
user32 revert lite ;-P
- revert 32934: remove the hack for disabled button font, as it's not needed anymore
since we have tahoma
- partly revert 28055: use InvalidateRect and add it to ntwrapper.h
- add a define for SYSCOLOR_GetPen to reduce diff to wine
Modified:
trunk/reactos/dll/win32/user32/controls/button.c
trunk/reactos/dll/win32/user32/controls/combo.c
trunk/reactos/dll/win32/user32/controls/edit.c
trunk/reactos/dll/win32/user32/controls/listbox.c
trunk/reactos/dll/win32/user32/controls/scrollbar.c
trunk/reactos/dll/win32/user32/include/ntwrapper.h
trunk/reactos/dll/win32/user32/include/user32p.h
Modified: trunk/reactos/dll/win32/user32/controls/button.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/button.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/button.c [iso-8859-1] Sun Jan 11 17:08:47
2009
@@ -259,8 +259,8 @@
LONG state;
HANDLE oldHbitmap;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
switch (uMsg)
{
@@ -433,7 +433,7 @@
if (unicode) DefWindowProcW( hWnd, WM_SETTEXT, wParam, lParam );
else DefWindowProcA( hWnd, WM_SETTEXT, wParam, lParam );
if (btn_type == BS_GROUPBOX) /* Yes, only for BS_GROUPBOX */
- NtUserInvalidateRect( hWnd, NULL, TRUE );
+ InvalidateRect( hWnd, NULL, TRUE );
else
paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
return 1; /* success. FIXME: check text length */
@@ -469,7 +469,7 @@
break;
case WM_SYSCOLORCHANGE:
- NtUserInvalidateRect( hWnd, NULL, FALSE );
+ InvalidateRect( hWnd, NULL, FALSE );
break;
#ifndef __REACTOS__
@@ -506,8 +506,8 @@
return 0;
}
oldHbitmap = (HBITMAP)SetWindowLongPtrW( hWnd, HIMAGE_GWL_OFFSET, lParam );
- NtUserInvalidateRect( hWnd, NULL, FALSE );
- return (LRESULT)oldHbitmap;
+ InvalidateRect( hWnd, NULL, FALSE );
+ return (LRESULT)oldHbitmap;
case BM_GETIMAGE:
return GetWindowLongPtrW( hWnd, HIMAGE_GWL_OFFSET );
@@ -582,7 +582,6 @@
}
return 0;
}
-
/***********************************************************************
* ButtonWndProcW
@@ -826,22 +825,8 @@
return;
}
- /* ROS Hack to make font look less ugly */
- if ( ((style & (BS_ICON|BS_BITMAP)) == BS_TEXT) &&
- (flags & DSS_DISABLED) )
- {
- ++rc->left; ++rc->top; ++rc->right; ++rc->bottom;
- SetTextColor(hdc, GetSysColor(COLOR_3DHILIGHT));
- DrawTextW(hdc, (LPCWSTR)lp, -1, rc, (UINT)wp);
- --rc->left; --rc->top; --rc->right; --rc->bottom;
- SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
- DrawTextW(hdc, (LPCWSTR)lp, -1, rc, (UINT)wp);
- }
- else
- {
- DrawStateW(hdc, hbr, lpOutputProc, lp, wp, rc->left, rc->top,
- rc->right - rc->left, rc->bottom - rc->top, flags);
- }
+ DrawStateW(hdc, hbr, lpOutputProc, lp, wp, rc->left, rc->top,
+ rc->right - rc->left, rc->bottom - rc->top, flags);
HeapFree( GetProcessHeap(), 0, text );
}
@@ -869,11 +854,7 @@
parent = GetParent(hwnd);
if (!parent) parent = hwnd;
SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
-#ifdef __REACTOS__
- hOldPen = (HPEN)SelectObject(hDC, GetSysColorPen(COLOR_WINDOWFRAME));
-#else
hOldPen = (HPEN)SelectObject(hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME));
-#endif
hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE));
oldBkMode = SetBkMode(hDC, TRANSPARENT);
Modified: trunk/reactos/dll/win32/user32/controls/combo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/combo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/combo.c [iso-8859-1] Sun Jan 11 17:08:47 2009
@@ -1233,7 +1233,7 @@
*/
static void CBRepaintButton( LPHEADCOMBO lphc )
{
- NtUserInvalidateRect(lphc->self, &lphc->buttonRect, TRUE);
+ InvalidateRect(lphc->self, &lphc->buttonRect, TRUE);
UpdateWindow(lphc->self);
}
@@ -1252,9 +1252,7 @@
/* lphc->wState |= CBF_FOCUSED; */
if( !(lphc->wState & CBF_EDIT) )
- {
- NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
- }
+ InvalidateRect(lphc->self, &lphc->textRect, TRUE);
CB_NOTIFY( lphc, CBN_SETFOCUS );
lphc->wState |= CBF_FOCUSED;
@@ -1276,11 +1274,11 @@
if( CB_GETTYPE(lphc) == CBS_DROPDOWNLIST )
SendMessageW(lphc->hWndLBox, LB_CARETOFF, 0, 0);
- lphc->wState &= ~CBF_FOCUSED;
+ lphc->wState &= ~CBF_FOCUSED;
/* redraw text */
- if( !(lphc->wState & CBF_EDIT) )
- NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
+ if( !(lphc->wState & CBF_EDIT) )
+ InvalidateRect(lphc->self, &lphc->textRect, TRUE);
CB_NOTIFY( lphc, CBN_KILLFOCUS );
}
@@ -1298,12 +1296,12 @@
switch( HIWORD(wParam) >> 8 )
{
- case (EN_SETFOCUS >> 8):
+ case (EN_SETFOCUS >> 8):
TRACE("[%p]: edit [%p] got focus\n", lphc->self,
lphc->hWndEdit );
- COMBO_SetFocus( lphc );
- break;
+ COMBO_SetFocus( lphc );
+ break;
case (EN_KILLFOCUS >> 8):
@@ -1379,7 +1377,7 @@
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1));
}
else
- NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
+ InvalidateRect(lphc->self, &lphc->textRect, TRUE);
}
/* do not roll up if selection is being tracked
@@ -1699,7 +1697,7 @@
CBUpdateEdit( lphc, index );
else
{
- NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
+ InvalidateRect(lphc->self, &lphc->textRect, TRUE);
}
}
return (LRESULT)index;
@@ -2009,7 +2007,7 @@
EnableWindow( lphc->hWndLBox, (BOOL)wParam );
/* Force the control to repaint when the enabled state changes. */
- NtUserInvalidateRect(lphc->self, NULL, TRUE);
+ InvalidateRect(lphc->self, NULL, TRUE);
return TRUE;
case WM_SETREDRAW:
if( wParam )
@@ -2194,7 +2192,7 @@
SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0,
(LPARAM)empty_stringW);
}
else
- NtUserInvalidateRect(lphc->self, NULL, TRUE);
+ InvalidateRect(lphc->self, NULL, TRUE);
return TRUE;
case CB_INITSTORAGE:
return SendMessageW(lphc->hWndLBox, LB_INITSTORAGE, wParam, lParam);
@@ -2283,7 +2281,7 @@
if( lphc->wState & CBF_EDIT )
CBUpdateEdit( lphc, (INT)wParam );
else
- NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
+ InvalidateRect(lphc->self, &lphc->textRect, TRUE);
lphc->wState &= ~CBF_SELCHANGE;
return lParam;
#ifndef __REACTOS__
Modified: trunk/reactos/dll/win32/user32/controls/edit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] Sun Jan 11 17:08:47 2009
@@ -5521,7 +5521,7 @@
es->flags &= ~EF_UPDATE;
EDIT_NOTIFY_PARENT(es, EN_UPDATE);
}
- NtUserInvalidateRect(es->hwndSelf, rc, bErase);
+ InvalidateRect(es->hwndSelf, rc, bErase);
}
/********************************************************************
Modified: trunk/reactos/dll/win32/user32/controls/listbox.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/listbox.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/listbox.c [iso-8859-1] Sun Jan 11 17:08:47
2009
@@ -396,7 +396,7 @@
else
scroll = FALSE;
}
- if (!scroll) NtUserInvalidateRect( descr->self, NULL, TRUE );
+ if (!scroll) InvalidateRect( descr->self, NULL, TRUE );
descr->top_item = index;
LISTBOX_UpdateScroll( descr );
return LB_OKAY;
@@ -418,7 +418,7 @@
if (page_size == descr->page_size) return;
descr->page_size = page_size;
if (descr->style & LBS_MULTICOLUMN)
- NtUserInvalidateRect( descr->self, NULL, TRUE );
+ InvalidateRect( descr->self, NULL, TRUE );
LISTBOX_SetTopItem( descr, descr->top_item, FALSE );
}
@@ -473,7 +473,7 @@
/* Invalidate the focused item so it will be repainted correctly */
if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1)
{
- NtUserInvalidateRect( descr->self, &rect, FALSE );
+ InvalidateRect( descr->self, &rect, FALSE );
}
}
@@ -702,7 +702,7 @@
descr->style &= ~LBS_NOREDRAW;
if (descr->style & LBS_DISPLAYCHANGED)
{ /* page was changed while setredraw false, refresh automatically */
- NtUserInvalidateRect(descr->self, NULL, TRUE);
+ InvalidateRect(descr->self, NULL, TRUE);
if ((descr->top_item + descr->page_size) > descr->nb_items)
{ /* reset top of page if less than number of items/page */
descr->top_item = descr->nb_items - descr->page_size;
@@ -1240,14 +1240,14 @@
return;
}
rect.bottom = descr->height;
- NtUserInvalidateRect( descr->self, &rect, TRUE );
+ InvalidateRect( descr->self, &rect, TRUE );
if (descr->style & LBS_MULTICOLUMN)
{
/* Repaint the other columns */
rect.left = rect.right;
rect.right = descr->width;
rect.top = 0;
- NtUserInvalidateRect( descr->self, &rect, TRUE );
+ InvalidateRect( descr->self, &rect, TRUE );
}
}
}
@@ -1257,7 +1257,7 @@
RECT rect;
if (LISTBOX_GetItemRect( descr, index, &rect ) == 1)
- NtUserInvalidateRect( descr->self, &rect, TRUE );
+ InvalidateRect( descr->self, &rect, TRUE );
}
/***********************************************************************
@@ -1308,7 +1308,7 @@
LISTBOX_UpdatePage( descr );
LISTBOX_UpdateScroll( descr );
if (repaint)
- NtUserInvalidateRect( descr->self, 0, TRUE );
+ InvalidateRect( descr->self, 0, TRUE );
}
return LB_OKAY;
}
@@ -1333,12 +1333,12 @@
RECT rect;
/* Invalidate the focused item so it will be repainted correctly */
if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1)
- NtUserInvalidateRect( descr->self, &rect, TRUE );
+ InvalidateRect( descr->self, &rect, TRUE );
ScrollWindowEx( descr->self, diff, 0, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
}
else
- NtUserInvalidateRect( descr->self, NULL, TRUE );
+ InvalidateRect( descr->self, NULL, TRUE );
}
@@ -2719,7 +2719,7 @@
case LB_RESETCONTENT:
LISTBOX_ResetContent( descr );
LISTBOX_UpdateScroll( descr );
- NtUserInvalidateRect( descr->self, NULL, TRUE );
+ InvalidateRect( descr->self, NULL, TRUE );
return 0;
#ifndef __REACTOS__
@@ -3256,7 +3256,7 @@
return LISTBOX_Destroy( descr );
case WM_ENABLE:
- NtUserInvalidateRect( hwnd, NULL, TRUE );
+ InvalidateRect( hwnd, NULL, TRUE );
return 0;
case WM_SETREDRAW:
@@ -3282,7 +3282,7 @@
return (LRESULT)descr->font;
case WM_SETFONT:
LISTBOX_SetFont( descr, (HFONT)wParam );
- if (lParam) NtUserInvalidateRect( hwnd, 0, TRUE );
+ if (lParam) InvalidateRect( hwnd, 0, TRUE );
return 0;
case WM_SETFOCUS:
descr->in_focus = TRUE;
Modified: trunk/reactos/dll/win32/user32/controls/scrollbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] Sun Jan 11 17:08:47
2009
@@ -1358,7 +1358,7 @@
Rect.bottom = Rect.top + ThumbSize;
}
HideCaret(Wnd);
- NtUserInvalidateRect(Wnd, &Rect, FALSE);
+ InvalidateRect(Wnd, &Rect, FALSE);
DestroyCaret();
}
break;
Modified: trunk/reactos/dll/win32/user32/include/ntwrapper.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/n…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/ntwrapper.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/ntwrapper.h [iso-8859-1] Sun Jan 11 17:08:47
2009
@@ -498,3 +498,8 @@
return(NtUserSetCapture(hWnd));
}
+EXTINLINE BOOL WINAPI
+InvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase)
+{
+ return NtUserInvalidateRect(hWnd, lpRect, bErase);
+}
Modified: trunk/reactos/dll/win32/user32/include/user32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] Sun Jan 11 17:08:47
2009
@@ -228,5 +228,7 @@
PUSER_HANDLE_ENTRY FASTCALL GetUser32Handle(HANDLE);
PVOID FASTCALL ValidateHandle(HANDLE, UINT);
+#define SYSCOLOR_GetPen(index) GetSysColorPen(index)
+
#endif
/* EOF */