Show a text input box.
More...
#include <CSMAPI_types.h>
|
enum | CANCEL_KEY_TYPE { ENTER
, ESCAPE
, MOUSE_BUTTON
} |
| Cancel key types. More...
|
|
enum | EInputBoxStyle { STYLE_NORMAL
, STYLE_WHITE_BG
} |
|
typedef bool(* | ValidateInputCallbackFunc) (TextInputInfo *pTextInput, const char *pValue, char pValidateOutput[1024]) |
| Func callback for validating input. More...
|
|
enum | ProcessReturnType {
PRT_DIRTY = 0b000001
, PRT_IGNORE_MOUSE = 0b000010
, PRT_IGNORE_KEYS = 0b000100
, PRT_SELECTED = 0b001000
,
PRT_DISABLE_MOUSE_ON_MOVE = 0b010000
, PRT_CHANGED = 0b100000
} |
| Return flags for GuiBase::process and GuiBase::processKeys. More...
|
|
typedef void(* | OnHoverChangeCallbackFunc) (GuiBase *, int value) |
| Hover callback.
|
|
typedef void(* | OnValueChangeCallbackFunc) (GuiBase *, const char *&newValue) |
| Value change callback.
|
|
typedef bool(* | OnValidateChangeCallbackFunc) (GuiBase *, const char *oldValue, char *newValue) |
| Validate change callback.
|
|
|
void | resizeTextSize () |
| Resize the text size.
|
|
void | Link () |
| Link ourselves to the global GUI element linkage.
|
|
void | Unlink () |
| Unlink ourselves from the global GUI element linkage.
|
|
|
static unsigned int | defaultCustomMagnification |
|
static GuiBase * | gFirst |
|
◆ ValidateInputCallbackFunc
typedef bool(* TextInputInfo::ValidateInputCallbackFunc) (TextInputInfo *pTextInput, const char *pValue, char pValidateOutput[1024]) |
Func callback for validating input.
- Parameters
-
pTextInput | The GUI element. |
pValue | The value the user entered. |
pValidateOutput | A buffer that this function should populate with the validated output. |
- Returns
- Returns true if pValidateOutput shouldn't be used, false if it should be used.
◆ CANCEL_KEY_TYPE
Cancel key types.
Enumerator |
---|
ENTER | Enter button todo: Make pressing enter call a callback.
|
ESCAPE | Escape button.
|
MOUSE_BUTTON | Mouse button (clicked outside of the input box)
|
◆ calculate()
virtual void TextInputInfo::calculate |
( |
| ) |
|
|
virtual |
Re-calculate this element's data.
- Warning
- You should ALWAYS call this at least once BEFORE you call render()!
Implements GuiBase.
◆ getClassName()
virtual const char* TextInputInfo::getClassName |
( |
| ) |
|
|
inlinevirtual |
Get this class' name.
- Returns
- Should return the name of this class.
Reimplemented from GuiBase.
◆ getFont()
virtual FontObject* TextInputInfo::getFont |
( |
| ) |
|
|
inlinevirtual |
Get the font for this GUI element.
- Returns
- Returns the font object for this element.
Reimplemented from GuiBase.
◆ getHoverableCount()
virtual int TextInputInfo::getHoverableCount |
( |
| ) |
|
|
inlinevirtual |
Get the number of elements that can be hovered over in this element.
- Returns
- Returns the amount of elements that can be hovered over in this element.
Reimplemented from GuiBase.
◆ getSelectableCount()
virtual int TextInputInfo::getSelectableCount |
( |
| ) |
|
|
inlinevirtual |
Get the selectable number of elements in this element.
- Returns
- Returns the amount of selectable elements in this element.
Reimplemented from GuiBase.
◆ getStringOffsetByMouse()
int TextInputInfo::getStringOffsetByMouse |
( |
GUI_POINT |
mouse | ) |
|
Get input offset by mouse position.
- Parameters
-
- Returns
- Returns the index in this input box's value where the mouse position is at
◆ getValue()
const char* TextInputInfo::getValue |
( |
| ) |
|
Get the value of the inputbox.
- Returns
- Returns the current inputted value.
◆ isHoverable()
virtual bool TextInputInfo::isHoverable |
( |
| ) |
|
|
virtual |
Check hoverability status.
- Returns
- Returns true if this element can be hovered over.
Implements GuiBase.
◆ isHovered()
virtual bool TextInputInfo::isHovered |
( |
| ) |
|
|
virtual |
Check hover status.
- Returns
- Returns true if this element is being hovered over.
Implements GuiBase.
◆ isSelected()
virtual bool TextInputInfo::isSelected |
( |
| ) |
|
|
virtual |
Check selection status.
- Returns
- Returns true if this element is selected.
Implements GuiBase.
◆ process()
virtual int TextInputInfo::process |
( |
GUI_POINT |
mouse | ) |
|
|
virtual |
◆ processKeys()
virtual int TextInputInfo::processKeys |
( |
| ) |
|
|
virtual |
◆ SelectOnMouseUp()
virtual bool TextInputInfo::SelectOnMouseUp |
( |
| ) |
|
|
inlinevirtual |
Select on mouse up.
- Returns
- Return false if you want this element to be selected on mousedown instead of mouseup
Reimplemented from GuiBase.
◆ setFont()
virtual void TextInputInfo::setFont |
( |
FontObject * |
pFont | ) |
|
|
virtual |
Set the font for this element.
- Parameters
-
Reimplemented from GuiBase.
◆ setHovered()
virtual void TextInputInfo::setHovered |
( |
int |
value | ) |
|
|
virtual |
Set this GUI element as hovered over or not.
- Parameters
-
Implements GuiBase.
◆ setSelected()
virtual void TextInputInfo::setSelected |
( |
int |
value | ) |
|
|
virtual |
Set this GUI element as selected or not.
- Parameters
-
value | The selection value. |
Implements GuiBase.
◆ setValue()
void TextInputInfo::setValue |
( |
const char * |
value, |
|
|
bool |
bUseCallback = true |
|
) |
| |
Set the value of the inputbox.
- Parameters
-
bUseCallback | Use the OnValueChange callback. |
value | The new value. |
◆ startInput()
Set this inputbox as 'focused', and start inputting text.
- Parameters
-
mouse | The mouse's position. Used for selecting an initial place in the textbox to start inputting text at |
◆ ValidateInput
Called when text is finalized (by pressing enter, cancel or clicking outside of the input box).
Should validate the text. Can be NULL.
The documentation for this class was generated from the following file: