9. Overview EditorsΒΆ
The editor is a text editor for editing UniScript source code, text and data files in text format (UTX files).
The EdCreate functions creates a new editor window. The function returns a handle (a number greater than 0) to the editor. To destroy the editor window call EdDestroy..
The EdSetText function can be used to insert text via UniScript into the editor. EdGetText returns the complete text of an editor.
Example
hedit = EdCreate();
EdSetText(hedit, "First text liner\nSecond text line");
EdPrint(hedit);
EdDestroy(hedit);
Some features:
Syntax-Highlighting for UniScript- and XML-files.
Multistep Undo/Redo.
Handles big data files (> 100 MB).
Rectangular selection (hold Alt key and select using the mouse).
Read and write UNICODE files.
Create and Destroy |
|
---|---|
EdCreate creates a new editor. |
|
EdDestroy destroys the given editor and frees any memory that the editor occupies. |
Set |
|
---|---|
EdClear deletes the current selection in the editor. |
|
EdCopy copies the current editor selection into the Clipboard. |
|
EdCut deletes the current editor selection and copies the deleted text to the clipboard. |
|
EdEmptyUndoBuffer clears the editor undo flag. |
|
EdFind finds a string in an editor. |
|
EdFindReplace replaces a string in an editor. |
|
EdGotoPos sets the cursor to the given position |
|
EdLineScroll scrolls the text in an editor. |
|
EdPaste inserts the data from the clipboard into the editor at the current cursor position. |
|
The EdPrint function prints a document to the printer. |
|
EdReplaceSel replaces the current selection with the specified text. |
|
EdSave saves the editor text to disk. |
|
EdSaveModified saves the text of the editor if the modification flag is set. |
|
EdSetActivePane sets the active pane of a splitter window. |
|
EdSetEncoding sets the output coding of an editor. |
|
EdSetLexer sets the file type for the syntax highlighting. |
|
EdSetModify sets or clears the modification flag of the editor. |
|
EdSetPathName sets the file name. |
|
EdSetReadOnly sets the read-only flag. |
|
EdSetSplit splits the editor window horizontal, vertical or removes the split. |
|
EdSetTabStops sets the tab stops in the editor. |
|
EdSetText replaces the text of the editor. |
|
EdShow shows or hides a editor window. |
|
EdUndo reverses the last editor operation. |
Get |
|
---|---|
EdCanPaste checks if the objects in the clipboard have a format that is supported by UniPlot editor. |
|
EdCanUndo checks if the last editor operation can be undone. |
|
EdGetActivePane returns the active pane in a splitter window. |
|
EdGetCurrentPos returns the cursor position in characters from the beginning of the file. |
|
EdGetCursorPos returns the cursor position in column/row coordinates. |
|
EdGetEncoding gets the output encoding of an editor. |
|
EdGetLexer gets the type of the syntax highlighting. |
|
EdGetLine retrieves a line of text from an editor. |
|
EdGetLineCount returns the number of lines in an editor. |
|
EdGetLineFromPos returns the line number for the given position. |
|
EdGetLineLen retrieves the length of a line in an editor. |
|
EdGetModify determines if the contents of a editor window has been modified. |
|
EdGetPathName returns the editor file name. |
|
EdGetPosFromLine returns the position of the given line. The position is the number of characters from the beginning of the file. |
|
EdGetSel returns the start and end position of the selection. |
|
EdGetSelectedText retrieves the selected text of an editor. |
|
EdGetSplit checks if the editor is displayed as a splitter window. |
|
EdGetTabStops returns the tab stop size in number of characters. |
|
EdGetText copies the text from the given editor into a string variable. |
|
EdGetWnd returns the window handle |
|
EdIsReadOnly checks if the read-only flag is set. |
See also
id-2064106