![]() |
Audacity 3.2.0
|
#include <NumericTextCtrl.h>
Classes | |
struct | Options |
Public Member Functions | |
NumericTextCtrl (wxWindow *parent, wxWindowID winid, NumericConverter::Type type, const NumericFormatSymbol &formatName={}, double value=0.0, double sampleRate=44100, const Options &options={}, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize) | |
virtual | ~NumericTextCtrl () |
void | SetName (const TranslatableString &name) |
wxSize | ComputeSizing (bool update=true, wxCoord digitW=0, wxCoord digitH=0) |
bool | Layout () override |
void | Fit () override |
void | SetSampleRate (double sampleRate) |
void | SetValue (double newValue) |
bool | SetFormatString (const FormatStrings &formatString) |
bool | SetFormatName (const NumericFormatSymbol &formatName) |
void | SetFieldFocus (int) |
wxSize | GetDimensions () |
wxSize | GetDigitSize () |
void | SetDigitSize (int width, int height) |
void | SetReadOnly (bool readOnly=true) |
void | EnableMenu (bool enable=true) |
void | SetInvalidValue (double invalidValue) |
int | GetFocusedField () |
int | GetFocusedDigit () |
![]() | |
NumericConverter (Type type, const NumericFormatSymbol &formatName={}, double value=0.0f, double sampleRate=1.0f) | |
NumericConverter (const NumericConverter &) | |
virtual | ~NumericConverter () |
virtual void | ValueToControls () |
virtual void | ValueToControls (double rawValue, bool nearest=true) |
virtual void | ControlsToValue () |
void | PrintDebugInfo () |
bool | SetFormatName (const NumericFormatSymbol &formatName) |
bool | SetFormatString (const FormatStrings &formatString) |
void | SetSampleRate (double sampleRate) |
void | SetValue (double newValue) |
void | SetMinValue (double minValue) |
void | ResetMinValue () |
void | SetMaxValue (double maxValue) |
void | ResetMaxValue () |
double | GetValue () |
wxString | GetString () |
int | GetFormatIndex () |
int | GetNumBuiltins () |
NumericFormatSymbol | GetBuiltinName (const int index) |
FormatStrings | GetBuiltinFormat (const int index) |
FormatStrings | GetBuiltinFormat (const NumericFormatSymbol &name) |
void | Adjust (int steps, int dir) |
void | Increment () |
void | Decrement () |
Private Member Functions | |
void | OnCaptureKey (wxCommandEvent &event) |
void | OnKeyDown (wxKeyEvent &event) |
void | OnKeyUp (wxKeyEvent &event) |
void | OnMouse (wxMouseEvent &event) |
void | OnErase (wxEraseEvent &event) |
void | OnPaint (wxPaintEvent &event) |
void | OnFocus (wxFocusEvent &event) |
void | OnContext (wxContextMenuEvent &event) |
void | ValueToControls () override |
void | ControlsToValue () override |
void | UpdateAutoFocus () |
void | Updated (bool keyup=false) |
Private Attributes | |
bool | mMenuEnabled |
bool | mReadOnly |
std::unique_ptr< wxBitmap > | mBackgroundBitmap |
std::unique_ptr< wxFont > | mDigitFont |
std::unique_ptr< wxFont > | mLabelFont |
int | mDigitBoxW |
int | mDigitBoxH |
int | mDigitW |
int | mDigitH |
int | mBorderLeft |
int | mBorderTop |
int | mBorderRight |
int | mBorderBottom |
int | mWidth |
int | mHeight |
int | mButtonWidth |
int | mLastField |
bool | mAutoPos |
double | mScrollRemainder |
NumericConverter::Type | mType |
bool | mAllowInvalidValue |
Friends | |
class | NumericTextCtrlAx |
Definition at line 170 of file NumericTextCtrl.h.
NumericTextCtrl::NumericTextCtrl | ( | wxWindow * | parent, |
wxWindowID | winid, | ||
NumericConverter::Type | type, | ||
const NumericFormatSymbol & | formatName = {} , |
||
double | value = 0.0 , |
||
double | sampleRate = 44100 , |
||
const Options & | options = {} , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize |
||
) |
Definition at line 1355 of file NumericTextCtrl.cpp.
|
virtual |
Definition at line 1416 of file NumericTextCtrl.cpp.
wxSize NumericTextCtrl::ComputeSizing | ( | bool | update = true , |
wxCoord | digitW = 0 , |
||
wxCoord | digitH = 0 |
||
) |
Definition at line 1519 of file NumericTextCtrl.cpp.
References label, mBorderBottom, mBorderLeft, mBorderRight, mBorderTop, mButtonWidth, mDigitBoxH, mDigitBoxW, mDigitFont, mDigitH, NumericConverter::mDigits, mDigitW, NumericConverter::mFields, mHeight, mLabelFont, NumericConverter::mPrefix, mWidth, and wxT().
Referenced by TimeToolBar::ComputeSizing(), and Layout().
|
overrideprivatevirtual |
Reimplemented from NumericConverter.
Definition at line 2116 of file NumericTextCtrl.cpp.
References NumericConverter::ControlsToValue().
Referenced by OnKeyDown(), SetFormatString(), SetSampleRate(), and SetValue().
void NumericTextCtrl::EnableMenu | ( | bool | enable = true | ) |
Definition at line 1492 of file NumericTextCtrl.cpp.
References _, Fit(), Layout(), mButtonWidth, and mMenuEnabled.
|
override |
Definition at line 1690 of file NumericTextCtrl.cpp.
References mButtonWidth, mHeight, and mWidth.
Referenced by EnableMenu(), SetDigitSize(), SetFormatString(), and SetSampleRate().
|
inline |
Definition at line 232 of file NumericTextCtrl.h.
Referenced by TimeToolBar::OnSize(), and TimeToolBar::Populate().
|
inline |
Definition at line 231 of file NumericTextCtrl.h.
Referenced by TimeToolBar::OnSize().
|
inline |
Definition at line 244 of file NumericTextCtrl.h.
|
inline |
Definition at line 243 of file NumericTextCtrl.h.
|
override |
Definition at line 1633 of file NumericTextCtrl.cpp.
References AColor::Arrow(), AColor::Bevel(), ThemeBase::Colour(), ComputeSizing(), mBackgroundBitmap, mBorderLeft, mBorderTop, mButtonWidth, mDigitBoxH, mDigitH, NumericConverter::mDigits, NumericConverter::mFields, mHeight, mLabelFont, mMenuEnabled, NumericConverter::mPrefix, mWidth, ThemeBase::SetBrushColour(), theTheme, and wxT().
Referenced by EnableMenu(), SetDigitSize(), SetFormatString(), and SetSampleRate().
|
private |
Definition at line 1865 of file NumericTextCtrl.cpp.
|
private |
Definition at line 1753 of file NumericTextCtrl.cpp.
References NumericConverter::BANDWIDTH, NumericConverter::FREQUENCY, NumericConverter::GetBuiltinFormat(), NumericConverter::GetBuiltinName(), NumericConverter::GetNumBuiltins(), ID_MENU, Internal, NumericConverter::mFormatString, mMenuEnabled, mType, BasicMenu::Handle::Popup(), SetFormatString(), NumericConverter::TIME, and ComponentInterfaceSymbol::Translation().
Referenced by OnMouse().
|
private |
Definition at line 1701 of file NumericTextCtrl.cpp.
|
private |
Definition at line 1854 of file NumericTextCtrl.cpp.
References NumericConverter::mFocusedDigit, KeyboardCapture::OnFocus(), and UpdateAutoFocus().
|
private |
Definition at line 1917 of file NumericTextCtrl.cpp.
References NumericConverter::Adjust(), ControlsToValue(), mAllowInvalidValue, NumericConverter::mDigits, NumericConverter::mFocusedDigit, min(), NumericConverter::mInvalidValue, NumericConverter::mMaxValue, NumericConverter::mMinValue, mReadOnly, NumericConverter::mValue, NumericConverter::mValueString, SetFieldFocus(), SetValue(), Updated(), ValueToControls(), and wxEVT_COMMAND_BUTTON_CLICKED.
|
private |
Definition at line 1899 of file NumericTextCtrl.cpp.
References Updated().
|
private |
Definition at line 1814 of file NumericTextCtrl.cpp.
References NumericConverter::Adjust(), NumericConverter::mDigits, NumericConverter::mFocusedDigit, mMenuEnabled, mReadOnly, mScrollRemainder, mWidth, OnContext(), and Updated().
|
private |
Definition at line 1706 of file NumericTextCtrl.cpp.
References ThemeBase::Colour(), mBackgroundBitmap, mDigitBoxH, mDigitBoxW, mDigitFont, mDigitH, NumericConverter::mDigits, mDigitW, NumericConverter::mFocusedDigit, mHeight, NumericConverter::mValueString, mWidth, ThemeBase::SetBrushColour(), ThemeBase::SetPenColour(), and theTheme.
void NumericTextCtrl::SetDigitSize | ( | int | width, |
int | height | ||
) |
Definition at line 1479 of file NumericTextCtrl.cpp.
References Fit(), Layout(), mDigitBoxH, and mDigitBoxW.
Referenced by TimeToolBar::OnSize().
void NumericTextCtrl::SetFieldFocus | ( | int | digit | ) |
Definition at line 2046 of file NumericTextCtrl.cpp.
References NumericConverter::mDigits, NumericConverter::mFocusedDigit, and mLastField.
Referenced by OnKeyDown().
bool NumericTextCtrl::SetFormatName | ( | const NumericFormatSymbol & | formatName | ) |
Definition at line 1443 of file NumericTextCtrl.cpp.
References NumericConverter::GetBuiltinFormat(), and SetFormatString().
Referenced by EffectChangeSpeed::OnTimeCtrlUpdate(), EffectChangeSpeed::TransferDataToWindow(), and EffectChangeSpeed::Update_TimeCtrl_ToLength().
bool NumericTextCtrl::SetFormatString | ( | const FormatStrings & | formatString | ) |
Definition at line 1449 of file NumericTextCtrl.cpp.
References ControlsToValue(), Fit(), Layout(), NumericConverter::SetFormatString(), UpdateAutoFocus(), and ValueToControls().
Referenced by OnContext(), TimeToolBar::SetAudioTimeFormat(), SetFormatName(), SelectionBar::SetSelectionFormat(), and TimeDialog::TransferDataToWindow().
void NumericTextCtrl::SetInvalidValue | ( | double | invalidValue | ) |
Definition at line 1510 of file NumericTextCtrl.cpp.
References mAllowInvalidValue, NumericConverter::mInvalidValue, NumericConverter::mValue, and SetValue().
void NumericTextCtrl::SetName | ( | const TranslatableString & | name | ) |
Definition at line 1420 of file NumericTextCtrl.cpp.
References name, and TranslatableString::Translation().
Referenced by LV2Validator::BuildPlain(), VSTEffectValidator::BuildPlain(), TimeToolBar::Populate(), and VST3UIValidator::VST3UIValidator().
void NumericTextCtrl::SetReadOnly | ( | bool | readOnly = true | ) |
Definition at line 1487 of file NumericTextCtrl.cpp.
References mReadOnly.
Referenced by TimeToolBar::Populate().
void NumericTextCtrl::SetSampleRate | ( | double | sampleRate | ) |
Definition at line 1463 of file NumericTextCtrl.cpp.
References ControlsToValue(), Fit(), Layout(), NumericConverter::SetSampleRate(), and ValueToControls().
Referenced by TimeToolBar::OnRateChanged(), and TimeDialog::TransferDataToWindow().
void NumericTextCtrl::SetValue | ( | double | newValue | ) |
Definition at line 1472 of file NumericTextCtrl.cpp.
References ControlsToValue(), NumericConverter::SetValue(), and ValueToControls().
Referenced by TimerRecordDialog::OnDatePicker_End(), ContrastDialog::OnGetBackground(), ContrastDialog::OnGetForeground(), TimeToolBar::OnIdle(), OnKeyDown(), ContrastDialog::OnReset(), NyquistEffect::OnTime(), EffectChangeSpeed::OnTimeCtrlUpdate(), TimerRecordDialog::OnTimer(), TimerRecordDialog::OnTimeText_End(), TimerRecordDialog::OnTimeText_Start(), NumericEditor::Reset(), SetInvalidValue(), NyquistEffect::TransferDataToEffectWindow(), TimeDialog::TransferDataToWindow(), EffectChangeSpeed::TransferDataToWindow(), EffectNoise::TransferDataToWindow(), EffectSilence::TransferDataToWindow(), EffectToneGen::TransferDataToWindow(), EffectChangeSpeed::Update_TimeCtrl_ToLength(), TimerRecordDialog::UpdateDuration(), and TimerRecordDialog::UpdateEnd().
|
private |
Definition at line 1428 of file NumericTextCtrl.cpp.
References mAutoPos, NumericConverter::mDigits, NumericConverter::mFocusedDigit, and NumericConverter::mValueString.
Referenced by OnFocus(), and SetFormatString().
|
private |
Definition at line 2064 of file NumericTextCtrl.cpp.
References NumericConverter::mDigits, NumericConverter::mFocusedDigit, and wxEVT_COMMAND_TEXT_UPDATED.
Referenced by OnKeyDown(), OnKeyUp(), and OnMouse().
|
overrideprivatevirtual |
Reimplemented from NumericConverter.
Definition at line 2098 of file NumericTextCtrl.cpp.
References NumericConverter::mValue, NumericConverter::mValueString, and NumericConverter::ValueToControls().
Referenced by OnKeyDown(), SetFormatString(), SetSampleRate(), and SetValue().
|
friend |
Definition at line 173 of file NumericTextCtrl.h.
|
private |
Definition at line 298 of file NumericTextCtrl.h.
Referenced by OnKeyDown(), and SetInvalidValue().
|
private |
Definition at line 291 of file NumericTextCtrl.h.
Referenced by UpdateAutoFocus().
|
private |
Definition at line 273 of file NumericTextCtrl.h.
|
private |
Definition at line 283 of file NumericTextCtrl.h.
Referenced by ComputeSizing().
|
private |
Definition at line 280 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 282 of file NumericTextCtrl.h.
Referenced by ComputeSizing().
|
private |
Definition at line 281 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 286 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), EnableMenu(), Fit(), and Layout().
|
private |
Definition at line 277 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Layout(), OnPaint(), and SetDigitSize().
|
private |
Definition at line 276 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), OnPaint(), and SetDigitSize().
|
private |
Definition at line 275 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and OnPaint().
|
private |
Definition at line 279 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Layout(), and OnPaint().
|
private |
Definition at line 278 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and OnPaint().
|
private |
Definition at line 285 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Fit(), Layout(), and OnPaint().
|
private |
Definition at line 275 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 288 of file NumericTextCtrl.h.
Referenced by SetFieldFocus().
|
private |
Definition at line 270 of file NumericTextCtrl.h.
Referenced by EnableMenu(), Layout(), OnContext(), and OnMouse().
|
private |
Definition at line 271 of file NumericTextCtrl.h.
Referenced by OnKeyDown(), OnMouse(), and SetReadOnly().
|
private |
Definition at line 294 of file NumericTextCtrl.h.
Referenced by OnMouse().
|
private |
Definition at line 296 of file NumericTextCtrl.h.
Referenced by OnContext().
|
private |
Definition at line 284 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Fit(), Layout(), OnMouse(), and OnPaint().