Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
ds_text_input_dialog.h
1/* Copyright (C) 2017 - 2024, Thornwave Labs Inc - All Rights Reserved.
2 * Unauthorized copying of this file, via any medium is strictly prohibited.
3 * Proprietary and confidential.
4 * Written by Razvan Turiac <razvan.turiac@thornwave.com>
5*/
6
7#ifndef _DS_TEXT_INPUT_DIALOG_H
8#define _DS_TEXT_INPUT_DIALOG_H
9
10
11#include <ds_dialog_base.h>
12#include <ds_check.h>
13#include <ds_edit.h>
14
15
23{
24public:
25
33 DsTextInputDialog(DsView* parent, DsColor dialog_color, uint32_t corner_radius, size_t max_text_length);
34
35
44 DsTextInputDialog& setEditGeometry(DsSize edit_size, uint16_t corner_radius, uint8_t border_thickness);
45
46
56 DsTextInputDialog& setEditColors(DsColor edit_color, DsColor border_color, DsColor text_color, DsColor hint_color);
57
58
66
67
76
77
85 DsTextInputDialog& setEditParams(size_t max_length, const char* hint);
86
87
95 DsTextInputDialog& setPasswordMode(bool enabled, bool allow_show_password);
96
97
104
105
111 const char* getTextValue(void);
112
113
117 void setTextValue(const char* format, ...);
118
119
120private:
121 DsEdit* mEdit;
122 DsCheck* mShowCheck;
123 DsLabel* mShowLabel;
124
125 void onEditBoxFocused(DsEdit* object) override final;
126 void onEditBoxChanged(DsEdit* object) override final;
127 void onEditBoxNewLine(DsEdit* object) override final;
128 void onEditBoxValidation(DsEdit* object, bool is_valid) override final;
129
130 void onShow(void) override final;
131 void onHide(void) override final;
132};
133
134
135#endif
DsCheck is a class that represents a checkbox view.
Definition ds_check.h:21
DsColor is a class that represents a 4 channel color (Alpha, Red, Green, Blue).
Definition ds_color.h:53
DsDialogBase is a class that implements a generic dialog base class.
Definition ds_dialog_base.h:24
Listener is an interface class that receives events from the edit view.
Definition ds_edit.h:111
Definition ds_edit.h:22
DsLabel is a class that represents a text label view.
Definition ds_label.h:21
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
Definition ds_geometry.h:780
DsTextInputDialog is a class that implements a generic dialog for collecting text input from the user...
Definition ds_text_input_dialog.h:23
DsTextInputDialog & setEditColors(DsColor edit_color, DsColor border_color, DsColor text_color, DsColor hint_color)
Sets the colors used for the edit field.
DsTextInputDialog & setEditGeometry(DsSize edit_size, uint16_t corner_radius, uint8_t border_thickness)
Sets the geometry of the edit field.
DsTextInputDialog & setCheckColor(DsColor color)
Sets the checkmark color of the checkbox used to show the password (if password mode is enabled)
DsTextInputDialog(DsView *parent, DsColor dialog_color, uint32_t corner_radius, size_t max_text_length)
Creates a DsTextInputDialog view.
DsTextInputDialog & setEditFonts(const ds_bitmap_font_t *font, const ds_bitmap_font_t *hint_font)
Sets the fonts used for the edit field.
DsTextInputDialog & setShowPasswordLabelFont(const ds_bitmap_font_t *font)
Sets the show password checkbox label font.
DsTextInputDialog & setPasswordMode(bool enabled, bool allow_show_password)
Sets the password mode.
DsTextInputDialog & setEditParams(size_t max_length, const char *hint)
Sets the parameters for the edit field.
const char * getTextValue(void)
Returns a pointer to a C string representing the user input.
void setTextValue(const char *format,...)
Sets the edit field value using the printf() format.
DsView is a base class that represents any view on the screen.
Definition ds_view.h:40
Definition ds_font.h:45