API:TextEditBoxInsertText
From RoR Wiki
UI Lua API · TextEditBox functions
Version: WAR 1.4.8
Inserts text into a TextEditBox without replacing what is already there.
TextEditBoxInsertText(editBoxName, text)
Arguments
- editBoxName
string– Name of a TextEditBox window.- text
wstring– The text to insert. It must be a wide string.
Returns
Nothing.
Details
- The stock chat window uses it to put links at the cursor position of the chat input line; its comment reads "Insert the text at the current cursor location". To replace the whole text use TextEditBoxSetText.
- Passing an ordinary Lua string raises an Invalid Parameters error. Convert with
towstring()first. - The function needs at least two arguments and only reads the last two.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'TextEditBoxInsertText': Window %s does not existError in function call 'TextEditBoxInsertText': Window %s is not a TextEditBox
Example
From ea_chatwindow/source/chatwindow.lua:
function EA_ChatWindow.InsertText( text )
-- Insert the text at the current cursor location
TextEditBoxInsertText( "EA_TextEntryGroupEntryBoxTextInput", text )
