mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
Fixed 11 winetests for edit boxes based on code from wine but tweaked for ReactOS
svn path=/trunk/; revision=33909
This commit is contained in:
parent
f5a1426f4c
commit
2692c60678
1 changed files with 50 additions and 14 deletions
|
@ -4084,6 +4084,27 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Helper function for WM_CHAR
|
||||||
|
*
|
||||||
|
* According to an MSDN blog article titled "Just because you're a control
|
||||||
|
* doesn't mean that you're necessarily inside a dialog box," multiline edit
|
||||||
|
* controls without ES_WANTRETURN would attempt to detect whether it is inside
|
||||||
|
* a dialog box or not.
|
||||||
|
*/
|
||||||
|
static BOOL EDIT_IsInsideDialog(EDITSTATE *es)
|
||||||
|
{
|
||||||
|
if (es->hwndParent && es->hwndParent != GetDesktopWindow())
|
||||||
|
{
|
||||||
|
PWINDOW pParent = ValidateHwnd( es->hwndParent );
|
||||||
|
|
||||||
|
/* TODO: This should really check fnID instead of ExtraDataSize I guess */
|
||||||
|
if (pParent && pParent->ExtraDataSize >= DLGWINDOWEXTRA)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -4717,21 +4738,36 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
|
||||||
} else if (control)
|
} else if (control)
|
||||||
EDIT_WM_Copy(es);
|
EDIT_WM_Copy(es);
|
||||||
break;
|
break;
|
||||||
case VK_RETURN:
|
case VK_RETURN:
|
||||||
/* If the edit doesn't want the return send a message to the default object */
|
/* If the edit doesn't want the return send a message to the default object */
|
||||||
if(!(es->style & ES_WANTRETURN))
|
if(!(es->style & ES_MULTILINE) || !(es->style & ES_WANTRETURN))
|
||||||
{
|
{
|
||||||
HWND hwndParent = GetParent(es->hwndSelf);
|
HWND hwndParent;
|
||||||
DWORD dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 );
|
DWORD dw;
|
||||||
if (HIWORD(dw) == DC_HASDEFID)
|
|
||||||
{
|
if (!EDIT_IsInsideDialog(es)) return 1;
|
||||||
SendMessageW( hwndParent, WM_COMMAND,
|
if (control) break;
|
||||||
MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
|
|
||||||
(LPARAM)GetDlgItem( hwndParent, LOWORD(dw) ) );
|
hwndParent = GetParent(es->hwndSelf);
|
||||||
}
|
dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 );
|
||||||
}
|
if (HIWORD(dw) == DC_HASDEFID)
|
||||||
break;
|
{
|
||||||
}
|
SendMessageW( hwndParent, WM_COMMAND,
|
||||||
|
MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
|
||||||
|
(LPARAM)GetDlgItem( hwndParent, LOWORD(dw) ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SendMessageW( hwndParent, WM_COMMAND, IDOK, (LPARAM)GetDlgItem( hwndParent, IDOK ) );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VK_ESCAPE:
|
||||||
|
if (!(es->style & ES_MULTILINE))
|
||||||
|
SendMessageW(GetParent(es->hwndSelf), WM_COMMAND, IDCANCEL, (LPARAM)GetDlgItem( GetParent(es->hwndSelf), IDCANCEL ) );
|
||||||
|
break;
|
||||||
|
case VK_TAB:
|
||||||
|
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue