Color Scheme XML Structure |
Top Previous Next |
Color scheme used to assign font attributes to tokens. Color scheme XML document is separated from syntax scheme XML document for easer coloring styles changing. Color scheme documents are contained in TLMDEditDocument.ColorSchemes collection.
XML document for color scheme structure:
Element: <Attributes>
Root of the color scheme XML file.
Sub-elements:
Assigns text attributes to given token.
Assigns custom attributes collection to given token. For example, we can use this ability for TRichEdit content colorization, to set different font sizes for different tokens and sub-schemes.
And, custom attributes which set as default for some scheme, gets overlapped by correspondent attributes when those are defined for tokens produced by this scheme. For example, in CustomAttrsDemo application:
We use 'font-name' attribute to set the font for some tokens:
See example below for syntax of <CustomAttributes> sub-elements.
Example of color scheme:
<?xml version="1.0" encoding="UTF-8"?> <Attributes> <CustomAttributes> <SomeCustomName>Value</SomeCustomName> <font-name>Arial</font-name> <font-size>12</font-size> <border-width>1</border-width> <border-color>red</border-color> </CustomAttributes>
<Token name="default" textColor="#0" /> <Token name="defaultEmbed" backgroundColor="#ECE9D8" /> <Token name="comment" textColor="#008000" /> <Token name="commentStart" textColor="#008000" /> <Token name="commentEnd" textColor="#008000" /> <Token name="keyword" fontStyle="bold" /> <Token name="email" fontStyle="bold" /> <Token name="number" textColor="Blue" /> <Token name="symbol" textColor="Blue" /> <Token name="string" textColor="Blue" /> <Token name="badString" textColor="Red" /> <Token name="preprocessor" textColor="#008080" /> <Token name="badPreprocessor" textColor="red" /> </Attributes> |