BCGSuite for MFC
XML Format for CBCGPEditCtrl

This article describes format of XML files to be used with CBCGPEditCtrl. The XML parser is invoked by calling to CBCGPEditCtrl::LoadXMLSettings or CBCGPEditCtrl::LoadXMLSettingsFromBuffer.

The overall structure is following:

1 <SETTINGS>
2  <OPTIONS>
3  <WordDelimeters></WordDelimeters>
4  <SpecialDelimiters></SpecialDelimiters>
5  <IntelliSenseChars></IntelliSenseChars>
6  </OPTIONS>
7 
8  <COLOR_DATA>
9  <EditTextColor></EditTextColor>
10  <EditBackColor></EditBackColor>
11  <SelTextColor></SelTextColor>
12  <SelBackColor></SelBackColor>
13 
14  <KEYWORDS>
15  <Color></Color>
16  <BackColor></BackColor>
17  <CaseSensitive></CaseSensitive>
18  <Keyword></Keyword>
19  <Keyword></Keyword>
20 
21  ... more keywords ....
22 
23  <Keyword></Keyword>
24  </KEYWORDS>
25 
26  <WORDS>
27  <WORD>
28  <Val></Val>
29  <Color></Color>
30  <BackColor></BackColor>
31  <CaseSensitive></CaseSensitive>
32  </WORD>
33 
34  ... more WORDs ...
35 
36  <WORD>
37  .......
38  </WORD>
39  </WORDS>
40 
41  <BLOCKS>
42  <BLOCK>
43  <Start></Start>
44  <End></End>
45  <Color></Color>
46  <BackColor></BackColor>
47  <WholeText></WholeText>
48  <CaseSensitive></CaseSensitive>
49  </BLOCK>
50 
51  ... more blocks ...
52 
53  <BLOCK>
54  .......
55  </BLOCK>
56  <BLOCKS>
57  </COLOR_DATA>
58 </SETTINGS>

There are no mandatory tags except the main "SETTINGS" tag.

"OPTIONS" tag describes common settings applied to the edit control.

"COLOR_DATA" tag defines general edit control colors as well as colors for syntax highlighting and blocks.

"KEYWORDS" tag is intended for syntax highlighting definitions. It's usable when you need to define a set of keywords of the same color. For each keyword the XML parser will call CBCGPEditCtrl::SetWordColor.

  • Color - clrFrgnd parameter
  • BackColor - clrBkgnd parameter
  • CaseSensitive - bCaseSensitive parameter
  • Keyword - strWord parameter

"WORDS" tag is intended for separate words to be displayed with various color settings. For each word the XML parser will call CBCGPEditCtrl::SetWordColor.

"WORD" tag represents a single word.

  • Val - strWord parameter
  • Color - clrFrgnd parameter
  • BackColor - clrBkgnd parameter
  • CaseSensitive - bCaseSensitive parameter

"BLOCKS" tag defines a list of color blocks. For each color block the XML parser will call CBCGPEditCtrl::SetBlockColor

"BLOCK" tag represents a single color block

  • Start - strBlockOpen parameter
  • End - strBlockClose parameter
  • Color - clrFrgnd parameter
  • BackColor - clrBkgnd parameter
  • WholeText - bWholeText parameter
  • CaseSensitive - bCaseSensitive parameter.

The following is the list of colors recognized by XML parser:

  • black
  • darkred
  • darkgreen
  • brown
  • darkblue
  • darkmagenta
  • darkcyan
  • gray
  • darkgray
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

For boolean values you can use "true" or "false".