Show a text input box.
More...
#include <CSMAPI_types.h>
|
enum | CANCEL_KEY_TYPE { ENTER
, ESCAPE
, MOUSE_BUTTON
} |
| Cancel key types. More...
|
|
typedef bool(* | ValidateKeyInputCallbackFunc) (KeyInputInfo *pKeyInput, int iKeyValue) |
| 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.
|
|
|
static unsigned int | defaultCustomMagnification |
|
static GuiBase * | gFirst |
|
void | Link () |
| Link ourselves to the global GUI element linkage.
|
|
void | Unlink () |
| Unlink ourselves from the global GUI element linkage.
|
|
◆ ValidateKeyInputCallbackFunc
typedef bool(* KeyInputInfo::ValidateKeyInputCallbackFunc) (KeyInputInfo *pKeyInput, int iKeyValue) |
Func callback for validating input.
- Parameters
-
pKeyInput | The GUI element. |
iKeyValue | The key the user entered. This is an SDL_Scancode value. |
- Returns
- Returns true if the value should be used, false otherwise.
◆ 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 KeyInputInfo::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* KeyInputInfo::getClassName |
( |
| ) |
|
|
inlinevirtual |
Get this class' name.
- Returns
- Should return the name of this class.
Reimplemented from GuiBase.
◆ getFont()
virtual FontObject* KeyInputInfo::getFont |
( |
| ) |
|
|
inlinevirtual |
Get the font for this GUI element.
- Returns
- Returns the font object for this element.
Reimplemented from GuiBase.
◆ getHoverableCount()
virtual int KeyInputInfo::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 KeyInputInfo::getSelectableCount |
( |
| ) |
|
|
inlinevirtual |
Get the selectable number of elements in this element.
- Returns
- Returns the amount of selectable elements in this element.
Reimplemented from GuiBase.
◆ getValue()
int KeyInputInfo::getValue |
( |
| ) |
|
Get the value of the keyinputinfo.
- Returns
- Returns the current key.
◆ isHoverable()
virtual bool KeyInputInfo::isHoverable |
( |
| ) |
|
|
virtual |
Check hoverability status.
- Returns
- Returns true if this element can be hovered over.
Implements GuiBase.
◆ isHovered()
virtual bool KeyInputInfo::isHovered |
( |
| ) |
|
|
virtual |
Check hover status.
- Returns
- Returns true if this element is being hovered over.
Implements GuiBase.
◆ isSelected()
virtual bool KeyInputInfo::isSelected |
( |
| ) |
|
|
virtual |
Check selection status.
- Returns
- Returns true if this element is selected.
Implements GuiBase.
◆ process()
virtual int KeyInputInfo::process |
( |
GUI_POINT |
mouse | ) |
|
|
virtual |
◆ processKeys()
virtual int KeyInputInfo::processKeys |
( |
| ) |
|
|
virtual |
◆ SelectOnMouseUp()
virtual bool KeyInputInfo::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 KeyInputInfo::setFont |
( |
FontObject * |
pFont | ) |
|
|
virtual |
Set the font for this element.
- Parameters
-
Reimplemented from GuiBase.
◆ setHovered()
virtual void KeyInputInfo::setHovered |
( |
int |
value | ) |
|
|
virtual |
Set this GUI element as hovered over or not.
- Parameters
-
Implements GuiBase.
◆ setSelected()
virtual void KeyInputInfo::setSelected |
( |
int |
value | ) |
|
|
virtual |
Set this GUI element as selected or not.
- Parameters
-
value | The selection value. |
Implements GuiBase.
◆ setValue()
void KeyInputInfo::setValue |
( |
int |
iScancode, |
|
|
bool |
bUseCallback = true |
|
) |
| |
Set the value of the keyinput.
- Parameters
-
iScancode | The SDL_Scancode to use. |
bUseCallback | Use the OnValueChange callback. |
value | The new value. |
◆ stopInput()
void KeyInputInfo::stopInput |
( |
bool |
bSaveValue = true | ) |
|
Stop inputting text.
- Parameters
-
bSaveValue | Save the value. |
◆ 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: