Regular API function


Description Opens a text edition window. The C version of this function opens a modal window, see sim.textEditorOpen for the Lua version of this function.
C synopsis simChar* simOpenTextEditor(const simChar* initText,const simChar* xml,simInt* various)
C parameters
initText: a pointer to the initial text to be displayed.
xml: a pointer to an XML description of the text editor's properties. Can be nullptr for default properties. Following is a valid content:

<editor title="Window title" editable="true" searchable="true"
  tabWidth="4" textColor="50 50 50" backgroundColor="190 190 190"
  selectionColor="128 128 255" size="800 600" position="100 100" >

  <keywords1 color="152 0 0" >
    <item word="sim.getObjectHandle" autocomplete="true"
      calltip="number handle=sim.getObjectHandle(number objectName)" />
    <item word="sim.getObjectPosition" autocomplete="true"
      calltip="table[3] pos=sim.getObjectPosition(number handle,
        number relHandle)" />
  <keywords2 color="220 80 20" >
    <item word="sim.getObjectOrientation" autocomplete="true"
      calltip="table[3] euler=sim.getObjectOrientation(number handle,
        number relHandle)" />
Other editor attributes with their default values are:
commentColor="0 140 0"
numberColor="220 0 220"
stringColor="255 255 0"
characterColor="255 255 0"
operatorColor="0 0 0"
preprocessorColor="0 128 128"
identifierColor="64 64 64"
wordColor="0 0 255"
word4Color="152 64 0"
various: optional pointer holding the window size (various[0]-various[1]) and position (various[2],various[3]).
C return value
nullptr in case of an error. Otherwise a pointer to the text. The user is in charge of releasing the returned buffer with simReleaseBuffer.
Lua synopsis
DEPRECATED. See sim.textEditorOpen instead.
Lua parameters
Lua return values