Class Reference textEdit

The text editor main window. More...

Member

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)

Detailed Description

the main window of a TextEditor. The text can be accessed via the Class textDisplay. If more than one file is opened the current display file can be set with setFile.

if (text->drawing->modified())text->save();
text->needLayoutEditor();
layout->executeMacro(text->drawing->fileName);

Member Function Documentation


void textEdit::addFunctionKey(int key,int function)

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)


void textEdit::addMacroKey(int key,string macroFileName, string title, string iconFileName)

Will set an key of an external keyboard to a macro. key is the number of the key at the keyboard. macroFileName os the full path of the macro, title the capture and IconFileName the full path of the icon file. (introduced with release 20210910)


void textEdit::addMacroToolButton(string macroName,string parameter,string iconfilename)

Add a new button to the toolbars. The button will be added to the toolbar 'Macros'. If this toolbar does not exist, it will be created. macroName specifies the name of the macro to be executed. iconfilename points to the file for the icon of the new button. If the given file does not exist, the default macro icon is used. !MacroToolButtons will not stored with shut-down.


void textEdit::closeFile()

Closes the current visible file.


int textEdit::countFiles()

Returns: number of open files within the text editor.


textDisplay* textEdit::drawing

This class is the main class of the text file. It holds all relevant information of a single text file and point to the current displayed files.


string textEdit::filename

This string hold the current filename.


int textEdit::findFile(string filename)

Returns: the number of the file in the list of file in the case the filename is open. Otherwise -1 is returned;


void textEdit::hideToolBar(string name)

Hides the named toolbar.


string textEdit::macroToolbarName

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)


void textEdit::menuAdd(string name,string entries )

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.


void textEdit::needLayoutEditor(bool newOne=false)

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.


void textEdit::needSchematicEditor(bool newOne=false)

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.


void textEdit::newDoc()

Set the current file to a new empty file. A new file is created, if required. (introduced with release 20190405)


void textEdit::newFile()

Open a new empty file for editing.


void textEdit::open(string filename)

opens the named file.


void textEdit::reload()

Reloads the current displayed file from disk. Unsaved modifications are removed.


void textEdit::save()

Saves the current text file. If the file is not store or have no file name set, it asked for a filename.


void textEdit::saveAs()

Ask for a file name and store the current file there.


void textEdit::setFile(int i)

Displayes the file on position i.


void textEdit::setLexer(string lexer)

Set the lexer for the current displayed text.


void textEdit::setText(string text)

Set the text for the current displayed text file.


void textEdit::showToolBar(string name)

Shows the named toolbar.


void textEdit::toolBarAdd(string name,string buttons)

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"); }}}