58 bool operator()(
const DsString &text)
override final;
81 bool operator()(
const DsString &text)
override final;
103 bool operator()(
const DsString &text)
override final;
327 size_t mMaxTextLength;
329 void onPaint(
DsRenderer &renderer)
override final;
330 void onKeyboard(int32_t key)
override final;
DsAlignment is a class representing both horizontal and vertical alignment type.
Definition ds_types.h:130
DsColor is a class that represents a 4 channel color (Alpha, Red, Green, Blue).
Definition ds_color.h:53
FloatValidator is a class implementing validation for real numbers (floating point).
Definition ds_edit.h:89
FloatValidator(float min, float max)
Constructor.
Listener is an interface class that receives events from the edit view.
Definition ds_edit.h:111
virtual void onEditBoxValidation(DsEdit *object, bool is_valid)
Called when the edit view validation status changes.
Definition ds_edit.h:140
virtual void onEditBoxChanged(DsEdit *object)
Called when the edit view text input changes.
Definition ds_edit.h:125
virtual void onEditBoxFocused(DsEdit *object)
Called when the edit view receives focus.
Definition ds_edit.h:118
virtual void onEditBoxNewLine(DsEdit *object)
Called when the edit view received a new line character (user presed ENTER).
Definition ds_edit.h:132
SignedIntegerValidator is a class implementing validation for a signed integer input.
Definition ds_edit.h:43
SignedIntegerValidator(int64_t min, int64_t max, uint8_t base=10)
Constructor.
UnsignedIntegerValidator is a class implementing validation for an unsigned integer input.
Definition ds_edit.h:66
UnsignedIntegerValidator(uint64_t min, uint64_t max, uint8_t base=10)
Constructor.
Base class for the validators.
Definition ds_edit.h:28
virtual bool operator()(const DsString &text)=0
Validates the text input.
int64_t getValueAsSigned(void) const
Returns the edit view text interpreted as a signed integer.
size_t getTextLength(void) const
Returns the actual text length of the edit box.
bool isValidValue(void) const
Is the DsEdit value valid?
uint64_t getValueAsUnsigned(void) const
Returns the edit view text interpreted as an unsigned integer.
void setTextFont(const ds_bitmap_font_t *font)
Sets the text font.
DsEdit(DsView *parent, const DsPoint &pos, const DsSize &size, size_t text_capacity)
Creates a DsEdit object.
void setInvalidValue(void)
Sets the DsEdit state as invalid. This will trigger a callback to DsEdit::Listener::onEditBoxValidati...
const char * getValueAsString(void) const
Returns the edit view string.
size_t getMaxTextLength(void) const
Returns the maximum text length allowed in the edit box.
void setPasswordMode(bool password_mode)
Sets the edit view password mode.
void setValidator(Validator *validator)
Sets the value validator object.
void setListener(Listener *listener)
Sets the DsEdit event listener.
void setHint(const char *text)
Sets the hint text.
void setValue(const char *format, va_list args)
Sets the DsEdit value using the vprintf() format.
void clear(void)
Clears the DsEdit value.
void setTextColor(DsColor color)
Sets the text color.
void setValue(const char *format,...)
Sets the DsEdit value using the printf() format.
void setHintColor(DsColor color)
Sets the hint text color.
void setHintFont(const ds_bitmap_font_t *font)
Sets the hint text font.
void validateValue(void)
Runs the value validation.
float getValueAsFloat(void) const
Returns the edit view text interpreted as a floating point number.
void setMaxTextLength(size_t length)
Sets the maximum text length allowed in the edit box.
DsPoint is a class that represents the X and Y 2D coordinates of a point as integer numbers.
Definition ds_geometry.h:24
DsRenderer is a class that implements all the drawing operations.
Definition ds_renderer.h:42
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
Definition ds_geometry.h:780
DsString is a class representing a character string.
Definition ds_string.h:26
DsView is a base class that represents any view on the screen.
Definition ds_view.h:40