mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:42:57 +00:00
[User32]
- 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:
parent
9a8b7304ea
commit
e09b719f49
5 changed files with 95 additions and 684 deletions
|
@ -1921,10 +1921,16 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
case WM_GETFONT:
|
case WM_GETFONT:
|
||||||
return (LRESULT)lphc->hFont;
|
return (LRESULT)lphc->hFont;
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT ) {
|
||||||
SetFocus( lphc->hWndEdit );
|
SetFocus( lphc->hWndEdit );
|
||||||
else
|
/* The first time focus is received, select all the text */
|
||||||
COMBO_SetFocus( lphc );
|
if( !(lphc->wState & CBF_BEENFOCUSED) ) {
|
||||||
|
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
|
||||||
|
lphc->wState |= CBF_BEENFOCUSED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
COMBO_SetFocus( lphc );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
{
|
{
|
||||||
|
@ -2047,11 +2053,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
|
|
||||||
/* Combo messages */
|
/* Combo messages */
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_ADDSTRING16:
|
|
||||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam);
|
|
||||||
/* fall through */
|
|
||||||
#endif
|
|
||||||
case CB_ADDSTRING:
|
case CB_ADDSTRING:
|
||||||
if( unicode )
|
if( unicode )
|
||||||
{
|
{
|
||||||
|
@ -2082,12 +2083,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
HeapFree(GetProcessHeap(), 0, string);
|
HeapFree(GetProcessHeap(), 0, string);
|
||||||
return ret;
|
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:
|
case CB_INSERTSTRING:
|
||||||
if( unicode )
|
if( unicode )
|
||||||
{
|
{
|
||||||
|
@ -2106,57 +2101,23 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
|
|
||||||
return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||||
}
|
}
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_DELETESTRING16:
|
|
||||||
#endif
|
|
||||||
case CB_DELETESTRING:
|
case CB_DELETESTRING:
|
||||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :
|
return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :
|
||||||
SendMessageA(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:
|
case CB_SELECTSTRING:
|
||||||
return COMBO_SelectString(lphc, (INT)wParam, lParam, unicode);
|
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:
|
case CB_FINDSTRING:
|
||||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam) :
|
return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam) :
|
||||||
SendMessageA(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:
|
case CB_FINDSTRINGEXACT:
|
||||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam) :
|
return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam) :
|
||||||
SendMessageA(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:
|
case CB_SETITEMHEIGHT:
|
||||||
return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
|
return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_GETITEMHEIGHT16:
|
|
||||||
wParam = (INT)(INT16)wParam;
|
|
||||||
/* fall through */
|
|
||||||
#endif
|
|
||||||
case CB_GETITEMHEIGHT:
|
case CB_GETITEMHEIGHT:
|
||||||
if( (INT)wParam >= 0 ) /* listbox item */
|
if( (INT)wParam >= 0 ) /* listbox item */
|
||||||
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
||||||
return CBGetTextAreaHeight(hwnd, lphc);
|
return CBGetTextAreaHeight(hwnd, lphc);
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_RESETCONTENT16:
|
|
||||||
#endif
|
|
||||||
case CB_RESETCONTENT:
|
case CB_RESETCONTENT:
|
||||||
SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
|
SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
|
||||||
if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
|
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) &&
|
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) &&
|
||||||
(INT)wParam < 32768 ) lphc->droppedWidth = (INT)wParam;
|
(INT)wParam < 32768 ) lphc->droppedWidth = (INT)wParam;
|
||||||
return CB_ERR;
|
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:
|
case CB_GETDROPPEDCONTROLRECT:
|
||||||
if( lParam ) CBGetDroppedControlRect(lphc, (LPRECT)lParam );
|
if( lParam ) CBGetDroppedControlRect(lphc, (LPRECT)lParam );
|
||||||
return CB_OKAY;
|
return CB_OKAY;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_GETDROPPEDSTATE16:
|
|
||||||
#endif
|
|
||||||
case CB_GETDROPPEDSTATE:
|
case CB_GETDROPPEDSTATE:
|
||||||
return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
|
return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_DIR16:
|
|
||||||
return SendMessageA(lphc->hWndLBox, LB_DIR16, wParam, lParam);
|
|
||||||
#endif
|
|
||||||
case CB_DIR:
|
case CB_DIR:
|
||||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
|
return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
|
||||||
SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
|
SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_SHOWDROPDOWN16:
|
|
||||||
#endif
|
|
||||||
case CB_SHOWDROPDOWN:
|
case CB_SHOWDROPDOWN:
|
||||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||||
{
|
{
|
||||||
|
@ -2234,21 +2170,10 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
CBRollUp( lphc, FALSE, TRUE );
|
CBRollUp( lphc, FALSE, TRUE );
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_GETCOUNT16:
|
|
||||||
#endif
|
|
||||||
case CB_GETCOUNT:
|
case CB_GETCOUNT:
|
||||||
return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
|
return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_GETCURSEL16:
|
|
||||||
#endif
|
|
||||||
case CB_GETCURSEL:
|
case CB_GETCURSEL:
|
||||||
return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
|
return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_SETCURSEL16:
|
|
||||||
wParam = (INT)(INT16)wParam;
|
|
||||||
/* fall through */
|
|
||||||
#endif
|
|
||||||
case CB_SETCURSEL:
|
case CB_SETCURSEL:
|
||||||
lParam = SendMessageW(lphc->hWndLBox, LB_SETCURSEL, wParam, 0);
|
lParam = SendMessageW(lphc->hWndLBox, LB_SETCURSEL, wParam, 0);
|
||||||
if( lParam >= 0 )
|
if( lParam >= 0 )
|
||||||
|
@ -2261,58 +2186,26 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
InvalidateRect(lphc->self, &lphc->textRect, TRUE);
|
InvalidateRect(lphc->self, &lphc->textRect, TRUE);
|
||||||
lphc->wState &= ~CBF_SELCHANGE;
|
lphc->wState &= ~CBF_SELCHANGE;
|
||||||
return lParam;
|
return lParam;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_GETLBTEXT16:
|
|
||||||
wParam = (INT)(INT16)wParam;
|
|
||||||
lParam = (LPARAM)MapSL(lParam);
|
|
||||||
/* fall through */
|
|
||||||
#endif
|
|
||||||
case CB_GETLBTEXT:
|
case CB_GETLBTEXT:
|
||||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
|
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
|
||||||
SendMessageA(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:
|
case CB_GETLBTEXTLEN:
|
||||||
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0) :
|
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0) :
|
||||||
SendMessageA(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:
|
case CB_GETITEMDATA:
|
||||||
return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
|
return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_SETITEMDATA16:
|
|
||||||
wParam = (INT)(INT16)wParam;
|
|
||||||
/* fall through */
|
|
||||||
#endif
|
|
||||||
case CB_SETITEMDATA:
|
case CB_SETITEMDATA:
|
||||||
return SendMessageW(lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
|
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:
|
case CB_GETEDITSEL:
|
||||||
/* Edit checks passed parameters itself */
|
/* Edit checks passed parameters itself */
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
|
return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
|
||||||
return CB_ERR;
|
return CB_ERR;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_SETEDITSEL16:
|
|
||||||
#endif
|
|
||||||
case CB_SETEDITSEL:
|
case CB_SETEDITSEL:
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
return SendMessageW(lphc->hWndEdit, EM_SETSEL,
|
return SendMessageW(lphc->hWndEdit, EM_SETSEL,
|
||||||
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
|
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
|
||||||
return CB_ERR;
|
return CB_ERR;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_SETEXTENDEDUI16:
|
|
||||||
#endif
|
|
||||||
case CB_SETEXTENDEDUI:
|
case CB_SETEXTENDEDUI:
|
||||||
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
|
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
|
||||||
return CB_ERR;
|
return CB_ERR;
|
||||||
|
@ -2320,9 +2213,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
lphc->wState |= CBF_EUI;
|
lphc->wState |= CBF_EUI;
|
||||||
else lphc->wState &= ~CBF_EUI;
|
else lphc->wState &= ~CBF_EUI;
|
||||||
return CB_OKAY;
|
return CB_OKAY;
|
||||||
#ifndef __REACTOS__
|
|
||||||
case CB_GETEXTENDEDUI16:
|
|
||||||
#endif
|
|
||||||
case CB_GETEXTENDEDUI:
|
case CB_GETEXTENDEDUI:
|
||||||
return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
|
return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
|
||||||
case CB_GETCOMBOBOXINFO:
|
case CB_GETCOMBOBOXINFO:
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -74,6 +74,7 @@
|
||||||
#define CBF_SELCHANGE 0x0400
|
#define CBF_SELCHANGE 0x0400
|
||||||
#define CBF_NOEDITNOTIFY 0x1000
|
#define CBF_NOEDITNOTIFY 0x1000
|
||||||
#define CBF_NOLBSELECT 0x2000 /* do not change current selection */
|
#define CBF_NOLBSELECT 0x2000 /* do not change current selection */
|
||||||
|
#define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
|
||||||
#define CBF_EUI 0x8000
|
#define CBF_EUI 0x8000
|
||||||
|
|
||||||
/* combo state struct */
|
/* combo state struct */
|
||||||
|
|
|
@ -1355,22 +1355,22 @@ User32DefWindowProc(HWND hWnd,
|
||||||
|
|
||||||
if (Style & WS_CHILD)
|
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)
|
if (LOWORD(lParam) < HTLEFT || LOWORD(lParam) > HTBOTTOMRIGHT)
|
||||||
{
|
{
|
||||||
BOOL bResult;
|
HWND parent = GetParent( hWnd );
|
||||||
if (bUnicode)
|
if (bUnicode)
|
||||||
{
|
{
|
||||||
bResult = SendMessageW(GetParent(hWnd), WM_SETCURSOR,
|
if (parent != GetDesktopWindow() &&
|
||||||
wParam, lParam);
|
SendMessageW( parent, WM_SETCURSOR, wParam, lParam))
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bResult = SendMessageA(GetParent(hWnd), WM_SETCURSOR,
|
if (parent != GetDesktopWindow() &&
|
||||||
wParam, lParam);
|
SendMessageA( parent, WM_SETCURSOR, wParam, lParam))
|
||||||
}
|
return TRUE;
|
||||||
if (bResult)
|
|
||||||
{
|
|
||||||
return(TRUE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -580,10 +580,10 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
|
||||||
WORD signature;
|
WORD signature;
|
||||||
WORD dlgver;
|
WORD dlgver;
|
||||||
|
|
||||||
signature = GET_WORD(p); p++;
|
|
||||||
dlgver = 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->dialogEx = TRUE;
|
||||||
result->helpId = GET_DWORD(p); p += 2;
|
result->helpId = GET_DWORD(p); p += 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue