mirror of
https://github.com/reactos/reactos.git
synced 2024-12-04 08:53:32 +08:00
[USER32] Pure Whitespace sync from comctl32/combo.c, no functional change
This will make future syncs between those files much easier, and fixes tons of mixed tab-space-indentation. Please no whitespace nitpicks when reviewing this commit, it is a SYNC!
This commit is contained in:
parent
d97313181e
commit
e13ebd44c6
@ -173,7 +173,6 @@ static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
|
||||
*/
|
||||
static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
|
||||
{
|
||||
|
||||
if (lphc)
|
||||
{
|
||||
TRACE("[%p]: freeing storage\n", lphc->self);
|
||||
@ -858,8 +857,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
|
||||
hDC = (hParamDC) ? hParamDC
|
||||
: BeginPaint( lphc->self, &ps);
|
||||
hDC = (hParamDC) ? hParamDC : BeginPaint(lphc->self, &ps);
|
||||
|
||||
TRACE("hdc=%p\n", hDC);
|
||||
|
||||
@ -872,7 +870,6 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
|
||||
* DC.
|
||||
*/
|
||||
hBkgBrush = COMBO_PrepareColors(lphc, hDC);
|
||||
|
||||
hPrevBrush = SelectObject(hDC, hBkgBrush);
|
||||
if (!(lphc->wState & CBF_EDIT))
|
||||
FillRect(hDC, &lphc->textRect, hBkgBrush);
|
||||
@ -883,9 +880,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
|
||||
CBPaintBorder(lphc->self, lphc, hDC);
|
||||
|
||||
if (!IsRectEmpty(&lphc->buttonRect))
|
||||
{
|
||||
CBPaintButton(lphc, hDC, lphc->buttonRect);
|
||||
}
|
||||
|
||||
/* paint the edit control padding area */
|
||||
if (CB_GETTYPE(lphc) != CBS_DROPDOWNLIST)
|
||||
@ -963,11 +958,9 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
|
||||
if( length != LB_ERR)
|
||||
{
|
||||
if ((pText = HeapAlloc(GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR))))
|
||||
{
|
||||
SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)index, (LPARAM)pText );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( CB_HASSTRINGS(lphc) )
|
||||
{
|
||||
@ -1842,8 +1835,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE("[%p]: msg %s wp %08lx lp %08lx\n",
|
||||
hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam );
|
||||
TRACE("[%p]: msg %s wp %08lx lp %08lx\n", hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam);
|
||||
|
||||
#ifndef __REACTOS__
|
||||
if (!IsWindow(hwnd)) return 0;
|
||||
@ -1852,13 +1844,9 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
if (lphc || message == WM_NCCREATE)
|
||||
switch(message)
|
||||
{
|
||||
|
||||
/* System messages */
|
||||
|
||||
case WM_NCCREATE:
|
||||
{
|
||||
LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style :
|
||||
((LPCREATESTRUCTA)lParam)->style;
|
||||
LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style : ((LPCREATESTRUCTA)lParam)->style;
|
||||
return COMBO_NCCreate(hwnd, style);
|
||||
}
|
||||
case WM_NCDESTROY:
|
||||
@ -1884,13 +1872,11 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
}
|
||||
return COMBO_Create(hwnd, lphc, hwndParent, style, unicode);
|
||||
}
|
||||
|
||||
case WM_PRINTCLIENT:
|
||||
/* Fallthrough */
|
||||
case WM_PAINT:
|
||||
/* wParam may contain a valid HDC! */
|
||||
return COMBO_Paint(lphc, (HDC)wParam);
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
/* do all painting in WM_PAINT like Windows does */
|
||||
return 1;
|
||||
@ -1908,8 +1894,8 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
return result;
|
||||
}
|
||||
case WM_SIZE:
|
||||
if( lphc->hWndLBox &&
|
||||
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
|
||||
if (lphc->hWndLBox && !(lphc->wState & CBF_NORESIZE))
|
||||
COMBO_Size( lphc );
|
||||
return TRUE;
|
||||
case WM_SETFONT:
|
||||
COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );
|
||||
@ -1917,10 +1903,12 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
case WM_GETFONT:
|
||||
return (LRESULT)lphc->hFont;
|
||||
case WM_SETFOCUS:
|
||||
if( lphc->wState & CBF_EDIT ) {
|
||||
if (lphc->wState & CBF_EDIT)
|
||||
{
|
||||
SetFocus( lphc->hWndEdit );
|
||||
/* The first time focus is received, select all the text */
|
||||
if( !(lphc->wState & CBF_BEENFOCUSED) ) {
|
||||
if (!(lphc->wState & CBF_BEENFOCUSED))
|
||||
{
|
||||
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
|
||||
lphc->wState |= CBF_BEENFOCUSED;
|
||||
}
|
||||
@ -1931,8 +1919,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
case WM_KILLFOCUS:
|
||||
{
|
||||
HWND hwndFocus = WIN_GetFullHandle((HWND)wParam);
|
||||
if( !hwndFocus ||
|
||||
(hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
|
||||
if (!hwndFocus || (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox))
|
||||
COMBO_KillFocus( lphc );
|
||||
return TRUE;
|
||||
}
|
||||
@ -1960,7 +1947,8 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
lphc->wState &= ~CBF_NOEDITNOTIFY;
|
||||
return ret;
|
||||
}
|
||||
else return CB_ERR;
|
||||
else
|
||||
return CB_ERR;
|
||||
case WM_CUT:
|
||||
case WM_PASTE:
|
||||
case WM_COPY:
|
||||
@ -2067,7 +2055,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
break;
|
||||
|
||||
/* Combo messages */
|
||||
|
||||
case CB_ADDSTRING:
|
||||
if (unicode)
|
||||
{
|
||||
@ -2113,7 +2100,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
CharLowerA((LPSTR)lParam);
|
||||
else if (lphc->dwStyle & CBS_UPPERCASE)
|
||||
CharUpperA((LPSTR)lParam);
|
||||
|
||||
return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||
}
|
||||
case CB_DELETESTRING:
|
||||
@ -2156,8 +2142,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
case CB_SETLOCALE:
|
||||
return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
|
||||
case CB_SETDROPPEDWIDTH:
|
||||
if( (CB_GETTYPE(lphc) == CBS_SIMPLE) ||
|
||||
(INT)wParam >= 32768 )
|
||||
if ((CB_GETTYPE(lphc) == CBS_SIMPLE) || (INT)wParam >= 32768)
|
||||
return CB_ERR;
|
||||
/* new value must be higher than combobox width */
|
||||
if ((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left)
|
||||
@ -2190,8 +2175,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
if (!(lphc->wState & CBF_DROPPED))
|
||||
CBDropDown( lphc );
|
||||
}
|
||||
else
|
||||
if( lphc->wState & CBF_DROPPED )
|
||||
else if (lphc->wState & CBF_DROPPED)
|
||||
CBRollUp( lphc, FALSE, TRUE );
|
||||
}
|
||||
return TRUE;
|
||||
@ -2225,8 +2209,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
return CB_ERR;
|
||||
case CB_SETEDITSEL:
|
||||
if (lphc->wState & CBF_EDIT)
|
||||
return SendMessageW(lphc->hWndEdit, EM_SETSEL,
|
||||
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
|
||||
return SendMessageW(lphc->hWndEdit, EM_SETSEL, (INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
|
||||
return CB_ERR;
|
||||
case CB_SETEXTENDEDUI:
|
||||
if (CB_GETTYPE(lphc) == CBS_SIMPLE )
|
||||
@ -2268,13 +2251,11 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||
CB_NOTIFY(lphc, CBN_KILLFOCUS);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
#endif
|
||||
|
||||
default:
|
||||
if (message >= WM_USER)
|
||||
WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n",
|
||||
message - WM_USER, wParam, lParam );
|
||||
WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam );
|
||||
break;
|
||||
}
|
||||
return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
|
||||
@ -2309,7 +2290,8 @@ LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||
/*************************************************************************
|
||||
* GetComboBoxInfo (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI GetComboBoxInfo(HWND hwndCombo, /* [in] handle to combo box */
|
||||
BOOL WINAPI GetComboBoxInfo(
|
||||
HWND hwndCombo, /* [in] handle to combo box */
|
||||
PCOMBOBOXINFO pcbi /* [in/out] combo box information */)
|
||||
{
|
||||
TRACE("(%p, %p)\n", hwndCombo, pcbi);
|
||||
|
Loading…
Reference in New Issue
Block a user