Vuo  2.3.2
Typedefs | Functions
VuoTextField.h File Reference

Description

VuoTextField interface.

Definition in file VuoTextField.h.

Go to the source code of this file.

Typedefs

typedef void * VuoTextField
 Opaque pointer to VuoTextField type. More...
 
typedef void(* VuoTextFieldSessionEndedCallbackType) (void *context, VuoText text)
 A callback that will be invoked when the editing session has ended, passed the client context (from VuoTextField_make) and the final edited text value. More...
 

Functions

VuoTextField VuoTextField_make (VuoInteger numLines, void *context)
 Create a new text field instance. More...
 
void VuoTextField_free (VuoTextField textFieldPtr)
 Delete a VuoTextField. More...
 
void VuoTextField_onTypedCharacter (VuoTextField textFieldPtr, VuoText character, VuoModifierKey modifiers)
 Send a typed character event to a VuoTextField. More...
 
bool VuoTextField_onRenderedLayers (VuoTextField textFieldPtr, const VuoRenderedLayers *renderedLayers)
 Send a rendered layers event to a VuoTextField. More...
 
VuoLayer VuoTextField_createTextLayer (VuoTextField textFieldPtr)
 Render out the text field in the current state. More...
 
void VuoTextField_setLineCount (VuoTextField textFieldPtr, VuoInteger lines)
 Set the number of lines to display when rendering this field. More...
 
void VuoTextField_setLayerPosition (VuoTextField textFieldPtr, VuoPoint2d position)
 Set the position for this layer. More...
 
void VuoTextField_setLayerWidth (VuoTextField textFieldPtr, VuoReal width)
 Set the width of this layer. More...
 
void VuoTextField_setLayerAnchor (VuoTextField textFieldPtr, VuoAnchor anchor)
 Set the anchor for this layer. More...
 
void VuoTextField_setTheme (VuoTextField textFieldPtr, VuoUiTheme theme)
 Set the theme for this layer. More...
 
void VuoTextField_setText (VuoTextField textFieldPtr, VuoText text)
 Set the text for this field. More...
 
void VuoTextField_setPlaceholderText (VuoTextField textFieldPtr, VuoText placeholder)
 Set the placeholder text for this field. More...
 
void VuoTextField_setValidateCharInputCallback (VuoTextField textFieldPtr, bool(*validateCharInputCallback)(const VuoText current, uint32_t newChar, uint16_t position))
 Sets an optional function callback to be invoked when OnTypedCharacterEvent is fired. More...
 
void VuoTextField_setValidateTextInputCallback (VuoTextField textFieldPtr, bool(*validateTextInputCallback)(void *context, const VuoText current, VuoText *modifiedText))
 Optional function callback to be invoked when text field loses focus. More...
 
void VuoTextField_setSessionEndedCallback (VuoTextField textFieldPtr, VuoTextFieldSessionEndedCallbackType sessionEndedCallback)
 Sets the callback to be invoked when the text editing session ends (by clicking outside the field, or pressing return, enter, tab, or esc). More...
 
VuoText VuoTextField_getText (VuoTextField textFieldPtr)
 Return a VuoText string of the currently displayed value. More...
 

Typedef Documentation

◆ VuoTextField

typedef void* VuoTextField

Opaque pointer to VuoTextField type.

Definition at line 21 of file VuoTextField.h.

◆ VuoTextFieldSessionEndedCallbackType

typedef void(* VuoTextFieldSessionEndedCallbackType) (void *context, VuoText text)

A callback that will be invoked when the editing session has ended, passed the client context (from VuoTextField_make) and the final edited text value.

Definition at line 55 of file VuoTextField.h.

Function Documentation

◆ VuoTextField_createTextLayer()

VuoLayer VuoTextField_createTextLayer ( VuoTextField  textFieldPtr)

Render out the text field in the current state.

Definition at line 66 of file VuoTextField.cc.

◆ VuoTextField_free()

void VuoTextField_free ( VuoTextField  textFieldPtr)

Delete a VuoTextField.

Definition at line 38 of file VuoTextField.cc.

◆ VuoTextField_getText()

VuoText VuoTextField_getText ( VuoTextField  textFieldPtr)

Return a VuoText string of the currently displayed value.

Definition at line 167 of file VuoTextField.cc.

◆ VuoTextField_make()

VuoTextField VuoTextField_make ( VuoInteger  numLines,
void *  context 
)

Create a new text field instance.

Definition at line 28 of file VuoTextField.cc.

◆ VuoTextField_onRenderedLayers()

bool VuoTextField_onRenderedLayers ( VuoTextField  textFieldPtr,
const VuoRenderedLayers renderedLayers 
)

Send a rendered layers event to a VuoTextField.

Returns true if the internal state has changed and needs to be re-rendered. See also VuoTextField_createTextLayer

Definition at line 57 of file VuoTextField.cc.

◆ VuoTextField_onTypedCharacter()

void VuoTextField_onTypedCharacter ( VuoTextField  textFieldPtr,
VuoText  character,
VuoModifierKey  modifiers 
)

Send a typed character event to a VuoTextField.

Definition at line 47 of file VuoTextField.cc.

◆ VuoTextField_setLayerAnchor()

void VuoTextField_setLayerAnchor ( VuoTextField  textFieldPtr,
VuoAnchor  anchor 
)

Set the anchor for this layer.

Definition at line 102 of file VuoTextField.cc.

◆ VuoTextField_setLayerPosition()

void VuoTextField_setLayerPosition ( VuoTextField  textFieldPtr,
VuoPoint2d  position 
)

Set the position for this layer.

Definition at line 84 of file VuoTextField.cc.

◆ VuoTextField_setLayerWidth()

void VuoTextField_setLayerWidth ( VuoTextField  textFieldPtr,
VuoReal  width 
)

Set the width of this layer.

Definition at line 93 of file VuoTextField.cc.

◆ VuoTextField_setLineCount()

void VuoTextField_setLineCount ( VuoTextField  textFieldPtr,
VuoInteger  lines 
)

Set the number of lines to display when rendering this field.

Definition at line 75 of file VuoTextField.cc.

◆ VuoTextField_setPlaceholderText()

void VuoTextField_setPlaceholderText ( VuoTextField  textFieldPtr,
VuoText  placeholder 
)

Set the placeholder text for this field.

Definition at line 129 of file VuoTextField.cc.

◆ VuoTextField_setSessionEndedCallback()

void VuoTextField_setSessionEndedCallback ( VuoTextField  textFieldPtr,
VuoTextFieldSessionEndedCallbackType  sessionEndedCallback 
)

Sets the callback to be invoked when the text editing session ends (by clicking outside the field, or pressing return, enter, tab, or esc).

Definition at line 158 of file VuoTextField.cc.

◆ VuoTextField_setText()

void VuoTextField_setText ( VuoTextField  textFieldPtr,
VuoText  text 
)

Set the text for this field.

Definition at line 120 of file VuoTextField.cc.

◆ VuoTextField_setTheme()

void VuoTextField_setTheme ( VuoTextField  textFieldPtr,
VuoUiTheme  theme 
)

Set the theme for this layer.

Definition at line 111 of file VuoTextField.cc.

◆ VuoTextField_setValidateCharInputCallback()

void VuoTextField_setValidateCharInputCallback ( VuoTextField  textFieldPtr,
bool(*)(const VuoText current, uint32_t newChar, uint16_t position)  validateCharInputCallback 
)

Sets an optional function callback to be invoked when OnTypedCharacterEvent is fired.

Callback should returns true if input is valid, false otherwise.

Definition at line 139 of file VuoTextField.cc.

◆ VuoTextField_setValidateTextInputCallback()

void VuoTextField_setValidateTextInputCallback ( VuoTextField  textFieldPtr,
bool(*)(void *context, const VuoText current, VuoText *modifiedText)  validateTextInputCallback 
)

Optional function callback to be invoked when text field loses focus.

Use this to validate user input and (if necessary) change it. Returns true if the text has been modified (in which case modifiedText should contain the new text).

Definition at line 149 of file VuoTextField.cc.