KiCad PCB EDA Suite
incremental_text_ctrl.cpp File Reference

Go to the source code of this file.

Functions

static bool validateFloatField (const wxString &aStr)
 Check that a string looks like a floating point number that can be dealt with. More...
 

Function Documentation

static bool validateFloatField ( const wxString &  aStr)
static

Check that a string looks like a floating point number that can be dealt with.

Definition at line 31 of file incremental_text_ctrl.cpp.

Referenced by INCREMENTAL_TEXT_CTRL::incrementCtrlBy().

32 {
33  // Skip empty fields
34  if( aStr.size() == 0 )
35  return false;
36 
37  // a single . or , doesn't count as number, although valid in a float
38  if( aStr.size() == 1 )
39  {
40  if( (aStr.compare( "." ) == 0) ||
41  (aStr.compare( "," ) == 0) )
42  return false;
43  }
44 
45  return true;
46 }