14#include <AUI/Traits/values.h>
15#include <AUI/Util/ADataBinding.h>
17#include "AAbstractTextField.h"
18#include "AViewContainer.h"
33 virtual ~ADoubleNumberPickerField() =
default;
35 void onKeyRepeat(AInput::Key key)
override;
49 void setValue(
double v);
51 void setSuffix(
const AString& suffix);
53 [[nodiscard]]
const AString&
text()
const noexcept {
return mTextField->text(); }
55 [[nodiscard]]
double getValue()
const {
return mTextField->text().toDouble().valueOr(0.0); }
57 [[nodiscard]]
double getMin()
const {
return mMin; }
59 [[nodiscard]]
double getMax()
const {
return mMax; }
61 void setMin(
double min);
62 void setMax(
double max);
66 void changeBy(
double v);
81template <
typename Num>
88 static auto getSetter() {
return &ADoubleNumberPicker::setValue; }
91template <aui::arithmetic UnderlyingType, auto min, auto max>
92 requires aui::convertible_to<
decltype(min), UnderlyingType> && aui::convertible_to<
decltype(max), UnderlyingType>
102 static auto getSetter() {
return &ADoubleNumberPicker::setValue; }
112template <aui::arithmetic UnderlyingType, auto min, auto max>
113 requires aui::convertible_to<
decltype(min), UnderlyingType> && aui::convertible_to<
decltype(max), UnderlyingType>
Text field implementation.
Definition: AAbstractTextField.h:26
A text field for numbers with increase/decrease buttons.
Definition: ADoubleNumberPicker.h:24
emits valueChanging
Number is changing.
Definition: ADoubleNumberPicker.h:77
emits< double > valueChanged
Number changed.
Definition: ADoubleNumberPicker.h:72
Represents a Unicode character string.
Definition: AString.h:37
A view that represents a set of views.
Definition: AViewContainerBase.h:68
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Definition: ADataBinding.h:24
Definition: ADoubleNumberPicker.h:82
Definition: ADoubleNumberPicker.h:93
Clamps the possible values for a number to the specified range: [min;max].
Definition: values.h:452