Author: akhaldi
Date: Fri Nov 27 22:47:40 2015
New Revision: 70167
URL:
http://svn.reactos.org/svn/reactos?rev=70167&view=rev
Log:
[USER32] Sync listbox.c with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/reactos/media/doc/README.WINE
trunk/reactos/win32ss/user/user32/controls/listbox.c
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Nov 27 22:47:40 2015
@@ -297,7 +297,7 @@
reactos/win32ss/user/user32/controls/combo.c # Synced to WineStaging-1.7.37
reactos/win32ss/user/user32/controls/edit.c # Synced to WineStaging-1.7.55
reactos/win32ss/user/user32/controls/icontitle.c # Synced to WineStaging-1.7.55
- reactos/win32ss/user/user32/controls/listbox.c # Synced to Wine-1_1_39
+ reactos/win32ss/user/user32/controls/listbox.c # Synced to WineStaging-1.7.55
reactos/win32ss/user/user32/controls/scrollbar.c # Forked
reactos/win32ss/user/user32/controls/static.c # Synced to Wine-1_1_39
Modified: trunk/reactos/win32ss/user/user32/controls/listbox.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
==============================================================================
--- trunk/reactos/win32ss/user/user32/controls/listbox.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/controls/listbox.c [iso-8859-1] Fri Nov 27 22:47:40
2015
@@ -259,7 +259,7 @@
if (descr->style & WS_VSCROLL)
SetScrollInfo( descr->self, SB_VERT, &info, TRUE );
- if (descr->style & WS_HSCROLL && descr->horz_extent)
+ if ((descr->style & WS_HSCROLL) && descr->horz_extent)
{
info.nPos = descr->horz_pos;
info.nPage = descr->width;
@@ -364,8 +364,11 @@
static void LISTBOX_UpdateSize( LB_DESCR *descr )
{
RECT rect;
+ LONG style = GetWindowLongPtrW( descr->self, GWL_STYLE );
GetClientRect( descr->self, &rect );
+ if (style & WS_HSCROLL)
+ rect.bottom += GetSystemMetrics(SM_CYHSCROLL);
descr->width = rect.right - rect.left;
descr->height = rect.bottom - rect.top;
if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !(descr->style &
LBS_OWNERDRAWVARIABLE))
@@ -557,7 +560,7 @@
dis.itemData = item->data;
dis.rcItem = *rect;
TRACE("[%p]: drawitem %d (%s) action=%02x state=%02x rect=%s\n",
- descr->self, index, item ? debugstr_w(item->str) : "",
action,
+ descr->self, index, debugstr_w(item->str), action,
dis.itemState, wine_dbgstr_rect(rect) );
SendMessageW(descr->owner, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
SelectClipRgn( hdc, hrgn );
@@ -660,7 +663,12 @@
if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return;
if (!(hdc = GetDCEx( descr->self, 0, DCX_CACHE ))) return;
if (descr->font) oldFont = SelectObject( hdc, descr->font );
+#ifdef __REACTOS__
hbrush = GetControlColor( descr->owner, descr->self, hdc, WM_CTLCOLORLISTBOX);
+#else
+ hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+ (WPARAM)hdc, (LPARAM)descr->self );
+#endif
if (hbrush) oldBrush = SelectObject( hdc, hbrush );
if (!IsWindowEnabled(descr->self))
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
@@ -693,7 +701,7 @@
if (!IsWindowEnabled(descr->self))
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
SetWindowOrgEx( hdc, descr->horz_pos, 0, NULL );
- LISTBOX_PaintItem( descr, hdc, &rect, descr->focus_item, ODA_FOCUS, on ? FALSE
: TRUE );
+ LISTBOX_PaintItem( descr, hdc, &rect, descr->focus_item, ODA_FOCUS, !on );
if (oldFont) SelectObject( hdc, oldFont );
ReleaseDC( descr->self, hdc );
}
@@ -750,7 +758,7 @@
if (!(descr->tabs = HeapAlloc( GetProcessHeap(), 0,
descr->nb_tabs * sizeof(INT) )))
return FALSE;
- memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT) );
+ memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT) );
/* convert into "dialog units"*/
for (i = 0; i < descr->nb_tabs; i++)
@@ -833,7 +841,7 @@
*/
static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact )
{
- INT index, min, max, res = -1;
+ INT index, min, max, res;
if (!(descr->style & LBS_SORT)) return -1; /* Add it at the end */
min = 0;
@@ -876,7 +884,7 @@
*/
static INT LISTBOX_FindFileStrPos( LB_DESCR *descr, LPCWSTR str )
{
- INT min, max, res = -1;
+ INT min, max, res;
if (!HAS_STRINGS(descr))
return LISTBOX_FindStringPos( descr, str, FALSE );
@@ -1031,7 +1039,12 @@
}
if (descr->font) oldFont = SelectObject( hdc, descr->font );
+#ifdef __REACTOS__
hbrush = GetControlColor( descr->owner, descr->self, hdc, WM_CTLCOLORLISTBOX);
+#else
+ hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+ (WPARAM)hdc, (LPARAM)descr->self );
+#endif
if (hbrush) oldBrush = SelectObject( hdc, hbrush );
if (!IsWindowEnabled(descr->self)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT
) );
@@ -2516,7 +2529,7 @@
descr->nb_tabs = 0;
descr->tabs = NULL;
descr->wheel_remain = 0;
- descr->caret_on = lphc ? FALSE : TRUE;
+ descr->caret_on = !lphc;
if (descr->style & LBS_NOSEL) descr->caret_on = FALSE;
descr->in_focus = FALSE;
descr->captured = FALSE;
@@ -2647,8 +2660,10 @@
return 0;
case LB_ADDSTRING:
+#ifdef __REACTOS__
case LB_ADDSTRING_LOWER:
case LB_ADDSTRING_UPPER:
+#endif
{
INT ret;
LPWSTR textW;
@@ -2663,12 +2678,14 @@
else
return LB_ERRSPACE;
}
+#ifdef __REACTOS__
/* in the unicode the version, the string is really overwritten
during the converting case */
if (msg == LB_ADDSTRING_LOWER)
strlwrW(textW);
else if (msg == LB_ADDSTRING_UPPER)
struprW(textW);
+#endif
wParam = LISTBOX_FindStringPos( descr, textW, FALSE );
ret = LISTBOX_InsertString( descr, wParam, textW );
if (!unicode && HAS_STRINGS(descr))
@@ -2677,8 +2694,10 @@
}
case LB_INSERTSTRING:
+#ifdef __REACTOS__
case LB_INSERTSTRING_UPPER:
case LB_INSERTSTRING_LOWER:
+#endif
{
INT ret;
LPWSTR textW;
@@ -2693,12 +2712,14 @@
else
return LB_ERRSPACE;
}
+#ifdef __REACTOS__
/* in the unicode the version, the string is really overwritten
during the converting case */
if (msg == LB_INSERTSTRING_LOWER)
strlwrW(textW);
else if (msg == LB_INSERTSTRING_UPPER)
struprW(textW);
+#endif
ret = LISTBOX_InsertString( descr, wParam, textW );
if(!unicode && HAS_STRINGS(descr))
HeapFree(GetProcessHeap(), 0, textW);
@@ -3188,7 +3209,12 @@
if ((IS_OWNERDRAW(descr)) && !(descr->style &
LBS_DISPLAYCHANGED))
{
RECT rect;
+#ifdef __REACTOS__
HBRUSH hbrush = GetControlColor( descr->owner, descr->self,
(HDC)wParam, WM_CTLCOLORLISTBOX);
+#else
+ HBRUSH hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+ wParam, (LPARAM)descr->self );
+#endif
TRACE("hbrush = %p\n", hbrush);
if(!hbrush)
hbrush = GetSysColorBrush(COLOR_WINDOW);