| Stonefield Query SDK |
| Options.Settings |
You can validate the values the user enters in your custom settings by creating an Options.Validate script, and receive notification about changes when the user clicks the OK button by creating an Options.Changed script.
Parameters
A reference to the Stonefield Query Application object.
Return Value
An XML string defining the settings to display in the Options dialog. The format for the XML is as follows:
<settings>
<setting>
<description>Setting description</description>
<type>Type of control</type>
<key>Registry key</key>
<left>Left position of the control</left>
<top>Top position of the control</top>
<filetype>File type</filetype>
<filedesc>File type description</filedesc>
<script>Script name</script>
</setting>
<setting>
<description>Setting description</description>
<type>Type of control</type>
<key>Registry key</key>
<left>Left position of the control</left>
<top>Top position of the control</top>
<filetype>File type</filetype>
<filedesc>File type description</filedesc>
<script>Script name</script>
</setting>
...
</settings>The following elements are available:
<values> <value>first value to display</value> <value>second value to display</value> ... </values>
Example
Here's an example that adds two new settings to the Options dialog: a Yes/No setting indicating whether the user can report on AR data, and a directory setting indicating the location of the AR data.
Visual FoxPro
lparameters toApplication as SQApplication local lcXML lcXML = '<settings>' + ; '<setting>' + ; '<description>Report on AR data</description>' + ; '<type>Checkbox</type>' + ; '<key>AR Data</key>' + ; '</setting>' + ; '<setting>' + ; '<description>Location of AR data</description>' + ; '<type>Directory</type>' + ; '<key>AR Location</key>' + ; '</setting>' + ; '</settings>' return lcXML
VBScript
function Main(Application) Main = "<settings>" & _ "<setting>" & _ "<description>Report on AR data</description>" & _ "<type>Checkbox</type>" & _ "<key>AR Data</key>" & _ "</setting>" & _ "<setting>" & _ "<description>Location of AR data</description>" & _ "<type>Directory</type>" & _ "<key>AR Location</key>" & _ "</setting>" & _ "</settings>" end function
JavaScript
function Main(Application) {
var cXML ;
cXML = "<settings>" +
"<setting>" +
"<description>Report on AR data</description>" +
"<type>Checkbox</type>" +
"<key>AR Data</key>" +
"</setting>" +
"<setting>" +
"<description>Location of AR data</description>" +
"<type>Directory</type>" +
"<key>AR Location</key>" +
"</setting>" +
"</settings>" ;
return cXML ;
}See the topic for the GetRegistryValue method of the Application object for an example that uses these options.
See Also
Options.Changed | Options.Validate | Scripts
| Last Updated: 02/05/2008 |