The text editor main window. More...
| void | addFunctionKey(int key,int function) |
| void | addMacroKey(int key,string macroFileName, string title, string iconFileName) |
| void | addMacroToolButton(string macroName,string parameter,string iconfilename) |
| void | closeFile() |
| int | countFiles() |
| textDisplay* | drawing |
| string | filename |
| int | findFile(string filename) |
| void | hideToolBar(string name) |
| string | macroToolbarName |
| void | menuAdd(string name,string entries ) |
| void | needLayoutEditor(bool newOne=false) |
| void | needSchematicEditor(bool newOne=false) |
| void | newDoc() |
| void | newFile() |
| void | open(string filename) |
| void | reload() |
| void | save() |
| void | saveAs() |
| void | setFile(int i) |
| void | setLexer(string lexer) |
| void | setText(string text) |
| void | showToolBar(string name) |
| void | toolBarAdd(string name,string buttons) |
A textEdit window is the Text Editor: one or more files, menus and toolbars. The text of the visible file is text->drawing, a textDisplay. Macros started from the Text Editor use the name text for this window (not layout). If you need a layout from that macro, call needLayoutEditor() first so layout is valid. setFile chooses which open document is shown when several files are loaded. Save, reload and lexer (syntax highlighting) all go through this window or its drawing.
Example:
if (text->drawing->modified())
text->save();
text->needLayoutEditor();
layout->executeMacro(text->drawing->fileName);
Set the feature of an extra keyboard. key is the number of the key. It is numbered from 0 to the amount of keys the keyboard has. function is the feature code of the featur you want to add. As toolbutton, modification of the extra keyboard are not store and it is recommended to set it with an autostart macro. (introduced with release 20210905)
Assigns one key of an external keyboard to a macro. key is the key number. macroFileName is the full path of the macro, title the caption, and iconFileName the full path of the icon file. (introduced with release 20210910)
| Parameter: | |
|---|---|
| key | key index on the extra keyboard |
| macroFileName | full path of the macro file |
| title | caption shown for the key |
| iconFileName | full path of the icon file |
Adds a button to the Macros toolbar (created if missing). macroName is the macro to run. iconfilename is the icon. Buttons are not stored at shutdown.
| Parameter: | |
|---|---|
| macroName | macro to execute |
| parameter | reserved; pass an empty string |
| iconfilename | path to the button icon |
Closes the current visible file.
Returns: number of open files within the text editor.
The visible document: a textDisplay.
This string hold the current filename.
Returns: the number of the file in the list of file in the case the filename is open. Otherwise -1 is returned;
Hides the named toolbar.
Holds the name of the toolbar containing custom macros. The name must be set before the first macro is added to the toolbar. (introduced with release 20211216)
Add a new entry to the main menu. The first parameter is the name of the menu. The second parameter contains last entries of the new menu separated with a semicolon. Next to the feature name the FeatureCode can be used to access a feature.
| Parameter: | |
|---|---|
| name | name |
| entries | entries |
Calling the layout object from a macro will fail, if no layout window is associated with the textEdit class. Calling this feature will link the text edit window with a layout window. If newOne is true, a new empty layout window will be associated. Otherwise it will be looked for existing windows before creating a new one.
Calling the schematic object from a macro will fail, if no schematic window is associated with the textEdit class. Calling this feature will link the text edit window with a layout window. If newOne is true, a new empty schematic window will be associated. Otherwise it will be looked for existing windows before creating a new one.
Set the current file to a new empty file. A new file is created, if required.
Open a new empty file for editing.
opens the named file.
Reloads the current displayed file from disk. Unsaved modifications are removed.
Saves the current text file. If the file is not store or have no file name set, it asked for a filename.
Ask for a file name and store the current file there.
Displayes the file on position i.
Set the lexer for the current displayed text.
Set the text for the current displayed text file.
Shows the named toolbar.
Add a new tool bar, separate multiple buttons with a ';'. Next to the feature name the FeatureCode can be used to access a feature. {{{ text->toolBarAdd("my toolbar","New Layout;Zoom Mouse;Code 39;Quit"); }}}
| Parameter: | |
|---|---|
| name | name |
| buttons | buttons |