#pragma hdrstop
#endif
-#if wxUSE_VALIDATORS
+#if wxUSE_VALIDATORS && wxUSE_TEXTCTRL
#ifndef WX_PRECOMP
#include <stdio.h>
if( !CheckValidator() )
return FALSE;
+ if (!m_stringValue)
+ return TRUE;
+
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
control->SetValue(* m_stringValue) ;
if( !CheckValidator() )
return FALSE;
+ if (!m_stringValue)
+ return TRUE;
+
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
* m_stringValue = control->GetValue() ;
{
// Allow for "," (French) as well as "." -- in future we should
// use wxSystemSettings or other to do better localisation
- if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ',') && (val[i] != wxT('e')) && (val[i] != wxT('E')))
- if(!((i == 0) && (val[i] == '-')))
+ if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ',') && (val[i] != wxT('e')) && (val[i] != wxT('E')) && (val[i] != wxT('+')) && (val[i] != wxT('-')))
return FALSE;
}
return TRUE;
}
#endif
- // wxUSE_VALIDATORS
+ // wxUSE_VALIDATORS && wxUSE_TEXTCTRL