Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
NumericField Class Reference

NumericField is a class used in NumericTextCtrl. More...

Public Member Functions

 NumericField (bool _frac, int _base, int _range, bool _zeropad)
 
 NumericField (const NumericField &)=default
 
NumericFieldoperator= (const NumericField &)=default
 
void CreateDigitFormatStr ()
 

Public Attributes

bool frac
 
int base
 
int range
 
int digits
 
int pos
 
int fieldX
 
int fieldW
 
int labelX
 
bool zeropad
 
wxString label
 
wxString formatStr
 
wxString str
 

Detailed Description

NumericField is a class used in NumericTextCtrl.

Definition at line 302 of file NumericTextCtrl.cpp.

Constructor & Destructor Documentation

◆ NumericField() [1/2]

NumericField::NumericField ( bool  _frac,
int  _base,
int  _range,
bool  _zeropad 
)
inline

Definition at line 305 of file NumericTextCtrl.cpp.

306  {
307  frac = _frac;
308  base = _base;
309  range = _range;
310  zeropad = _zeropad;
311  digits = 0;
312  }

References base, digits, frac, range, and zeropad.

◆ NumericField() [2/2]

NumericField::NumericField ( const NumericField )
default

Member Function Documentation

◆ CreateDigitFormatStr()

void NumericField::CreateDigitFormatStr ( )
inline

Definition at line 317 of file NumericTextCtrl.cpp.

318  {
319  if (range > 1)
320  digits = (int)ceil(log10(range-1.0));
321  else
322  digits = 5; // hack: default
323  if (zeropad && range>1)
324  formatStr.Printf(wxT("%%0%dd"), digits); // ex. "%03d" if digits is 3
325  else {
326  formatStr.Printf(wxT("%%0%dd"), digits);
327  }
328  }

References digits, formatStr, range, and zeropad.

◆ operator=()

NumericField& NumericField::operator= ( const NumericField )
default

Member Data Documentation

◆ base

int NumericField::base

Definition at line 330 of file NumericTextCtrl.cpp.

Referenced by NumericField().

◆ digits

int NumericField::digits

Definition at line 332 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr(), and NumericField().

◆ fieldW

int NumericField::fieldW

Definition at line 335 of file NumericTextCtrl.cpp.

◆ fieldX

int NumericField::fieldX

Definition at line 334 of file NumericTextCtrl.cpp.

◆ formatStr

wxString NumericField::formatStr

Definition at line 339 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr().

◆ frac

bool NumericField::frac

Definition at line 329 of file NumericTextCtrl.cpp.

Referenced by NumericField().

◆ label

wxString NumericField::label

Definition at line 338 of file NumericTextCtrl.cpp.

◆ labelX

int NumericField::labelX

Definition at line 336 of file NumericTextCtrl.cpp.

◆ pos

int NumericField::pos

Definition at line 333 of file NumericTextCtrl.cpp.

◆ range

int NumericField::range

Definition at line 331 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr(), and NumericField().

◆ str

wxString NumericField::str

Definition at line 340 of file NumericTextCtrl.cpp.

◆ zeropad

bool NumericField::zeropad

Definition at line 337 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr(), and NumericField().


The documentation for this class was generated from the following file:
NumericField::digits
int digits
Definition: NumericTextCtrl.cpp:332
NumericField::frac
bool frac
Definition: NumericTextCtrl.cpp:329
NumericField::range
int range
Definition: NumericTextCtrl.cpp:331
NumericField::zeropad
bool zeropad
Definition: NumericTextCtrl.cpp:337
NumericField::base
int base
Definition: NumericTextCtrl.cpp:330
NumericField::formatStr
wxString formatStr
Definition: NumericTextCtrl.cpp:339