bdeLaunchModalEditor

Launches a modal text editor in the ui. After typing in the text editor, if you press ok then the content typed in the editor is saved as a string and is returned from the function.

Syntax

editorString = bdeLaunchModalEditor(text, type, name, withOkCancel, readOnly, funcName, xsz, ysz, handleFilePathModified)

Inputs

text (Optional)
This text is added to the text editor when it is created. Default is an empty string.
Type: string
type (Optional)
The type of editor to use. Options are 'text', 'hml', 'oml', 'c', 'modelica', 'spice', 'py', 'fopen'. Default is 'text'.
Type: string
name (Optional)
The name to use for the editor. Default is "Text Editor".
Type: string
withOkCancel (Optional)
Boolean representing if the ok and cancel buttons are on the dialog of the editor. true to have the ok and cancel buttons, false to not have the ok and cancel buttons. Default is true.
Type: Boolean
readOnly (Optional)
Boolean representing if the editor is set to be read only. true for read only, false to be read only.
Type: Boolean
funcName (Optional)
A function that is called when the run button in the editor is pressed.
Type: string
xsz (Optional)
The size of the x-axis of the dialog for the editor. Default is -1. This results in the dialog x-axis having a width of 400.
Type: double
ysz (Optional)
The size of the y-axis of the dialog for the editor. Default is -1. This results in the dialog y-axis having a height of 400.
Type: double
handleFilePathModified (Optional)
Boolean that represents if a modified file path can be handled by the function. true to handle, false to not handle.
Type: Boolean

Outputs

editorString
The string that is returned from the text editor.
Type: string

Examples

Launch a modal text editor:

          editorString = bdeLaunchModalEditor("Hello World", "text", "Text Editor", true, false, '', 500, 500, false);
        

          
            editorString = Hello World
          
        
Launch a modal text editor (Typing Test text in the editor and pressing ok):

          editorString = bdeLaunchModalEditor("", "text", "Text Editor", true, false, '', 500, 500, false);
        

          
            editorString = Test text