WinPTE.com

 

Options Pane Reference

Implementation

The Options Pane itself is configured via an XML file. The options.xml contains the definitions for all the groups, categories, properties etc. This makes the contents of the options pane dynamic. It is actually more dynamic than that see Data Store Concept for more implementation details. Options.xml is loaded into the global data store node /editor/config/options. So judicious changes to elements under this path will have immediate effect on the options pane.

Option Groups

Properties in the options pane are organized into groups and categories. Groups can contain other groups categories cannot. Groups are displayed in the tree view of the options pane, while categories and properties are displayed in the property grid.

Since the options.xml file is loaded by the data store it has the limitation that all tags within the parent scope must have unique names. The name of the XML tag is only used internally and each element's display text is defined by the value attribute of the <display> tag or text contained between the opening <display> and closing </display> tags. <display value="Display Name" /> and <display>Display Name</display> are equivalent.

Defining a group in XML

<groupname value="group">
  <display value="Text Used for Displaying the Group in the Tree" />
  ... contained groups and categories go here ...
</groupname>

Defining Categories

<acategory value="category">
  <display value="Display Text for the category" />
  <description>
    Optional text to be displayed in the 
	  Help/Description part of the property grid
  </description>
  <properties>
    ...contained properties go here...
  </properties>
</acategory>

Any category containing an <advanced /> will not be displayed unless "Show Advanced Options" button is depressed. To tag individual properties as advanced include the <advanced /> tag in the property definition.

Defining Properties

Properties can be simple values (Boolean yes/no, Tri-State yes/no/maybe, numeric (integer 32 bits), string, color, font or style. Style refers to the Text Style used by the new display engine to render all visual elements in the text view of the editor. All property definitions have a <property> tag whose value attribute contains the absolute Data store path to the where the actual value is stored. Any properties which do not have the required tags are skipped and will not be displayed in the property grid. Categories which do not contain any displayable properties will not be displayed either.

 <highlightword>
    <type value="style" />
    <display value="Latest Highlight" />
    <property value="/editor/session/textview/userstyles/highlightword" />
    <description>
      Optional text to be displayed in the 
      Help/Description part of the property grid
    </description>
    <advanced />
 </highlightword>

If the <advanced /> tag is present it will mark this property as only displayable when the "Show Advanced Options" button is depressed.

Property Types

Boolean <type value="bool" /> optionally the text for true or false conditions can be specified

<type value="bool"> <true value="Yes"/><false value="No" /></type>

Tri-State <type value="tristate" /> optionally the text for true, false or null conditions can be specified

<type value="bool"> <true value="Yes"/><false value="No" text /> <null value="Unspecified" /> </type>

Numeric <type value="number" /> or

<type value="number"> 
   <min value="0x80000000" /> 
   <max value="0x7fffffff" />
   <format value="%d" />
   <noslider/>
   <nospin/>
</type> 

Default values shown for tags if they are omitted. The format is a C printf style format. noslider and/or nospin disable the slider control for that property and the spin buttons respectively.

String <type value="string / >

<type value="string"> 
   <passwordmask value="*" /> 
   <maskedit value="_" />
   <maskliteral value=" " />
</type>

password mask if specified will use the first character of the value attribute to mask the contents of the field. If not specified '*' will be used.

maskedit and maskliteral are passed to XTRemePro property grid implementation and I have not looked into it yet. For future fathoming.

Color <type value="color" />

<type value="string"> 
   <noalpha /> 
</type>

noalpha tag disables (does not show) the alpha component of the color.

Font <type value="font" />

Style <type value="style" />

<type value="string"> 
   <disable value="disable list" /> 
</type>

disable list is a concatenated string separated by any non-alpha characters of the following keywords:

Example:

 <highlightword>
    <type value="style" />
    <display value="Latest Highlight" />
    <property value="/editor/session/textview/userstyles/highlightword" />
    <description>
      Optional text to be displayed in the 
      Help/Description part of the property grid
    </description>
    <advanced />
 </highlightword>

Built In Styles <type value="textviewstyle" /> only valid if the containing tag name matches one of the built in styles used for the text view. Complete list in options.xml If <display> tag is present then its value attribute will be used for the display string of the style. Otherwise the default display string for the style will be used. (see Text Styles Reference )

 

 

Site Map | Privacy Policy | Contact Us | ©2004 Winpte.com