15#ifndef __AUDACITY_TIME_TEXT_CTRL__
16#define __AUDACITY_TIME_TEXT_CTRL__
26#include <wx/control.h>
67 : formatStr{
format }, fraction{ fraction }
88 double sampleRate = 1.0f );
96 virtual void ValueToControls();
97 virtual void ValueToControls(
double rawValue,
bool nearest =
true);
101 virtual void ControlsToValue();
107 void PrintDebugInfo();
115 void SetSampleRate(
double sampleRate);
116 void SetValue(
double newValue);
117 void SetMinValue(
double minValue);
118 void ResetMinValue();
119 void SetMaxValue(
double maxValue);
120 void ResetMaxValue();
124 wxString GetString();
126 int GetFormatIndex();
128 int GetNumBuiltins();
135 void Adjust(
int steps,
int dir);
179 bool autoPos {
true };
180 bool readOnly {
false };
181 bool menuEnabled {
true };
182 bool hasInvalidValue {
false };
183 double invalidValue { -1.0 };
185 bool hasValue {
false };
186 double value{ -1.0 };
194 { hasInvalidValue = has, invalidValue = v;
return *
this; }
197 {
format = f;
return *
this; }
199 { hasValue = has, value = v;
return *
this; }
206 double sampleRate = 44100,
208 const wxPoint &pos = wxDefaultPosition,
209 const wxSize &
size = wxDefaultSize);
216 wxSize ComputeSizing(
bool update =
true, wxCoord digitW = 0, wxCoord digitH = 0);
217 bool Layout()
override;
220 void SetSampleRate(
double sampleRate);
221 void SetValue(
double newValue);
224 bool SetFormatString(
const FormatStrings & formatString);
229 void SetFieldFocus(
int );
233 void SetDigitSize(
int width,
int height);
234 void SetReadOnly(
bool readOnly =
true);
235 void EnableMenu(
bool enable =
true);
241 void SetInvalidValue(
double invalidValue);
248 void OnCaptureKey(wxCommandEvent &event);
249 void OnKeyDown(wxKeyEvent &event);
250 void OnKeyUp(wxKeyEvent &event);
251 void OnMouse(wxMouseEvent &event);
252 void OnErase(wxEraseEvent &event);
253 void OnPaint(wxPaintEvent &event);
254 void OnFocus(wxFocusEvent &event);
255 void OnContext(wxContextMenuEvent &event);
260 void ValueToControls()
override;
261 void ControlsToValue()
override;
264 void UpdateAutoFocus();
266 void Updated(
bool keyup =
false);
300 DECLARE_EVENT_TABLE()
const TranslatableString name
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_TIMETEXTCTRL_UPDATED, -1)
bool operator==(const EffectReverbSettings &a, const EffectReverbSettings &b)
bool operator!=(const WaveTrackLocation &a, const WaveTrackLocation &b)
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
DigitInfo is a class used in NumericTextCtrl.
NumericConverter provides the advanced formatting control used in the selection bar of Audacity.
FormatStrings mFormatString
const BuiltinFormatString * mBuiltinFormatStrings
std::vector< DigitInfo > mDigits
std::vector< NumericField > mFields
NumericConverter(const NumericConverter &)
NumericField is a class used in NumericTextCtrl.
NumericTextCtrlAx gives the NumericTextCtrl Accessibility.
std::unique_ptr< wxFont > mDigitFont
std::unique_ptr< wxBitmap > mBackgroundBitmap
NumericConverter::Type mType
Holds a msgid for the translation catalog; may also bind format arguments.
void OnFocus(wxWindow &window, wxFocusEvent &event)
a function useful to implement a focus event handler The window releases the keyboard if the event is...
CommandManager::Options Options
Options & Format(const FormatStrings &f)
Options & MenuEnabled(bool enable)
Options & Value(bool has, double v)
Options & AutoPos(bool enable)
Options & InvalidValue(bool has, double v=-1.0)
Options & ReadOnly(bool enable)