mirror of
https://github.com/reactos/reactos.git
synced 2024-06-24 06:51:47 +00:00
port back the following commit: 0.4.15-dev-6613-ge13ebd44c6
[USER32] Pure Whitespace sync from comctl32/combo.c, no functional change 0.4.15-dev-6612-gd97313181e
[USER32] Sync comctl32 combo.c code in context of CORE-17883 0.4.15-dev-3453-gff89651ed0
[COMCTL32] Redraw children when the combo box is dropped down (#4138) CORE-17883 and tweak [USER32] combo.c a bit more even than on master, e.g. strip a few TRACEs. Possible because unlike master we don't need to be as much in sync as possible to Wine in the older branches. But we need to have binary size under control for the backports due to base-addresses. Binary size: user32.dll master RosBEWin2.2.2 GCC8.4.0dbg 1.579.008 user32.dll 0.4.14rls RosBEWin2.1.6 GCC4.7.2dbg 1.448.448 -> 1.448.448 user32.dll 0.4.13rls RosBEWin2.1.6 GCC4.7.2dbg 1.445.376 -> 1.444.864 user32.dll 0.4.12rls RosBEWin2.1.6 GCC4.7.2dbg 1.455.616 -> 1.455.104 user32.dll 0.4.11rls RosBEWin2.1.6 GCC4.7.2dbg 1.453.056 -> 1.451.008 user32.dll 0.4.10rls RosBEWin2.1.6 GCC4.7.2dbg 1.434.624 -> 1.434.112 user32.dll 0.4. 9rls RosBEWin2.1.6 GCC4.7.2dbg 1.422.336 -> 1.421.824 user32.dll 0.4. 8rls RosBEWin2.1.6 GCC4.7.2dbg 1.421.824 -> 1.421.824 user32.dll 0.4. 7rls RosBEWin2.1.6 GCC4.7.2dbg 1.418.752 -> 1.417.216
This commit is contained in:
parent
933caa0459
commit
0aca76b392
|
@ -1050,8 +1050,7 @@ static void CBDropDown( LPHEADCOMBO lphc )
|
|||
|
||||
|
||||
if( !(lphc->wState & CBF_NOREDRAW) )
|
||||
RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE |
|
||||
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
|
||||
RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW );
|
||||
|
||||
EnableWindow( lphc->hWndLBox, TRUE );
|
||||
if (GetCapture() != lphc->self)
|
||||
|
|
|
@ -17,18 +17,7 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
* This code was audited for completeness against the documented features
|
||||
* of Comctl32.dll version 6.0 on Oct. 4, 2004, by Dimitrie O. Paun.
|
||||
*
|
||||
* Unless otherwise noted, we believe this code to be complete, as per
|
||||
* the specification mentioned above.
|
||||
* If you discover missing features, or bugs, please note them below.
|
||||
*
|
||||
* TODO:
|
||||
* - ComboBox_[GS]etMinVisible()
|
||||
* - CB_GETMINVISIBLE, CB_SETMINVISIBLE
|
||||
* - CB_SETTOPINDEX
|
||||
*/
|
||||
|
||||
|
@ -179,16 +168,10 @@ static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* COMBO_NCDestroy
|
||||
*/
|
||||
static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
|
||||
{
|
||||
|
||||
if (lphc)
|
||||
{
|
||||
TRACE("[%p]: freeing storage\n", lphc->self);
|
||||
|
||||
if ((CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox)
|
||||
DestroyWindow(lphc->hWndLBox);
|
||||
|
||||
|
@ -651,6 +634,44 @@ static void CBPaintButton( LPHEADCOMBO lphc, HDC hdc, RECT rectButton)
|
|||
DrawFrameControl(hdc, &rectButton, DFC_SCROLL, buttonState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* COMBO_PrepareColors
|
||||
*
|
||||
* This method will sent the appropriate WM_CTLCOLOR message to
|
||||
* prepare and setup the colors for the combo's DC.
|
||||
*
|
||||
* It also returns the brush to use for the background.
|
||||
*/
|
||||
static HBRUSH COMBO_PrepareColors(
|
||||
LPHEADCOMBO lphc,
|
||||
HDC hDC)
|
||||
{
|
||||
HBRUSH hBkgBrush;
|
||||
|
||||
if (CB_DISABLED(lphc))
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
hBkgBrush = GetControlColor(lphc->owner, lphc->self, hDC, WM_CTLCOLORSTATIC);
|
||||
#else
|
||||
hBkgBrush = (HBRUSH)SendMessageW(lphc->owner, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)lphc->self);
|
||||
#endif
|
||||
SetTextColor(hDC, GetSysColor(COLOR_GRAYTEXT));
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
hBkgBrush = GetControlColor(lphc->owner, lphc->self, hDC, WM_CTLCOLOREDIT);
|
||||
#else
|
||||
hBkgBrush = (HBRUSH)SendMessageW(lphc->owner, WM_CTLCOLOREDIT, (WPARAM)hDC, (LPARAM)lphc->self);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!hBkgBrush)
|
||||
hBkgBrush = GetSysColorBrush(COLOR_WINDOW);
|
||||
|
||||
return hBkgBrush;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CBPaintText
|
||||
*
|
||||
|
@ -801,103 +822,32 @@ static void CBPaintBorder(
|
|||
DrawEdge(hdc, &clientRect, EDGE_SUNKEN, BF_RECT);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* COMBO_PrepareColors
|
||||
*
|
||||
* This method will sent the appropriate WM_CTLCOLOR message to
|
||||
* prepare and setup the colors for the combo's DC.
|
||||
*
|
||||
* It also returns the brush to use for the background.
|
||||
*/
|
||||
static HBRUSH COMBO_PrepareColors(
|
||||
LPHEADCOMBO lphc,
|
||||
HDC hDC)
|
||||
{
|
||||
HBRUSH hBkgBrush;
|
||||
|
||||
/*
|
||||
* Get the background brush for this control.
|
||||
*/
|
||||
if (CB_DISABLED(lphc))
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
hBkgBrush = GetControlColor(lphc->owner, lphc->self, hDC, WM_CTLCOLORSTATIC);
|
||||
#else
|
||||
hBkgBrush = (HBRUSH)SendMessageW(lphc->owner, WM_CTLCOLORSTATIC,
|
||||
(WPARAM)hDC, (LPARAM)lphc->self );
|
||||
#endif
|
||||
/*
|
||||
* We have to change the text color since WM_CTLCOLORSTATIC will
|
||||
* set it to the "enabled" color. This is the same behavior as the
|
||||
* edit control
|
||||
*/
|
||||
SetTextColor(hDC, GetSysColor(COLOR_GRAYTEXT));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: In which cases WM_CTLCOLORLISTBOX should be sent? */
|
||||
#ifdef __REACTOS__
|
||||
hBkgBrush = GetControlColor(lphc->owner, lphc->self, hDC, WM_CTLCOLOREDIT);
|
||||
#else
|
||||
hBkgBrush = (HBRUSH)SendMessageW(lphc->owner, WM_CTLCOLOREDIT,
|
||||
(WPARAM)hDC, (LPARAM)lphc->self );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Catch errors.
|
||||
*/
|
||||
if( !hBkgBrush )
|
||||
hBkgBrush = GetSysColorBrush(COLOR_WINDOW);
|
||||
|
||||
return hBkgBrush;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* COMBO_Paint
|
||||
*/
|
||||
static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
|
||||
hDC = (hParamDC) ? hParamDC
|
||||
: BeginPaint( lphc->self, &ps);
|
||||
|
||||
TRACE("hdc=%p\n", hDC);
|
||||
hDC = (hParamDC) ? hParamDC : BeginPaint(lphc->self, &ps);
|
||||
|
||||
if (hDC && !(lphc->wState & CBF_NOREDRAW))
|
||||
{
|
||||
HBRUSH hPrevBrush, hBkgBrush;
|
||||
|
||||
/*
|
||||
* Retrieve the background brush and select it in the
|
||||
* DC.
|
||||
*/
|
||||
hBkgBrush = COMBO_PrepareColors(lphc, hDC);
|
||||
|
||||
hPrevBrush = SelectObject(hDC, hBkgBrush);
|
||||
if (!(lphc->wState & CBF_EDIT))
|
||||
FillRect(hDC, &lphc->textRect, hBkgBrush);
|
||||
|
||||
/*
|
||||
* In non 3.1 look, there is a sunken border on the combobox
|
||||
*/
|
||||
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)
|
||||
{
|
||||
RECT rPadEdit = lphc->textRect;
|
||||
|
||||
InflateRect(&rPadEdit, EDIT_CONTROL_PADDING(), EDIT_CONTROL_PADDING());
|
||||
|
||||
FrameRect(hDC, &rPadEdit, GetSysColorBrush(COLOR_WINDOW));
|
||||
}
|
||||
|
||||
|
@ -967,11 +917,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) )
|
||||
{
|
||||
|
@ -1086,8 +1034,7 @@ static void CBDropDown( LPHEADCOMBO lphc )
|
|||
|
||||
|
||||
if( !(lphc->wState & CBF_NOREDRAW) )
|
||||
RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE |
|
||||
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
|
||||
RedrawWindow(lphc->self, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
|
||||
|
||||
EnableWindow( lphc->hWndLBox, TRUE );
|
||||
if (GetCapture() != lphc->self)
|
||||
|
@ -1841,9 +1788,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
if (pWnd)
|
||||
{
|
||||
if (!pWnd->fnid)
|
||||
{
|
||||
NtUserSetWindowFNID(hwnd, FNID_COMBOBOX);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pWnd->fnid != FNID_COMBOBOX)
|
||||
|
@ -1855,9 +1800,6 @@ 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 );
|
||||
|
||||
#ifndef __REACTOS__
|
||||
if (!IsWindow(hwnd)) return 0;
|
||||
#endif
|
||||
|
@ -1865,13 +1807,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:
|
||||
|
@ -1879,8 +1817,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
#ifdef __REACTOS__
|
||||
NtUserSetWindowFNID(hwnd, FNID_DESTROY);
|
||||
#endif
|
||||
break;/* -> DefWindowProc */
|
||||
|
||||
break;
|
||||
case WM_CREATE:
|
||||
{
|
||||
HWND hwndParent;
|
||||
|
@ -1897,17 +1834,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;
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
{
|
||||
LRESULT result = DLGC_WANTARROWS | DLGC_WANTCHARS;
|
||||
|
@ -1921,8 +1852,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);
|
||||
|
@ -1932,7 +1863,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
case WM_SETFOCUS:
|
||||
if (lphc->wState & CBF_EDIT) {
|
||||
SetFocus( lphc->hWndEdit );
|
||||
/* The first time focus is received, select all the text */
|
||||
if (!(lphc->wState & CBF_BEENFOCUSED)) {
|
||||
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
|
||||
lphc->wState |= CBF_BEENFOCUSED;
|
||||
|
@ -1944,8 +1874,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;
|
||||
}
|
||||
|
@ -1978,12 +1907,9 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
case WM_PASTE:
|
||||
case WM_COPY:
|
||||
if (lphc->wState & CBF_EDIT)
|
||||
{
|
||||
return unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
|
||||
SendMessageA(lphc->hWndEdit, message, wParam, lParam);
|
||||
}
|
||||
else return CB_ERR;
|
||||
|
||||
case WM_DRAWITEM:
|
||||
case WM_DELETEITEM:
|
||||
case WM_COMPAREITEM:
|
||||
|
@ -1993,8 +1919,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
if (lphc->wState & CBF_EDIT)
|
||||
EnableWindow(lphc->hWndEdit, (BOOL)wParam);
|
||||
EnableWindow(lphc->hWndLBox, (BOOL)wParam);
|
||||
|
||||
/* Force the control to repaint when the enabled state changes. */
|
||||
InvalidateRect(lphc->self, NULL, TRUE);
|
||||
return TRUE;
|
||||
case WM_SETREDRAW:
|
||||
|
@ -2002,7 +1926,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
lphc->wState &= ~CBF_NOREDRAW;
|
||||
else
|
||||
lphc->wState |= CBF_NOREDRAW;
|
||||
|
||||
if (lphc->wState & CBF_EDIT)
|
||||
SendMessageW(lphc->hWndEdit, message, wParam, lParam);
|
||||
SendMessageW(lphc->hWndLBox, message, wParam, lParam);
|
||||
|
@ -2016,7 +1939,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
if(wParam == VK_UP || wParam == VK_DOWN)
|
||||
COMBO_FlipListbox(lphc, FALSE, FALSE);
|
||||
return 0;
|
||||
|
||||
case WM_KEYDOWN:
|
||||
if ((wParam == VK_RETURN || wParam == VK_ESCAPE) &&
|
||||
(lphc->wState & CBF_DROPPED))
|
||||
|
@ -2039,7 +1961,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
hwndTarget = lphc->hWndEdit;
|
||||
else
|
||||
hwndTarget = lphc->hWndLBox;
|
||||
|
||||
return unicode ? SendMessageW(hwndTarget, message, wParam, lParam) :
|
||||
SendMessageA(hwndTarget, message, wParam, lParam);
|
||||
}
|
||||
|
@ -2054,18 +1975,13 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
if (lphc->wState & CBF_CAPTURE)
|
||||
COMBO_MouseMove(lphc, wParam, lParam);
|
||||
return TRUE;
|
||||
|
||||
case WM_MOUSEWHEEL:
|
||||
if (wParam & (MK_SHIFT | MK_CONTROL))
|
||||
return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
|
||||
DefWindowProcA(hwnd, message, wParam, lParam);
|
||||
|
||||
if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0);
|
||||
if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0);
|
||||
return TRUE;
|
||||
|
||||
/* Combo messages */
|
||||
|
||||
case CB_ADDSTRING:
|
||||
if (unicode)
|
||||
{
|
||||
|
@ -2075,8 +1991,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
CharUpperW((LPWSTR)lParam);
|
||||
return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
|
||||
}
|
||||
else /* unlike the unicode version, the ansi version does not overwrite
|
||||
the string if converting case */
|
||||
else
|
||||
{
|
||||
char *string = NULL;
|
||||
LRESULT ret;
|
||||
|
@ -2085,13 +2000,11 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
string = strdupA((LPSTR)lParam);
|
||||
CharLowerA(string);
|
||||
}
|
||||
|
||||
else if (lphc->dwStyle & CBS_UPPERCASE)
|
||||
{
|
||||
string = strdupA((LPSTR)lParam);
|
||||
CharUpperA(string);
|
||||
}
|
||||
|
||||
ret = SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, string ? (LPARAM)string : lParam);
|
||||
HeapFree(GetProcessHeap(), 0, string);
|
||||
return ret;
|
||||
|
@ -2111,7 +2024,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:
|
||||
|
@ -2128,7 +2040,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
case CB_SETITEMHEIGHT:
|
||||
return COMBO_SetItemHeight(lphc, (INT)wParam, (INT)lParam);
|
||||
case CB_GETITEMHEIGHT:
|
||||
if( (INT)wParam >= 0 ) /* listbox item */
|
||||
if ((INT)wParam >= 0)
|
||||
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
||||
return CBGetTextAreaHeight(hwnd, lphc);
|
||||
case CB_RESETCONTENT:
|
||||
|
@ -2154,18 +2066,13 @@ 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)
|
||||
lphc->droppedWidth = wParam;
|
||||
else if (wParam)
|
||||
lphc->droppedWidth = 0;
|
||||
|
||||
/* recalculate the combobox area */
|
||||
CBCalcPlacement(hwnd, lphc, &lphc->textRect, &lphc->buttonRect, &lphc->droppedRect );
|
||||
|
||||
/* fall through */
|
||||
case CB_GETDROPPEDWIDTH:
|
||||
if (lphc->droppedWidth)
|
||||
|
@ -2179,7 +2086,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
case CB_DIR:
|
||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
|
||||
SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
|
||||
|
||||
case CB_SHOWDROPDOWN:
|
||||
if (CB_GETTYPE(lphc) != CBS_SIMPLE)
|
||||
{
|
||||
|
@ -2188,8 +2094,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;
|
||||
|
@ -2201,8 +2106,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
lParam = SendMessageW(lphc->hWndLBox, LB_SETCURSEL, wParam, 0);
|
||||
if (lParam >= 0)
|
||||
SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX, wParam, 0);
|
||||
|
||||
/* no LBN_SELCHANGE in this case, update manually */
|
||||
if(lphc->wState & CBF_EDIT)
|
||||
CBUpdateEdit(lphc, (INT)wParam);
|
||||
else
|
||||
|
@ -2220,14 +2123,12 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
case CB_SETITEMDATA:
|
||||
return SendMessageW(lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
|
||||
case CB_GETEDITSEL:
|
||||
/* Edit checks passed parameters itself */
|
||||
if (lphc->wState & CBF_EDIT)
|
||||
return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
|
||||
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)
|
||||
|
@ -2244,24 +2145,19 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
if (lphc->wState & CBF_EDIT)
|
||||
return SendMessageW(lphc->hWndEdit, EM_LIMITTEXT, wParam, lParam);
|
||||
return TRUE;
|
||||
|
||||
#ifdef __REACTOS__
|
||||
case WM_UPDATEUISTATE:
|
||||
if (unicode)
|
||||
DefWindowProcW(lphc->self, message, wParam, lParam);
|
||||
else
|
||||
DefWindowProcA(lphc->self, message, wParam, lParam);
|
||||
|
||||
if (COMBO_update_uistate(lphc))
|
||||
{
|
||||
/* redraw text */
|
||||
if (!(lphc->wState & CBF_EDIT))
|
||||
NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CBLOSTTEXTFOCUS: /* undocumented message - deselects the text when focus is lost */
|
||||
{
|
||||
case WM_CBLOSTTEXTFOCUS:
|
||||
if (lphc->hWndEdit != NULL)
|
||||
{
|
||||
SendMessage(lphc->self, WM_LBUTTONUP, 0, 0xFFFFFFFF);
|
||||
|
@ -2269,15 +2165,9 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
|
|||
lphc->wState &= ~CBF_FOCUSED;
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
|
||||
|
@ -2312,10 +2202,8 @@ LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
/*************************************************************************
|
||||
* GetComboBoxInfo (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI GetComboBoxInfo(HWND hwndCombo, /* [in] handle to combo box */
|
||||
PCOMBOBOXINFO pcbi /* [in/out] combo box information */)
|
||||
BOOL WINAPI GetComboBoxInfo(HWND hwndCombo, PCOMBOBOXINFO pcbi)
|
||||
{
|
||||
TRACE("(%p, %p)\n", hwndCombo, pcbi);
|
||||
#ifdef __REACTOS__
|
||||
return NtUserGetComboBoxInfo(hwndCombo, pcbi);
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue