setNamedAttribute(attName: String; value: Any);
The setNamedAttribute method of the JadeTextEdit class sets the named attribute specified in the attName parameter to the value specified in the value parameter.
The JADE text editor supports the following named attributes.
automatic.indenting
Boolean attribute that defaults to true, indicating that new lines are automatically indented to match the preceding (non-blank) line. Indentation of pasted lines is not changed.
caret.finder
Boolean attribute that defaults to false. When set true, pressing then releasing the Ctrl key causes the caret location to be highlighted.
caret.fore.color
Integer attribute that specifies the foreground color of the caret.
caret.line.back.color
Integer attribute that specifies the color that will override the background color of the line that currently contains the caret. The default value is -1, which disables the background color override functionality; that is, removes highlighting of the caret line. For example, the following code fragment sets the caret line background color to light green.
jte.setNamedAttribute("caret.line.back.color", jte.rgb(200,255,200));
caret.width
Integer attribute that specifies the width of the caret in pixels, with the default value being 1.
fold.compact
Boolean attribute that specifies if folding is compact or normal (the default). For more details, see the folding property.
fold.margin.color
Integer attribute that specifies the background color for the fold margin. It is an RGB value. The default value (-1) specifies that a system value be used.
linenumber.margin.width
Integer attribute that specifies the minimum line number margin width in characters, with the default value being 3 and the range 1 through 60. The margin automatically expands if the last line number requires more space.
marker.margin.mask
Integer attribute that specifies a bit mask of the margin marker, with the default value being SC_MASK_FOLDERS.
marker.margin.width
Integer attribute that specifies the width in pixels of the marker margin, with the default value being 20 pixels and the range 4 through 600.
smart.indent.words
String attribute that defaults to null ("") and which is set to a list of words (for example, the
When automatic.indenting is set to true (that is, the automatic.indenting named attribute is set) and the list of smart words is not null, and a new line is inserted, and the previous non-blank line begins with one of the words in the smart list, the caret is indented one additional position. The JADE smart words are constants, vars, begin, epilog, if, elseif, foreach, and while.
The method in the following example shows the use of the setNamedAttribute method.
mnuEditSetAutoindent_click(menuItem: MenuItem input) updating; begin menuItem.checked := not menuItem.checked; jteSource.setNamedAttribute("automatic.indenting", menuItem.checked); end;