50 : mContext { context }
51 , mType {
std::move(type) }
84 auto result =
mFormatter->ValueToString(rawValue, nearest);
100 mValue = result.has_value() ?
123 const auto newFormat =
191 mMaxValue = std::numeric_limits<double>::max();
208 mFormatter->UpdateFormatForValue(value,
false);
213 if (focusedDigit < 0)
214 return int(mFormatter->GetDigitInfos().size() - 1);
216 return std::clamp<int>(
217 focusedDigit, 0, mFormatter->GetDigitInfos().size() - 1);
222 Adjust(1, 1, focusedDigit);
227 Adjust(1, -1, focusedDigit);
236 if (formatterItem ==
nullptr)
238 assert(formatterItem !=
nullptr);
252 mFormatter->Subscribe([
this](
const auto& msg) {
283 wxASSERT(dir == -1 || dir == 1);
const wxString & Internal() const
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)
virtual void OnFormatUpdated(bool resetFocus)
bool SetCustomFormat(const TranslatableString &customFormat)
std::vector< wxString > mFieldValueStrings
void SetMinValue(double minValue)
void Adjust(int steps, int dir, int focusedDigit)
void UpdateFormatToFit(double value)
void SetValue(double newValue)
FormatterContext mContext
bool SetTypeAndFormatName(const NumericConverterType &type, const NumericFormatID &formatName)
std::unique_ptr< NumericConverterFormatter > mFormatter
TranslatableString mCustomFormat
void SetMaxValue(double maxValue)
void Increment(int focusedDigit=-1)
Observer::Subscription mFormatUpdatedSubscription
NumericFormatID mFormatID
NumericFormatID GetFormatName() const
int GetSafeFocusedDigit(int focusedDigit) const noexcept
NumericConverter(const FormatterContext &context, NumericConverterType type, const NumericFormatID &formatName={}, double value=0.0f)
bool SetFormatName(const NumericFormatID &formatName)
CallbackReturn Publish(const FormatChangedToFitValueMessage &message)
Send a message to connected callbacks.
Holds a msgid for the translation catalog; may also bind format arguments.
static const NumericConverterRegistryItem * Find(const FormatterContext &context, const NumericConverterType &type, const NumericFormatID &symbol)