API:TextEditBoxSetText
From RoR Wiki
UI Lua API · TextEditBox functions
Version: WAR 1.4.8
Replaces the text in a TextEditBox.
TextEditBoxSetText(editBoxName, text)
Arguments
- editBoxName
string– Name of a TextEditBox window.- text
wstring– The new text. It must be a wide string:L""clears the box.
Returns
Nothing.
Details
- If
textequals the current text, nothing happens. - Otherwise the box is cleared and the new text is inserted.
- Passing an ordinary Lua string raises an Invalid Parameters error. Convert with
towstring()first. - While the box has keyboard focus and an IME composition is in progress, the call is ignored.
- The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.
Errors
Error in function call 'TextEditBoxSetText': Window %s does not existError in function call 'TextEditBoxSetText': Window %s is not a TextEditBox
Example
Clearing the chat input line, from ea_chatwindow/source/chatwindow.lua:
TextEditBoxSetText("EA_TextEntryGroupEntryBoxTextInput", L"")
Filling a text entry dialog with a default, from easystem_dialogmanager/source/dialogmanager.lua:
TextEditBoxSetText( "TextEntryDlg"..dlgIndex.."TextEntry", defaultUserText )
