27#include "guillaume/ecs/component.hpp"
55 std::string _placeholder {};
56 std::string _label {};
57 std::string _supportingText {};
58 std::string _prefix {};
59 std::string _suffix {};
60 std::string _errorText {};
61 bool _error {
false };
100 const std::string &
getLabel(
void)
const;
135 const std::string &
getPrefix(
void)
const;
150 const std::string &
getSuffix(
void)
const;
bool isLabelFloating(void) const
Tell whether the label is drawn small, above the input.
bool isError(void) const
Tell whether the field is in error.
TextField & setPlaceholder(const std::string &placeholder)
Set the placeholder: the text that names the field, such as "Email".
TextField & setError(bool error)
Put the field in error or clear the error.
const std::string & getErrorText(void) const
Get the message shown under the field while it is in error.
TextField & setErrorText(const std::string &errorText)
Set the message shown under the field while it is in error.
const std::string & getPrefix(void) const
Get the fixed text shown before the input.
TextField & setLabel(const std::string &label)
Store the label.
const std::string & getSupportingText(void) const
Get the helper text shown under the field.
TextField(void)=default
Create a field with no text and no error.
const std::string & getSuffix(void) const
Get the fixed text shown after the input.
const std::string & getPlaceholder(void) const
Get the placeholder: the text that names the field.
TextField & setSupportingText(const std::string &supportingText)
Set the helper text shown under the field, such as "Atleast 8 characters".
TextField & setLabelFloating(bool floating)
Store whether the label floats above the input.
const std::string & getLabel(void) const
Get the label.
TextField & setPrefix(const std::string &prefix)
Set the fixed text shown before the input, such as "$".
~TextField(void)=default
Default destructor.
TextField & setSuffix(const std::string &suffix)
Set the fixed text shown after the input, such as "kg".
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.