bwidgets/inc/basic_widgets/w/numeric_input.hpp

25 lines
603 B
C++
Raw Normal View History

2021-08-06 14:22:56 +02:00
#ifndef BWIDGETS_NUMERIC_INPUT_HPP
#define BWIDGETS_NUMERIC_INPUT_HPP
#include <basic_widgets/core/type/concepts.hpp>
#include <basic_widgets/w/base/input.hpp>
2021-08-06 14:22:56 +02:00
namespace bwidgets
{
2021-08-06 14:22:56 +02:00
template<Numeric T>
2021-08-17 18:00:27 +02:00
class NumericInput : public virtual Input<T>
{
public:
2021-08-23 23:50:14 +02:00
// Button increment/decrement step.
T button_step = 1;
2021-08-23 23:50:14 +02:00
// Get allowed value range.
2021-08-17 18:00:27 +02:00
[[nodiscard]] virtual auto value_range() const noexcept
-> const std::pair<T, T>& = 0;
2021-08-23 23:50:14 +02:00
// Set allowed value range.
2021-08-17 18:00:27 +02:00
virtual void value_range(T min, T max) = 0;
};
}
#endif