From d7c54ad86089aa368b0b53af422f3327632d677f Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Sat, 24 Jul 2004 09:43:09 +0000 Subject: [PATCH] Krishna Murthy Modified EDIT_WM_Char() to restrict keying in of letters other than numbers when ES_NUMBER style is set. svn path=/trunk/; revision=10278 --- reactos/lib/user32/controls/edit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/lib/user32/controls/edit.c b/reactos/lib/user32/controls/edit.c index 154171b4f5f..058e82a0508 100644 --- a/reactos/lib/user32/controls/edit.c +++ b/reactos/lib/user32/controls/edit.c @@ -23,7 +23,6 @@ * TODO: * - ES_CENTER * - ES_RIGHT - * - ES_NUMBER (new since win95) * - ES_OEMCONVERT * -!ES_AUTOVSCROLL (every multi line control *is* auto vscroll) * -!ES_AUTOHSCROLL (every single line control *is* auto hscroll) @@ -3766,6 +3765,10 @@ static void EDIT_WM_Char(EDITSTATE *es, WCHAR c) break; default: + /*If Edit control style is ES_NUMBER allow users to key in only numeric values*/ + if( (es->style & ES_NUMBER) && !( c >= '0' && c <= '9') ) + break; + if (!(es->style & ES_READONLY) && (c >= ' ') && (c != 127)) { WCHAR str[2]; str[0] = c;