- Remove 16 bit'isms. Added back removed code and commented it out with added notes.
- Jason Edmeades : Combo should preselect all text on first WM_SETFOCUS.
- Kusanagi Kouichi : Consolidate empty string.
- Alexandre Julliard : Don' t forward WM_SETCURSOR to the desktop window. Modified.
- Dmitry Timoshkov : In a DLGTEMPLATEEX resource dialog version goes before signature.
- Due to truck freeze, there might have slipped in miscellaneous patches.

svn path=/trunk/; revision=45670
This commit is contained in:
James Tabor 2010-02-23 15:28:45 +00:00
parent 9a8b7304ea
commit e09b719f49
5 changed files with 95 additions and 684 deletions

View file

@ -1921,8 +1921,14 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
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) ) {
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
lphc->wState |= CBF_BEENFOCUSED;
}
}
else
COMBO_SetFocus( lphc );
return TRUE;
@ -2047,11 +2053,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
/* Combo messages */
#ifndef __REACTOS__
case CB_ADDSTRING16:
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam);
/* fall through */
#endif
case CB_ADDSTRING:
if( unicode )
{
@ -2082,12 +2083,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
HeapFree(GetProcessHeap(), 0, string);
return ret;
}
#ifndef __REACTOS__
case CB_INSERTSTRING16:
wParam = (INT)(INT16)wParam;
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam);
/* fall through */
#endif
case CB_INSERTSTRING:
if( unicode )
{
@ -2106,57 +2101,23 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
}
#ifndef __REACTOS__
case CB_DELETESTRING16:
#endif
case CB_DELETESTRING:
return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :
SendMessageA(lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
#ifndef __REACTOS__
case CB_SELECTSTRING16:
wParam = (INT)(INT16)wParam;
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam);
/* fall through */
#endif
case CB_SELECTSTRING:
return COMBO_SelectString(lphc, (INT)wParam, lParam, unicode);
#ifndef __REACTOS__
case CB_FINDSTRING16:
wParam = (INT)(INT16)wParam;
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam);
/* fall through */
#endif
case CB_FINDSTRING:
return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam) :
SendMessageA(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
#ifndef __REACTOS__
case CB_FINDSTRINGEXACT16:
wParam = (INT)(INT16)wParam;
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam);
/* fall through */
#endif
case CB_FINDSTRINGEXACT:
return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam) :
SendMessageA(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam);
#ifndef __REACTOS__
case CB_SETITEMHEIGHT16:
wParam = (INT)(INT16)wParam; /* signed integer */
/* fall through */
#endif
case CB_SETITEMHEIGHT:
return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
#ifndef __REACTOS__
case CB_GETITEMHEIGHT16:
wParam = (INT)(INT16)wParam;
/* fall through */
#endif
case CB_GETITEMHEIGHT:
if( (INT)wParam >= 0 ) /* listbox item */
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
return CBGetTextAreaHeight(hwnd, lphc);
#ifndef __REACTOS__
case CB_RESETCONTENT16:
#endif
case CB_RESETCONTENT:
SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
@ -2187,40 +2148,15 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) &&
(INT)wParam < 32768 ) lphc->droppedWidth = (INT)wParam;
return CB_ERR;
#ifndef __REACTOS__
case CB_GETDROPPEDCONTROLRECT16:
lParam = (LPARAM)MapSL(lParam);
if( lParam )
{
RECT r;
RECT16 *r16 = (RECT16 *)lParam;
CBGetDroppedControlRect( lphc, &r );
r16->left = r.left;
r16->top = r.top;
r16->right = r.right;
r16->bottom = r.bottom;
}
return CB_OKAY;
#endif
case CB_GETDROPPEDCONTROLRECT:
if( lParam ) CBGetDroppedControlRect(lphc, (LPRECT)lParam );
return CB_OKAY;
#ifndef __REACTOS__
case CB_GETDROPPEDSTATE16:
#endif
case CB_GETDROPPEDSTATE:
return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
#ifndef __REACTOS__
case CB_DIR16:
return SendMessageA(lphc->hWndLBox, LB_DIR16, wParam, lParam);
#endif
case CB_DIR:
return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
#ifndef __REACTOS__
case CB_SHOWDROPDOWN16:
#endif
case CB_SHOWDROPDOWN:
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
{
@ -2234,21 +2170,10 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
CBRollUp( lphc, FALSE, TRUE );
}
return TRUE;
#ifndef __REACTOS__
case CB_GETCOUNT16:
#endif
case CB_GETCOUNT:
return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
#ifndef __REACTOS__
case CB_GETCURSEL16:
#endif
case CB_GETCURSEL:
return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
#ifndef __REACTOS__
case CB_SETCURSEL16:
wParam = (INT)(INT16)wParam;
/* fall through */
#endif
case CB_SETCURSEL:
lParam = SendMessageW(lphc->hWndLBox, LB_SETCURSEL, wParam, 0);
if( lParam >= 0 )
@ -2261,58 +2186,26 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
InvalidateRect(lphc->self, &lphc->textRect, TRUE);
lphc->wState &= ~CBF_SELCHANGE;
return lParam;
#ifndef __REACTOS__
case CB_GETLBTEXT16:
wParam = (INT)(INT16)wParam;
lParam = (LPARAM)MapSL(lParam);
/* fall through */
#endif
case CB_GETLBTEXT:
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
SendMessageA(lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
#ifndef __REACTOS__
case CB_GETLBTEXTLEN16:
wParam = (INT)(INT16)wParam;
/* fall through */
#endif
case CB_GETLBTEXTLEN:
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0) :
SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
#ifndef __REACTOS__
case CB_GETITEMDATA16:
wParam = (INT)(INT16)wParam;
/* fall through */
#endif
case CB_GETITEMDATA:
return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
#ifndef __REACTOS__
case CB_SETITEMDATA16:
wParam = (INT)(INT16)wParam;
/* fall through */
#endif
case CB_SETITEMDATA:
return SendMessageW(lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
#ifndef __REACTOS__
case CB_GETEDITSEL16:
wParam = lParam = 0; /* just in case */
/* fall through */
#endif
case CB_GETEDITSEL:
/* Edit checks passed parameters itself */
if( lphc->wState & CBF_EDIT )
return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
return CB_ERR;
#ifndef __REACTOS__
case CB_SETEDITSEL16:
#endif
case CB_SETEDITSEL:
if( lphc->wState & CBF_EDIT )
return SendMessageW(lphc->hWndEdit, EM_SETSEL,
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
return CB_ERR;
#ifndef __REACTOS__
case CB_SETEXTENDEDUI16:
#endif
case CB_SETEXTENDEDUI:
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
return CB_ERR;
@ -2320,9 +2213,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
lphc->wState |= CBF_EUI;
else lphc->wState &= ~CBF_EUI;
return CB_OKAY;
#ifndef __REACTOS__
case CB_GETEXTENDEDUI16:
#endif
case CB_GETEXTENDEDUI:
return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
case CB_GETCOMBOBOXINFO:

File diff suppressed because it is too large Load diff

View file

@ -74,6 +74,7 @@
#define CBF_SELCHANGE 0x0400
#define CBF_NOEDITNOTIFY 0x1000
#define CBF_NOLBSELECT 0x2000 /* do not change current selection */
#define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
#define CBF_EUI 0x8000
/* combo state struct */

View file

@ -1355,22 +1355,22 @@ User32DefWindowProc(HWND hWnd,
if (Style & WS_CHILD)
{
/* with the exception of the border around a resizable wnd,
* give the parent first chance to set the cursor */
if (LOWORD(lParam) < HTLEFT || LOWORD(lParam) > HTBOTTOMRIGHT)
{
BOOL bResult;
HWND parent = GetParent( hWnd );
if (bUnicode)
{
bResult = SendMessageW(GetParent(hWnd), WM_SETCURSOR,
wParam, lParam);
if (parent != GetDesktopWindow() &&
SendMessageW( parent, WM_SETCURSOR, wParam, lParam))
return TRUE;
}
else
{
bResult = SendMessageA(GetParent(hWnd), WM_SETCURSOR,
wParam, lParam);
}
if (bResult)
{
return(TRUE);
if (parent != GetDesktopWindow() &&
SendMessageA( parent, WM_SETCURSOR, wParam, lParam))
return TRUE;
}
}
}

View file

@ -580,10 +580,10 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
WORD signature;
WORD dlgver;
signature = GET_WORD(p); p++;
dlgver = GET_WORD(p); p++;
signature = GET_WORD(p); p++;
if (signature == 1 && dlgver == 0xffff) /* DIALOGEX resource */
if (dlgver == 1 && signature == 0xffff) /* DIALOGEX resource */
{
result->dialogEx = TRUE;
result->helpId = GET_DWORD(p); p += 2;