CppCMS
|
Widget for number input. It is a template class that assumes that T is a number. More...
#include <cppcms/form.h>
Public Member Functions | |
void | non_empty () |
T | value () |
void | value (T v) |
void | low (T a) |
void | high (T b) |
void | range (T a, T b) |
virtual void | render_value (form_context &context) |
virtual void | clear () |
virtual void | load (http::context &context) |
virtual bool | validate () |
Widget for number input. It is a template class that assumes that T is a number.
This class parses the input and checks if it is input text is a valid numeric value. If it is valid, the set() would return true be true.
If the value was not defined, access to value() will throw an exception.
virtual void cppcms::widgets::numeric< T >::clear | ( | ) | [inline, virtual] |
Clear the form. It also calls set(false).
Reimplemented from cppcms::widgets::base_widget.
void cppcms::widgets::numeric< T >::high | ( | T | b | ) | [inline] |
Set the maximum valid value.
References cppcms::widgets::numeric< T >::non_empty().
Referenced by cppcms::widgets::numeric< T >::range().
virtual void cppcms::widgets::numeric< T >::load | ( | http::context & | context | ) | [inline, virtual] |
Load the widget data.
Implements cppcms::base_form.
References cppcms::http::context::locale(), cppcms::widgets::base_widget::name(), cppcms::http::request::post_or_get(), cppcms::widgets::base_widget::pre_load(), cppcms::http::context::request(), and cppcms::widgets::base_widget::valid().
void cppcms::widgets::numeric< T >::low | ( | T | a | ) | [inline] |
Set the minimum valid value.
References cppcms::widgets::numeric< T >::non_empty().
Referenced by cppcms::widgets::numeric< T >::range().
void cppcms::widgets::numeric< T >::non_empty | ( | ) | [inline] |
Inform the validator that this widget should contain some value.
Referenced by cppcms::widgets::numeric< T >::high(), and cppcms::widgets::numeric< T >::low().
void cppcms::widgets::numeric< T >::range | ( | T | a, |
T | b | ||
) | [inline] |
Same as low(a); high(b);
References cppcms::widgets::numeric< T >::high(), and cppcms::widgets::numeric< T >::low().
virtual void cppcms::widgets::numeric< T >::render_value | ( | form_context & | context | ) | [inline, virtual] |
Render the first part of the widget.
Implements cppcms::widgets::base_html_input.
References cppcms::util::escape(), and cppcms::form_context::out().
virtual bool cppcms::widgets::numeric< T >::validate | ( | ) | [inline, virtual] |
Validate the widget.
Reimplemented from cppcms::widgets::base_widget.
References cppcms::widgets::base_widget::valid().
T cppcms::widgets::numeric< T >::value | ( | ) | [inline] |
Get numeric value that was loaded from the POST or GET data.
void cppcms::widgets::numeric< T >::value | ( | T | v | ) | [inline] |
Set the value of the widget.