Audacity 3.2.0
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 300 of file NumericTextCtrl.cpp.

Constructor & Destructor Documentation

◆ NumericField() [1/2]

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

Definition at line 303 of file NumericTextCtrl.cpp.

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

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 315 of file NumericTextCtrl.cpp.

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

References digits, formatStr, range, wxT(), and zeropad.

Here is the call graph for this function:

◆ operator=()

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

Member Data Documentation

◆ base

int NumericField::base

Definition at line 328 of file NumericTextCtrl.cpp.

Referenced by NumericField().

◆ digits

int NumericField::digits

Definition at line 330 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr(), and NumericField().

◆ fieldW

int NumericField::fieldW

Definition at line 333 of file NumericTextCtrl.cpp.

◆ fieldX

int NumericField::fieldX

Definition at line 332 of file NumericTextCtrl.cpp.

◆ formatStr

wxString NumericField::formatStr

Definition at line 337 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr().

◆ frac

bool NumericField::frac

Definition at line 327 of file NumericTextCtrl.cpp.

Referenced by NumericField().

◆ label

wxString NumericField::label

Definition at line 336 of file NumericTextCtrl.cpp.

◆ labelX

int NumericField::labelX

Definition at line 334 of file NumericTextCtrl.cpp.

◆ pos

int NumericField::pos

Definition at line 331 of file NumericTextCtrl.cpp.

◆ range

int NumericField::range

Definition at line 329 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr(), and NumericField().

◆ str

wxString NumericField::str

Definition at line 338 of file NumericTextCtrl.cpp.

◆ zeropad

bool NumericField::zeropad

Definition at line 335 of file NumericTextCtrl.cpp.

Referenced by CreateDigitFormatStr(), and NumericField().


The documentation for this class was generated from the following file: