BCGControlBar Tutorial: CBCGPEditCtrl XML format

BCGControlBar Professional Edition for MFC is a MFC extension library that you can use to build similar to Microsoft Office 2000 / XP / 2003/2007/2010/2013 and Microsoft Visual Studio-like (print, custom toolbars, menus, etc.) and Some other well-known products, advanced user interface, such as: calendar, grid, Gantt chart editor and so on. BCGControlBar This extension library contains more than 300 carefully designed, tested and MFC extension classes have complete documentation. BCGControlBar controls can be easily integrated into the application, save a lot of development and debugging time.

This article describes the XML file format for use with CBCGPEditCtrl. Or by calling CBCGPEditCtrl :: LoadXMLSettings CBCGPEditCtrl :: LoadXMLSettingsFromBuffer to call the XML parser.

Overall structure is as follows:

<SETTINGS>
     <OPTIONS>
         <WordDelimeters></WordDelimeters>
         <SpecialDelimiters></SpecialDelimiters>
         <IntelliSenseChars></IntelliSenseChars>
     </OPTIONS>
 
     <COLOR_DATA>
         <EditTextColor></EditTextColor>
         <EditBackColor></EditBackColor>
         <SelTextColor></SelTextColor>
         <SelBackColor></SelBackColor>
 
         <KEYWORDS>
             <Color></Color>
             <BackColor></BackColor>
             <CaseSensitive></CaseSensitive>
             <Keyword></Keyword>
             <Keyword></Keyword>
 
             ... more keywords ....
 
             <Keyword></Keyword>
         </KEYWORDS>
 
         <WORDS>
             <WORD>
                 <Val></Val>
                 <Color></Color>
                 <BackColor></BackColor>
                 <CaseSensitive></CaseSensitive>
             </WORD>
 
             ... more WORDs ...
 
             <WORD>
                 ....... 
             </WORD>
         </WORDS>
 
         <BLOCKS>
             <BLOCK>
                 <Start></Start>
                 <End></End>
                 <Color></Color>
                 <BackColor></BackColor>
                 <WholeText></WholeText>
                 <CaseSensitive></CaseSensitive>
             </BLOCK>
 
             ... more blocks ...
 
             <BLOCK>
                 .......
             </BLOCK>
         <BLOCKS> 
     </COLOR_DATA>
 </SETTINGS>


In addition to the main "SETTINGS" label, no other mandatory labeling.

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

  • WordDelimeters- defined CBCGPEditCtrl :: m_strWordDelimiters

  • SpecialDelimiters-定义CBCGPEditCtrl :: m_strSpecialDelimiters

  • IntelliSenseChars- defined CBCGPEditCtrl :: m_strIntelliSenseChars

"COLOR_DATA" tag defines a conventional edit controls of colors and color blocks and syntax highlighting.

  • EditTextColor- defined CBCGPEditCtrl :: m_clrText

  • EditBackColor- defined CBCGPEditCtrl :: m_clrBack

  • SelTextColor- defined CBCGPEditCtrl :: m_clrTextSelActive

  • SelBackColor-定义CBCGPEditCtrl :: m_clrBackSelActive

“KEYWORDS”标记用于语法突出显示定义。当您需要定义一组相同颜色的关键字时,它很有用。对于每个关键字,XML解析器将调用CBCGPEditCtrl :: SetWordColor。

  • 颜色-clrFrgnd参数

  • BackColor-clrBkgnd参数

  • CaseSensitive-bCaseSensitive参数

  • 关键字-strWord参数

“WORDS”标签用于使用各种颜色设置显示单独的单词。对于每个单词,XML解析器将调用CBCGPEditCtrl :: SetWordColor。

“WORD”标签代表一个单词。

  • Val-strWord参数

  • 颜色-clrFrgnd参数

  • BackColor-clrBkgnd参数

  • CaseSensitive-bCaseSensitive参数

“块”标签定义颜色块的列表。对于每个颜色块,XML解析器将调用CBCGPEditCtrl :: SetBlockColor

“BLOCK”标记代表单个颜色块

  • 开始-strBlockOpen参数

  • 结束-strBlockClose参数

  • 颜色-clrFrgnd参数

  • BackColor-clrBkgnd参数

  • WholeText-bWholeText参数

  • CaseSensitive-bCaseSensitive参数。

以下是XML解析器可以识别的颜色列表:

  • black

  • darkred

  • darkgreen

  • brown

  • darkblue

  • darkmagenta

  • darkcyan

  • gray

  • darkgray

  • red

  • green

  • yellow

  • blue

  • magenta

  • cyan

  • white

对于布尔值,可以使用“true”或“false”。

本文内容到这里就结束了,希望对您有所帮助!


Guess you like

Origin blog.51cto.com/14467432/2479489