50 : mContext { context }
51 , mType {
std::move(type) }
83 auto result =
mFormatter->ValueToString(rawValue, nearest);
99 mValue = result.has_value() ?
189 mMaxValue = std::numeric_limits<double>::max();
206 if (focusedDigit < 0)
207 return int(mFormatter->GetDigitInfos().size() - 1);
209 return std::clamp<int>(
210 focusedDigit, 0, mFormatter->GetDigitInfos().size() - 1);
215 Adjust(1, 1, focusedDigit);
220 Adjust(1, -1, focusedDigit);
229 if (formatterItem ==
nullptr)
231 assert(formatterItem !=
nullptr);
273 wxASSERT(dir == -1 || dir == 1);
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
A context in which formatter operates.
An explicitly nonlocalized string, not meant for the user to see.
void Decrement(int focusedDigit=-1)
NumericConverterType mType
virtual void ControlsToValue()
virtual ~NumericConverter()
virtual void ValueToControls()
bool ParseFormatString(const TranslatableString &untranslatedFormat)
NumericFormatSymbol mFormatSymbol
NumericConverter(const FormatterContext &context, NumericConverterType type, const NumericFormatSymbol &formatName={}, double value=0.0f)
bool SetCustomFormat(const TranslatableString &customFormat)
virtual void OnFormatUpdated()
std::vector< wxString > mFieldValueStrings
void SetMinValue(double minValue)
void Adjust(int steps, int dir, int focusedDigit)
void SetValue(double newValue)
FormatterContext mContext
bool SetFormatName(const NumericFormatSymbol &formatName)
std::unique_ptr< NumericConverterFormatter > mFormatter
TranslatableString mCustomFormat
void SetMaxValue(double maxValue)
void Increment(int focusedDigit=-1)
NumericFormatSymbol GetFormatName() const
Observer::Subscription mFormatUpdatedSubscription
int GetSafeFocusedDigit(int focusedDigit) const noexcept
bool SetTypeAndFormatName(const NumericConverterType &type, const NumericFormatSymbol &formatName)
Holds a msgid for the translation catalog; may also bind format arguments.
static const NumericConverterRegistryItem * Find(const FormatterContext &context, const NumericConverterType &type, const NumericFormatSymbol &symbol)