1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-06 06:31:07 +01:00

Use an enum class for numeric validator styles

This commit is contained in:
Paul Licameli
2017-10-30 12:18:10 -04:00
parent cad632b9b0
commit 6e7d7447c1
21 changed files with 97 additions and 91 deletions

View File

@@ -55,15 +55,15 @@ END_EVENT_TABLE()
int NumValidatorBase::GetFormatFlags() const
{
int flags = NumberFormatter::Style_None;
if ( m_style & NUM_VAL_THOUSANDS_SEPARATOR )
if ( m_style & NumValidatorStyle::THOUSANDS_SEPARATOR )
flags |= NumberFormatter::Style_WithThousandsSep;
if ( m_style & NUM_VAL_NO_TRAILING_ZEROES )
if ( m_style & NumValidatorStyle::NO_TRAILING_ZEROES )
flags |= NumberFormatter::Style_NoTrailingZeroes;
if ( m_style & NUM_VAL_ONE_TRAILING_ZERO )
if ( m_style & NumValidatorStyle::ONE_TRAILING_ZERO )
flags |= NumberFormatter::Style_OneTrailingZero;
if ( m_style & NUM_VAL_TWO_TRAILING_ZEROES )
if ( m_style & NumValidatorStyle::TWO_TRAILING_ZEROES )
flags |= NumberFormatter::Style_TwoTrailingZeroes;
if ( m_style & NUM_VAL_THREE_TRAILING_ZEROES )
if ( m_style & NumValidatorStyle::THREE_TRAILING_ZEROES )
flags |= NumberFormatter::Style_ThreeTrailingZeroes;
return flags;
@@ -353,7 +353,7 @@ bool IntegerValidatorBase::DoValidateNumber(wxString * errMsg) const
if ( s.empty() )
{
// Is blank, but allowed. Stop here
if ( HasFlag(NUM_VAL_ZERO_AS_BLANK) )
if ( HasFlag(NumValidatorStyle::ZERO_AS_BLANK) )
{
return true;
}
@@ -478,7 +478,7 @@ bool FloatingPointValidatorBase::DoValidateNumber(wxString * errMsg) const
if ( s.empty() )
{
if ( HasFlag(NUM_VAL_ZERO_AS_BLANK) )
if ( HasFlag(NumValidatorStyle::ZERO_AS_BLANK) )
return true; //Is blank, but allowed. Stop here
else
{