Table of Contents
At some places in this introduction we have talked about “properties” of GUI elements or otherwise. In fact there are several different types of properties. Usually you do not need to worry about this, as you can use common sense to connect any property to any other property. However, internally, there are different types of properties. What this matters for, is when fetching some special values in the JS-template. In getString ("id")/getBoolean ("id")/getList ("id") statements you can also specify some so called “modifiers” like this:
getString ("id.modifier"). This modifier will affect, in which way the value is printed. Read on for the list of properties, and the modifiers they each make available:
The most simple type of property, used to simply hold a piece of text. Modifiers:
The string as defined / set.
The string in quoted form (suitable for passing to R as character).
Properties that can either be on or off, true or false. For instance the properties created by <convert>-tags, also the property accompanying a <checkbox> (see below). The following values will be returned according to the given modifier:
By default the property will return 1 if it is true, and 0 otherwise. The recommended way to fetch boolean values is using
getBoolean(). Note that for
getString(), the string "0" will be returned when the property is false. This string would evaluate to true, not to false in JS.
Returns the string "true" when true, "false", when false, or whichever custom strings have been specified (typically in a <checkbox>).
Return the string as if the property was true, even if it is false
Return the string as if the property was false, even if it is true
This actually returns another Boolean property, which is the reverse of the current (i.e. false if true, true if false)
Obsolete, provided for backwards compatibility. Same as no modifier "". Return "1" if the property is true, or "0" if it is false.
A property designed to hold an integer value (but of course it still returns a numeric character string to the JS-template). It does not accept any modifiers. Used in <spinbox>es (see below)
A property designed to hold a real number value (but of course it still returns a numeric character string to the JS-template). Used in <spinbox>es (see below)
getValue() / getString(), this returns the same as "formatted". In future versions, it will be possible to obtain a numeric representation, instead.
Returns the formatted number (as a string).
A property designed a selection of one or more R objects. Used most prominently in varselectors and varslots. The following values will be returned according to the given modifier:
By default the property will return the full name of the selected object. If more than one object is selected, the object names will be separated by line breaks ("\n").
Like above, but returns only short name(s) for the object(s). For instance an object inside a list would only be given the name it has inside the list, without the name of the list.
Like above, but returns the RKWard label(s) of the object(s) (if no label available, this is the same as shortname)
This property holds a list of strings.
getValue()/getString(), this returns all strings separated by "\n". Any "\n" characters in each item are escaped as literal "\n". However, the recommended usage is to fetch the value with
getList(), instead, which will return an array of strings.
Returns the list as a single string, with items joined by "\n". In contrast to no modifier (""), the individual strings are _not_ escaped.
A property held by plugins that generated code. This is important for embedding plugins, in order to embed the code generated by the embedded plugin into the code generated by the embedding (top-level) plugin. The following values will be returned according to the given modifier:
Returns the full code, i.e. the sections "preprocess", "calculate", "printout", and (but not "preview") concatenated to one string.
Returns only the preprocess section of the code
Returns only the calculate section of the code
Returns only the printout section of the code
Returns the preview section of the code
|Translating plugins||Up|| General purpose elements to be used in any XML file (|