rk.XML.values: Create a value selector for RKWard plugins

View source: R/rk.XML.values.R

rk.XML.valuesR Documentation

Create a value selector for RKWard plugins

Description

This function will create a <frame> node including a <valueselector> and a <valueslot> node. It is actually a wrapper for rk.XML.valueslot and rk.XML.valueselector, since you usually won't define one without the other.

Usage

rk.XML.values(
  label,
  slot.text,
  options = list(label = c(val = NULL, chk = FALSE, i18n = NULL)),
  required = FALSE,
  multi = FALSE,
  duplicates = FALSE,
  min = 1,
  any = 1,
  max = 0,
  horiz = TRUE,
  add.nodes = NULL,
  frame.label = NULL,
  id.name = "auto",
  help = NULL,
  component = rk.get.comp()
)

Arguments

label

Character string, a text label for the value browser.

slot.text

Character string, a text label for the value selection slot.

options

A named list with string values to choose from. The names of the list elements will become labels of the options, val defines the value to submit if the value is selected, and chk=TRUE should be set in the one option which is checked by default. You might also provide an i18n for this particular option (see i18n). Objects generated with rk.XML.option are accepted as well.

required

Logical, whether the selection of values is mandatory or not.

multi

Logical, whether the valueslot holds only one or several objects.

duplicates

Logical, if multi=TRUE defines whether the same entry may be added multiple times. Sets multi=TRUE.

min

If multi=TRUE defines how many objects must be selected.

any

If multi=TRUE defines how many objects must be selected at least if any are selected at all.

max

If multi=TRUE defines how many objects can be selected in total (0 means any number).

horiz

Logical. If TRUE, the valueslot will be placed next to the selector, if FALSE below it.

add.nodes

A list of objects of class XiMpLe.node to be placed after the valueslot.

frame.label

Character string, a text label for the whole frame.

id.name

Character vector, unique IDs for the frame (first entry), the valueselector (second entry) and valueslot (third entry). If formula.dependent is not NULL, a fourth and fifth entry is needed as well, for the dependent valueslot and the formula node, respectively. If "auto", IDs will be generated automatically from label and slot.text.

help

Character string or list of character values and XiMpLe nodes, will be used as the text value for a setting node in the .rkh file. If set to FALSE, rk.rkh.scan will ignore this node. Also needs component to be set accordingly!

component

Character string, name of the component this node belongs to. Only needed if you want to use the scan features for automatic help file generation; needs help to be set accordingly, too!

Value

An object of class XiMpLe.node.

See Also

rk.XML.valueslot, rk.XML.valueselector, and the Introduction to Writing Plugins for RKWard

Examples

test.values <- rk.XML.values("Select some values", "Vars go here")
cat(pasteXML(test.values))

rkward-community/rkwarddev documentation built on May 9, 2022, 3:02 p.m.