Simple Command Line User Interface
General
Init
This needs to be called before any other thing is done!
void initSclui();
TextBox Filters
Those are some pre-made filters for the textbox component
TextBox Filter Is Text
bool TextBoxFilterIsText(int c);
TextBox Filter Is Number
bool TextBoxFilterIsNumber(int c);
TextBox Filter Allow All
bool TextBoxFilterAllowAll(int c);
Do Quit
Gracefully quit the programm
void doQuit();
get Max X
Returns the number of columns of the current console window
int getMaxX();
get Max Y
Returns the number of rows of the current console window
int getMaxY();
Items
Public Fields
void (*onDraw)(); //event, when drawn
void (*onDestruct)(); //event, when destroyed
std::string name = (""); //name of the element
int x,y,color, colorFocus; //x- and y-position, color and focus color
bool visible = true; //visibility
Interactable Items
Public Fields
bool enabled = true; //if the item should be interactable
T value; // T being the value type of the item, stores the value
TextBox
Constructor
CheckBox
Constructor
TextBox(std::string_view name,int x, int y,int color, int colorFocus,int maxLength, bool(*filter)(int), char splitter);
On Check Change
onCheckChange is an event, which is fired, when the value of the checkbox is changed. -> Can be NULL.
void(*onCheckBoxChange)();
Not Interactable Items
Text
Constructor
Text(std::string_view name,int x, int y,int color);