![]() |
Audacity 3.2.0
|
#include <NumericTextCtrl.h>
Classes | |
struct | FieldPosition |
struct | Options |
Public Member Functions | |
NumericTextCtrl (const FormatterContext &context, wxWindow *parent, wxWindowID winid, NumericConverterType type, const NumericFormatSymbol &formatName={}, double value=0.0, 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 | SetValue (double newValue) |
bool | SetTypeAndFormatName (const NumericConverterType &type, const NumericFormatSymbol &formatName) |
bool | SetFormatName (const NumericFormatSymbol &formatName) |
bool | SetCustomFormat (const TranslatableString &customFormat) |
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 (const FormatterContext &context, NumericConverterType type, const NumericFormatSymbol &formatName={}, double value=0.0f) | |
virtual | ~NumericConverter () |
virtual void | ValueToControls () |
virtual void | ValueToControls (double rawValue, bool nearest=true) |
virtual void | ControlsToValue () |
bool | SetTypeAndFormatName (const NumericConverterType &type, const NumericFormatSymbol &formatName) |
bool | SetFormatName (const NumericFormatSymbol &formatName) |
NumericFormatSymbol | GetFormatName () const |
bool | SetCustomFormat (const TranslatableString &customFormat) |
void | SetValue (double newValue) |
void | SetMinValue (double minValue) |
void | ResetMinValue () |
void | SetMaxValue (double maxValue) |
void | ResetMaxValue () |
double | GetValue () |
wxString | GetString () |
void | Adjust (int steps, int dir, int focusedDigit) |
void | Increment (int focusedDigit=-1) |
void | Decrement (int focusedDigit=-1) |
Private Member Functions | |
void | OnFormatUpdated () override |
void | HandleFormatterChanged () |
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) |
wxRect | GetBox (size_t ii) const |
Private Attributes | |
std::vector< wxRect > | mBoxes |
std::vector< FieldPosition > | mFieldPositions |
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 |
int | mFocusedDigit { 0 } |
bool | mAutoPos |
double | mScrollRemainder |
NumericConverterType | mType |
bool | mAllowInvalidValue |
Friends | |
class | NumericTextCtrlAx |
Additional Inherited Members | |
![]() | |
bool | UpdateFormatter () |
virtual void | OnFormatUpdated () |
![]() | |
FormatterContext | mContext |
NumericConverterType | mType |
double | mValue |
double | mMinValue |
double | mMaxValue |
double | mInvalidValue { -1 } |
std::unique_ptr< NumericConverterFormatter > | mFormatter |
NumericFormatSymbol | mFormatSymbol |
TranslatableString | mCustomFormat |
wxString | mValueString |
std::vector< wxString > | mFieldValueStrings |
Observer::Subscription | mFormatUpdatedSubscription |
Definition at line 34 of file NumericTextCtrl.h.
NumericTextCtrl::NumericTextCtrl | ( | const FormatterContext & | context, |
wxWindow * | parent, | ||
wxWindowID | winid, | ||
NumericConverterType | type, | ||
const NumericFormatSymbol & | formatName = {} , |
||
double | value = 0.0 , |
||
const Options & | options = {} , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize |
||
) |
Definition at line 145 of file NumericTextCtrl.cpp.
|
virtual |
Definition at line 209 of file NumericTextCtrl.cpp.
wxSize NumericTextCtrl::ComputeSizing | ( | bool | update = true , |
wxCoord | digitW = 0 , |
||
wxCoord | digitH = 0 |
||
) |
Definition at line 315 of file NumericTextCtrl.cpp.
References label, mBorderBottom, mBorderLeft, mBorderRight, mBorderTop, mBoxes, mButtonWidth, mDigitBoxH, mDigitBoxW, mDigitFont, mDigitH, mDigitW, mFieldPositions, NumericConverter::mFormatter, mHeight, mLabelFont, mWidth, and wxT().
Referenced by TimeToolBar::ComputeSizing(), and Layout().
|
overrideprivatevirtual |
Reimplemented from NumericConverter.
Definition at line 959 of file NumericTextCtrl.cpp.
References NumericConverter::ControlsToValue().
Referenced by HandleFormatterChanged(), OnKeyDown(), and SetValue().
void NumericTextCtrl::EnableMenu | ( | bool | enable = true | ) |
Definition at line 288 of file NumericTextCtrl.cpp.
References _, Fit(), Layout(), mButtonWidth, and mMenuEnabled.
|
override |
Definition at line 499 of file NumericTextCtrl.cpp.
References mButtonWidth, mHeight, and mWidth.
Referenced by EnableMenu(), HandleFormatterChanged(), and SetDigitSize().
|
private |
|
inline |
Definition at line 100 of file NumericTextCtrl.h.
Referenced by TimeToolBar::OnSize(), and TimeToolBar::Populate().
|
inline |
Definition at line 99 of file NumericTextCtrl.h.
Referenced by TimeToolBar::OnSize().
|
inline |
Definition at line 112 of file NumericTextCtrl.h.
|
inline |
Definition at line 111 of file NumericTextCtrl.h.
|
private |
Definition at line 696 of file NumericTextCtrl.cpp.
References ControlsToValue(), Fit(), Layout(), mBoxes, UpdateAutoFocus(), and ValueToControls().
Referenced by OnFormatUpdated(), SetCustomFormat(), SetFormatName(), and SetTypeAndFormatName().
|
override |
Definition at line 436 of file NumericTextCtrl.cpp.
References AColor::Arrow(), AColor::Bevel(), ThemeBase::Colour(), ComputeSizing(), GetBox(), mBackgroundBitmap, mBorderLeft, mBorderTop, mButtonWidth, mDigitBoxH, mDigitH, mFieldPositions, NumericConverter::mFormatter, mHeight, mLabelFont, mMenuEnabled, mWidth, ThemeBase::SetBrushColour(), theTheme, and wxT().
Referenced by EnableMenu(), HandleFormatterChanged(), and SetDigitSize().
|
private |
Definition at line 706 of file NumericTextCtrl.cpp.
|
private |
Definition at line 567 of file NumericTextCtrl.cpp.
References ID_MENU, NumericConverter::mContext, NumericConverter::mFormatSymbol, mMenuEnabled, mType, NumericConverterType_BANDWIDTH(), NumericConverterType_FREQUENCY(), NumericConverterType_TIME(), BasicMenu::Handle::Popup(), BasicUI::SetFocus(), SetFormatName(), and NumericConverterRegistry::Visit().
Referenced by OnMouse().
|
private |
Definition at line 510 of file NumericTextCtrl.cpp.
|
private |
Definition at line 679 of file NumericTextCtrl.cpp.
References mFocusedDigit, KeyboardCapture::OnFocus(), and UpdateAutoFocus().
|
overrideprivatevirtual |
Reimplemented from NumericConverter.
Definition at line 690 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::OnFormatUpdated().
|
private |
Definition at line 758 of file NumericTextCtrl.cpp.
References NumericConverter::Adjust(), ControlsToValue(), mAllowInvalidValue, mBoxes, mFocusedDigit, NumericConverter::mFormatter, 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 740 of file NumericTextCtrl.cpp.
References Updated().
|
private |
Definition at line 637 of file NumericTextCtrl.cpp.
References NumericConverter::Adjust(), GetBox(), mBoxes, mFocusedDigit, mMenuEnabled, mReadOnly, mScrollRemainder, mWidth, OnContext(), BasicUI::SetFocus(), and Updated().
|
private |
Definition at line 515 of file NumericTextCtrl.cpp.
References ThemeBase::Colour(), BasicUI::FindFocus(), GetBox(), mBackgroundBitmap, mDigitBoxH, mDigitBoxW, mDigitFont, mDigitH, mDigitW, mFocusedDigit, NumericConverter::mFormatter, mHeight, NumericConverter::mValueString, mWidth, ThemeBase::SetBrushColour(), ThemeBase::SetPenColour(), and theTheme.
bool NumericTextCtrl::SetCustomFormat | ( | const TranslatableString & | customFormat | ) |
Definition at line 258 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::SetCustomFormat().
void NumericTextCtrl::SetDigitSize | ( | int | width, |
int | height | ||
) |
Definition at line 275 of file NumericTextCtrl.cpp.
References Fit(), Layout(), mDigitBoxH, and mDigitBoxW.
Referenced by TimeToolBar::OnSize().
void NumericTextCtrl::SetFieldFocus | ( | int | digit | ) |
Definition at line 889 of file NumericTextCtrl.cpp.
References mBoxes, mFocusedDigit, NumericConverter::mFormatter, and mLastField.
Referenced by OnKeyDown().
bool NumericTextCtrl::SetFormatName | ( | const NumericFormatSymbol & | formatName | ) |
Definition at line 248 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::SetFormatName().
Referenced by OnContext(), EffectChangeSpeed::OnTimeCtrlUpdate(), TimeToolBar::SetAudioTimeFormat(), TimeDialog::TransferDataToWindow(), EffectChangeSpeed::TransferDataToWindow(), and EffectChangeSpeed::Update_TimeCtrl_ToLength().
void NumericTextCtrl::SetInvalidValue | ( | double | invalidValue | ) |
Definition at line 306 of file NumericTextCtrl.cpp.
References mAllowInvalidValue, NumericConverter::mInvalidValue, NumericConverter::mValue, and SetValue().
void NumericTextCtrl::SetName | ( | const TranslatableString & | name | ) |
Definition at line 213 of file NumericTextCtrl.cpp.
References name, and TranslatableString::Translation().
Referenced by LV2Editor::BuildPlain(), VSTEditor::BuildPlain(), TimeToolBar::Populate(), LadspaEditor::PopulateUI(), and VST3Editor::VST3Editor().
void NumericTextCtrl::SetReadOnly | ( | bool | readOnly = true | ) |
Definition at line 283 of file NumericTextCtrl.cpp.
References mReadOnly.
Referenced by TimeToolBar::Populate().
bool NumericTextCtrl::SetTypeAndFormatName | ( | const NumericConverterType & | type, |
const NumericFormatSymbol & | formatName | ||
) |
Definition at line 238 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::SetTypeAndFormatName().
void NumericTextCtrl::SetValue | ( | double | newValue | ) |
Definition at line 268 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 221 of file NumericTextCtrl.cpp.
References mAutoPos, mFocusedDigit, NumericConverter::mFormatter, and NumericConverter::mValueString.
Referenced by HandleFormatterChanged(), and OnFocus().
|
private |
Definition at line 907 of file NumericTextCtrl.cpp.
References mBoxes, mFocusedDigit, NumericConverter::mFormatter, and wxEVT_COMMAND_TEXT_UPDATED.
Referenced by OnKeyDown(), OnKeyUp(), and OnMouse().
|
overrideprivatevirtual |
Reimplemented from NumericConverter.
Definition at line 941 of file NumericTextCtrl.cpp.
References NumericConverter::mValue, NumericConverter::mValueString, and NumericConverter::ValueToControls().
Referenced by HandleFormatterChanged(), OnKeyDown(), and SetValue().
|
friend |
Definition at line 37 of file NumericTextCtrl.h.
|
private |
Definition at line 181 of file NumericTextCtrl.h.
Referenced by OnKeyDown(), and SetInvalidValue().
|
private |
Definition at line 174 of file NumericTextCtrl.h.
Referenced by UpdateAutoFocus().
|
private |
Definition at line 154 of file NumericTextCtrl.h.
|
private |
Definition at line 164 of file NumericTextCtrl.h.
Referenced by ComputeSizing().
|
private |
Definition at line 161 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 163 of file NumericTextCtrl.h.
Referenced by ComputeSizing().
|
private |
Definition at line 162 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 146 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), GetBox(), HandleFormatterChanged(), OnKeyDown(), OnMouse(), SetFieldFocus(), and Updated().
|
private |
Definition at line 167 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), EnableMenu(), Fit(), and Layout().
|
private |
Definition at line 158 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Layout(), OnPaint(), and SetDigitSize().
|
private |
Definition at line 157 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), OnPaint(), and SetDigitSize().
|
private |
Definition at line 156 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and OnPaint().
|
private |
Definition at line 160 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Layout(), and OnPaint().
|
private |
Definition at line 159 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and OnPaint().
|
private |
Definition at line 147 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 171 of file NumericTextCtrl.h.
Referenced by OnFocus(), OnKeyDown(), OnMouse(), OnPaint(), SetFieldFocus(), UpdateAutoFocus(), and Updated().
|
private |
Definition at line 166 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Fit(), Layout(), and OnPaint().
|
private |
Definition at line 156 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 169 of file NumericTextCtrl.h.
Referenced by SetFieldFocus().
|
private |
Definition at line 151 of file NumericTextCtrl.h.
Referenced by EnableMenu(), Layout(), OnContext(), and OnMouse().
|
private |
Definition at line 152 of file NumericTextCtrl.h.
Referenced by OnKeyDown(), OnMouse(), and SetReadOnly().
|
private |
Definition at line 177 of file NumericTextCtrl.h.
Referenced by OnMouse().
|
private |
Definition at line 179 of file NumericTextCtrl.h.
Referenced by OnContext().
|
private |
Definition at line 165 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Fit(), Layout(), OnMouse(), and OnPaint().