6#ifndef EGT_VALUEWIDGET_H
7#define EGT_VALUEWIDGET_H
14#include <egt/signal.h>
15#include <egt/widget.h>
64 if (detail::change_if_diff<T>(
m_value, v))
115 T
value = T(), T step = T()) noexcept
192 if (detail::change_if_diff<>(
m_start, v))
207 if (detail::change_if_diff<>(
m_end, v))
222 if (detail::change_if_diff<>(
m_step, v))
294 props.erase(std::remove_if(props.begin(), props.end(), [&](
auto & p)
296 if (std::get<0>(p) ==
"value")
298 float starting_value = 0, ending_value = 100, stepping_value = 0;
299 auto attrs = std::get<2>(p);
300 for (auto& a : attrs)
302 switch (detail::hash(a.first))
304 case detail::hash(
"starting"):
305 starting_value = std::stof(a.second);
307 case detail::hash(
"ending"):
308 ending_value = std::stof(a.second);
310 case detail::hash(
"stepping"):
311 stepping_value = std::stof(a.second);
316 this->stepping(stepping_value);
317 this->ending(ending_value);
318 this->starting(starting_value);
319 this->value(std::stof(std::get<1>(p)));
Abstract base serializer class.
Definition serialize.h:34
std::list< std::pair< std::string, std::string > > Attributes
Attributes array type.
Definition serialize.h:45
virtual void add_property(const std::string &name, const std::string &value, const Attributes &attrs={})=0
Add a property.
std::list< std::tuple< std::string, std::string, Serializer::Attributes > > Properties
Definition serialize.h:47
Signal class used for defining a signal and dispatching events.
Definition signal.h:30
void invoke(Args... args)
Invoke all handlers with the specified args.
Definition signal.h:85
constexpr bool float_equal(const float f1, const float f2)
Safe equal comparison of float values.
Definition math.h:107
std::string to_string(const T &x)
Convert a type to a std::string using std::ostringstream.
Definition detail/string.h:110
EGT framework namespace.
Definition animation.h:24