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 NumericFormatID &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 NumericFormatID &formatName) |
bool | SetFormatName (const NumericFormatID &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 | GetFocusedDigit () |
Public Member Functions inherited from NumericConverter | |
NumericConverter (const FormatterContext &context, NumericConverterType type, const NumericFormatID &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 NumericFormatID &formatName) |
bool | SetFormatName (const NumericFormatID &formatName) |
NumericFormatID | 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 | UpdateFormatToFit (double value) |
void | Adjust (int steps, int dir, int focusedDigit) |
void | Increment (int focusedDigit=-1) |
void | Decrement (int focusedDigit=-1) |
Public Member Functions inherited from Observer::Publisher< FormatChangedToFitValueMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Private Member Functions | |
void | OnFormatUpdated (bool resetFocus) override |
void | HandleFormatterChanged (bool resetFocus) |
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 | mFocusedDigit { 0 } |
bool | mAutoPos |
double | mScrollRemainder |
NumericConverterType | mType |
bool | mAllowInvalidValue |
Friends | |
class | NumericTextCtrlAx |
Definition at line 34 of file NumericTextCtrl.h.
NumericTextCtrl::NumericTextCtrl | ( | const FormatterContext & | context, |
wxWindow * | parent, | ||
wxWindowID | winid, | ||
NumericConverterType | type, | ||
const NumericFormatID & | 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 208 of file NumericTextCtrl.cpp.
wxSize NumericTextCtrl::ComputeSizing | ( | bool | update = true , |
wxCoord | digitW = 0 , |
||
wxCoord | digitH = 0 |
||
) |
Definition at line 314 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 976 of file NumericTextCtrl.cpp.
References NumericConverter::ControlsToValue().
Referenced by HandleFormatterChanged(), OnKeyDown(), and SetValue().
void NumericTextCtrl::EnableMenu | ( | bool | enable = true | ) |
Definition at line 287 of file NumericTextCtrl.cpp.
References _, Fit(), Layout(), mButtonWidth, and mMenuEnabled.
|
override |
Definition at line 498 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 111 of file NumericTextCtrl.h.
|
private |
Definition at line 696 of file NumericTextCtrl.cpp.
References ControlsToValue(), Fit(), Layout(), mBoxes, mFocusedDigit, UpdateAutoFocus(), and ValueToControls().
Referenced by OnFormatUpdated(), SetCustomFormat(), SetFormatName(), and SetTypeAndFormatName().
|
override |
Definition at line 435 of file NumericTextCtrl.cpp.
References AColor::Arrow(), ThemeBase::Colour(), ComputeSizing(), GetBox(), mBackgroundBitmap, mBorderLeft, mBorderTop, mButtonWidth, mDigitBoxH, mDigitH, mFieldPositions, NumericConverter::mFormatter, mHeight, mLabelFont, mMenuEnabled, mWidth, ThemeBase::SetBrushColour(), ThemeBase::SetPenColour(), theTheme, and wxT().
Referenced by EnableMenu(), HandleFormatterChanged(), SpectralSelectionBar::Populate(), and SetDigitSize().
|
private |
Definition at line 724 of file NumericTextCtrl.cpp.
|
private |
Definition at line 566 of file NumericTextCtrl.cpp.
References ID_MENU, NumericConverter::mContext, NumericConverter::mFormatID, mMenuEnabled, mType, NumericConverterType_BANDWIDTH(), NumericConverterType_FREQUENCY(), NumericConverterType_TIME(), BasicMenu::Handle::Popup(), BasicUI::SetFocus(), SetFormatName(), and NumericConverterRegistry::Visit().
Referenced by OnMouse().
|
private |
Definition at line 509 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 776 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 758 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 514 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 257 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::SetCustomFormat().
void NumericTextCtrl::SetDigitSize | ( | int | width, |
int | height | ||
) |
Definition at line 274 of file NumericTextCtrl.cpp.
References Fit(), Layout(), mDigitBoxH, and mDigitBoxW.
Referenced by TimeToolBar::OnSize().
void NumericTextCtrl::SetFieldFocus | ( | int | digit | ) |
Definition at line 907 of file NumericTextCtrl.cpp.
References mBoxes, mFocusedDigit, and NumericConverter::mFormatter.
Referenced by OnKeyDown().
bool NumericTextCtrl::SetFormatName | ( | const NumericFormatID & | formatName | ) |
Definition at line 247 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::SetFormatName().
Referenced by OnContext(), EffectChangeSpeed::OnTimeCtrlUpdate(), TimeToolBar::SetAudioTimeFormat(), SpectralSelectionBar::SetBandwidthSelectionFormatName(), SpectralSelectionBar::SetFrequencySelectionFormatName(), TimeDialog::TransferDataToWindow(), EffectChangeSpeed::TransferDataToWindow(), and EffectChangeSpeed::Update_TimeCtrl_ToLength().
void NumericTextCtrl::SetInvalidValue | ( | double | invalidValue | ) |
Definition at line 305 of file NumericTextCtrl.cpp.
References mAllowInvalidValue, NumericConverter::mInvalidValue, NumericConverter::mValue, and SetValue().
void NumericTextCtrl::SetName | ( | const TranslatableString & | name | ) |
Definition at line 212 of file NumericTextCtrl.cpp.
References name.
Referenced by LV2Editor::BuildPlain(), VSTEditor::BuildPlain(), SpectralSelectionBar::Populate(), TimeToolBar::Populate(), LadspaEditor::PopulateUI(), and VST3Editor::VST3Editor().
void NumericTextCtrl::SetReadOnly | ( | bool | readOnly = true | ) |
Definition at line 282 of file NumericTextCtrl.cpp.
References mReadOnly.
Referenced by TimeToolBar::Populate().
bool NumericTextCtrl::SetTypeAndFormatName | ( | const NumericConverterType & | type, |
const NumericFormatID & | formatName | ||
) |
Definition at line 237 of file NumericTextCtrl.cpp.
References HandleFormatterChanged(), and NumericConverter::SetTypeAndFormatName().
void NumericTextCtrl::SetValue | ( | double | newValue | ) |
Definition at line 267 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(), TimerRecordDialog::UpdateEnd(), and SpectralSelectionBar::ValuesToControls().
|
private |
Definition at line 220 of file NumericTextCtrl.cpp.
References mAutoPos, mFocusedDigit, NumericConverter::mFormatter, and NumericConverter::mValueString.
Referenced by HandleFormatterChanged(), and OnFocus().
|
private |
Definition at line 924 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 958 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 178 of file NumericTextCtrl.h.
Referenced by OnKeyDown(), and SetInvalidValue().
|
private |
Definition at line 171 of file NumericTextCtrl.h.
Referenced by UpdateAutoFocus().
|
private |
Definition at line 153 of file NumericTextCtrl.h.
|
private |
Definition at line 163 of file NumericTextCtrl.h.
Referenced by ComputeSizing().
|
private |
Definition at line 160 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 162 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 145 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), GetBox(), HandleFormatterChanged(), OnKeyDown(), OnMouse(), SetFieldFocus(), and Updated().
|
private |
Definition at line 166 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), EnableMenu(), Fit(), and Layout().
|
private |
Definition at line 157 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Layout(), OnPaint(), and SetDigitSize().
|
private |
Definition at line 156 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), OnPaint(), and SetDigitSize().
|
private |
Definition at line 155 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and OnPaint().
|
private |
Definition at line 159 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Layout(), and OnPaint().
|
private |
Definition at line 158 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and OnPaint().
|
private |
Definition at line 146 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 168 of file NumericTextCtrl.h.
Referenced by HandleFormatterChanged(), OnFocus(), OnKeyDown(), OnMouse(), OnPaint(), SetFieldFocus(), UpdateAutoFocus(), and Updated().
|
private |
Definition at line 165 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Fit(), Layout(), and OnPaint().
|
private |
Definition at line 155 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), and Layout().
|
private |
Definition at line 150 of file NumericTextCtrl.h.
Referenced by EnableMenu(), Layout(), OnContext(), and OnMouse().
|
private |
Definition at line 151 of file NumericTextCtrl.h.
Referenced by OnKeyDown(), OnMouse(), and SetReadOnly().
|
private |
Definition at line 174 of file NumericTextCtrl.h.
Referenced by OnMouse().
|
private |
Definition at line 176 of file NumericTextCtrl.h.
Referenced by OnContext().
|
private |
Definition at line 164 of file NumericTextCtrl.h.
Referenced by ComputeSizing(), Fit(), Layout(), OnMouse(), and OnPaint().