Class Reference textDisplay

A text editor widget. More...

Member

void convert(string format)
string fileName
void openFile(string fileName, string codec="")
bool modified()
void saveFile(string fileName, string codec="")
bool setModifyAdded()
bool setModifyChanged()
bool setModifySaved()
void setLexer(string lexer)
void setText(string text)
string text()
string title

Detailed Description

graph LR te(textEdit)--drawing-->td(textDisplay) click te "/layoutscript/api/textedit" click td "/layoutscript/api/textdisplay" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class td thisClas class te clas

A textDisplay is one open file inside a textEdit window. You reach the visible file as text->drawing. text() reads the whole buffer; setText replaces it. fileName is the path on disk; modified is true after edits until save. setLexer chooses syntax highlighting for macros, spice, and similar. Encoding on open and save is automatic when codec is empty. This class does not own menus; those stay on textEdit.

Example:

string t = text->drawing->text();
text->drawing->setText(t + "\n// appended\n");

Member Function Documentation


void textDisplay::convert(string format)

Convert the contents text into an other format. format will choose the target format. These format convertion are available:

None yet.


string textDisplay::fileName

This string hold the current filename.


void textDisplay::openFile(string fileName, string codec="")

A file with the name s is opened. If codec is empty the encoding is detected automatic.

Parameter:
fileName path of the file
codec codec

bool textDisplay::modified()

Returns: true, if the design was modifies after the last save


void textDisplay::saveFile(string fileName, string codec="")

The text is saved to fileName. If codec is empty the encoding is detected automatic.

Parameter:
fileName path of the file
codec codec

bool textDisplay::setModifyAdded()

marks the design shapes to be added

Returns: true or false.


bool textDisplay::setModifyChanged()

marks the design to be modified

Returns: true or false.


bool textDisplay::setModifySaved()

marks the design not to be modified

Returns: true or false.


void textDisplay::setLexer(string lexer)

The lexer for highlighting is set.


void textDisplay::setText(string text)

set the text being displayed


string textDisplay::text()

Returns: The complete text of the file.


string textDisplay::title

Title of this file only used in the list open open files.