14#include <AUI/Traits/values.h>
15#include <AUI/Util/ADataBinding.h>
17#include "AAbstractTextField.h"
18#include "AViewContainer.h"
24class API_AUI_VIEWS ANumberPicker :
public AViewContainerBase {
28 ANumberPicker& mPicker;
31 ANumberPickerField(::ANumberPicker& picker) : mPicker(picker) {}
33 virtual ~ANumberPickerField() =
default;
35 void onKeyRepeat(AInput::Key key)
override;
38 bool isValidText(
const AString& text)
override;
55 &ANumberPicker::getValue,
56 &ANumberPicker::setValue,
61 void setValue(int64_t v);
63 int64_t getValue()
const;
65 void setSuffix(
const AString& suffix);
67 [[nodiscard]]
const AString& text() const noexcept {
return mTextField->text(); }
73 void changeBy(int64_t v);
75 [[nodiscard]] int64_t getMin()
const {
return mMin; }
77 [[nodiscard]] int64_t getMax()
const {
return mMax; }
79 void setMin(int64_t min);
81 void setMax(int64_t max);
96 template<
typename Num>
100 return view->
value();
106 static auto getSetter() {
return &ANumberPicker::setValue; }
109 template <aui::arithmetic UnderlyingType, auto min, auto max>
115 return view->
value();
118 view->setMin(aui::ranged_number<UnderlyingType, min, max>::MIN);
119 view->setMax(aui::ranged_number<UnderlyingType, min, max>::MAX);
124 static auto getSetter() {
return &ANumberPicker::setValue; }
156template <aui::arithmetic UnderlyingType, auto min, auto max>
Text field implementation.
Definition AAbstractTextField.h:26
A text field for numbers with increase/decrease buttons.
Definition ANumberPicker.h:24
emits< int64_t > valueChanging
Number is changing.
Definition ANumberPicker.h:92
auto value() const
Value property.
Definition ANumberPicker.h:52
emits< int64_t > valueChanged
Number changed.
Definition ANumberPicker.h:87
Represents a Unicode character string.
Definition AString.h:38
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:179
std::add_lvalue_reference_t< T > value() const noexcept
Dereferences the stored pointer.
Definition SharedPtrTypes.h:294
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:572
Defines how View handles properties of FieldType type.
Definition ADataBinding.h:37
Property implementation to use with custom getter/setter.
Definition AProperty.h:234
Definition ANumberPicker.h:97
Definition ANumberPicker.h:112