KiCad PCB EDA Suite
incremental_text_ctrl.cpp File Reference
#include <incremental_text_ctrl.h>
#include <utility>

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 33 of file incremental_text_ctrl.cpp.

Referenced by INCREMENTAL_TEXT_CTRL::incrementCtrlBy().

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