Virtual Testbed
Ship dynamics simulator for extreme conditions
InputNumber.hh
1 #ifndef VTESTBED_GUI_INPUTNUMBER_HH
2 #define VTESTBED_GUI_INPUTNUMBER_HH
3 
4 #include <limits>
5 #include <string>
6 
7 namespace vtb {
8 
9  namespace gui {
10 
11  template <class T>
12  class InputNumber {
13 
14  private:
15  T _value{};
16  T _step{};
17  T _stepfast{};
20  std::string _name;
21  const char* _format = "%.3f";
22  int _flags = 0;
23 
24  public:
25 
26  inline void name(const std::string& rhs) { this->_name = rhs; }
27  inline const std::string& name() const { return this->_name; }
28  inline void format(const char* rhs) { this->_format = rhs; }
29  inline T value() const { return this->_value; }
30  inline void value(T rhs) { this->_value = rhs; }
31  inline void step(T rhs) { this->_step = rhs; }
32  inline void step_fast(T rhs) { this->_stepfast = rhs; }
33  inline void flags(int rhs) { this->_flags = rhs; }
34  inline void min(T rhs) { this->_min = rhs; }
35  inline void max(T rhs) { this->_max = rhs; }
36 
37  bool draw();
38 
39  };
40 
41  }
42 
43 }
44 
45 #endif // vim:filetype=cpp
T lowest(T... args)
T max(T... args)
Main namespace.
Definition: convert.hh:9