BeSly Software Solutions About yab About us Admin




Name:

textedit set -- set various options for a textedit

Synopsis:
TEXTEDIT SET TextEdit$, Option$
TEXTEDIT SET TextEdit$, Option$, Value
TEXTEDIT SET TextEdit$, Option$, Value$

Description:
Textedit set allows you to apply standard editing operations, cut, copy, paste, clear, select-all, undo. It allows you set various options for the textedit, e.g. wordwrap, editable, autoindent. And it handles the autocompletion. Let us have a look in detail:

Given only two parameters, the following options are valid for the textedit named TextEdit$:
Option$ = "cut" -- cut out the selected text and put it into the clipboard
Option$ = "clear" -- cut out the selected text but do not put it into the clipboard
Option$ = "copy" -- copy the selected text to the clipboard
Option$ = "paste" -- paste the content of the clipboard at the cursors position
Option$ = "select-all" -- select the whole text
Option$ = "undo" -- undo the last operation, note: undo remembers only one operation

Given three parameters, the following options are valid for the textedit named TextEdit$ when the third parameter Value is either true or false:
Option$ = "autoindent" -- turn auto indent on or off, default is off (false)
Option$ = "changed" -- mark the textedit as changed or unchanged, default is false
Option$ = "color-case-sensitive" -- should the syntax highlighting be case-sensitive? default is false
Option$ = "editable" -- allow the user to edit the textedit, default is true
Option$ = "has-autocompletion" -- turn auto-completion on or off, default is on (true)
Option$ = "wordwrap" -- turn on/off word wrap at the end of a line, default is on (true)
Option$= "focus", -- use this to make the textedit have focus (true)

Some remarks: 
Making a textedit not editable is useful when you want to show long text (or scrollable text).
The textedit will notice when text was changed since the last time the option "changed" was set to false. So when you saved the content of the textedit, remember to set back the "changed" option to false again. Then you know when the text should be saved again.

Given three parameters, the following options are valid for the textedit named TextEdit$ when the third parameter Value is a number:
Option$ = "autocomplete-start" -- set the number of characters when auto-completion should kick in (default is 4)
Option$ = "Cursor" -- place the cursor at the ofset of Value characters from the start.
Option$ = "gotoline" -- put the cursor to the line with number Value
Option$ = "select" -- select the line with number Value
Option$ = "tabwidth" -- set the tab width to Value (in pixel!), default is 28
Option$ = "textwidth" -- set the maximum width of the text in pixel

Given three parameters, the following options are valid for the textedit named TextEdit$ when the third parameter Value$ is a string:
Option$ = "font" -- set the font to Value$ (see draw set for details), default is "system-plain"
Option$ = "autocomplete" -- add the word Value$ to the auto-completion list
Option$ = "align" and  value$ = "left|center|right" -- set the alignment for text in the textedit view.
Option$ = "plain" value$ = str$(point) sets the font to system plain font of point size (number from 7 and up 
Option$ = "fixed" value$ = str$(point) sets the font to system fixed font of point size (number from 7 and up 
Option$ = "bold" value$ = str$(point) sets the font to system bold font of point size (number from 7 and up 


Related: textedit, textedit add, textedit clear, textedit color, textedit get, textedit get$