From 9ab3acee18d906981cdeb2436a5ddb71ae5ea647 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Jan 2019 04:29:45 +0100 Subject: [PATCH] Don't allow using "-" for unsigned entries in propgrid The changes of 36f6f8ad49038089413dd5e3b3bee151ab78112c allowed using "-" (and also "+") characters even for the unsigned properties, which hadn't been the case before and doesn't seem desirable, so undo this part of the changes. See #1093. --- src/propgrid/props.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index ba3889d90e..d67d9012c7 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -162,8 +162,7 @@ wxNumericPropertyValidator:: { long style = GetStyle(); - // always allow plus and minus signs - wxString allowedChars("+-"); + wxString allowedChars; switch ( base ) { @@ -185,7 +184,11 @@ wxNumericPropertyValidator:: style |= wxFILTER_DIGITS; } - if ( numericType == Float ) + if ( numericType == Signed ) + { + allowedChars += wxS("-+"); + } + else if ( numericType == Float ) { allowedChars += wxS("eE");