rk.XML.menu: Create XML "menu" node for RKWard plugins

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

rk.XML.menuR Documentation

Create XML "menu" node for RKWard plugins

Description

This function will create a menu node for hierarchy sections. Use same id values to place entries in the same menu.

Usage

rk.XML.menu(label, ..., index = -1, id.name = "auto", i18n = NULL)

Arguments

label

Character string, a label for the menu.

...

Eithet objects of class XiMpLe.node, must be either "menu" or "entry", or a list of character strings representing the menu path, with the last element being the component value for rk.XML.entry.

index

Integer number to influence the level of menu placement. If ... is a list, index can also be a vector of the same length + 1, so indices will be set in the same order to the menu levels, the last value is for the entry.

id.name

Character, a unique ID for this plugin element. If "auto", an ID will be generated automatically from the label. Otherwise, if ... is a list, id.name must have the same length and will be set in the same order to the menu levels. Used to place the menu in the global menu hierarchy.

i18n

Either a character string or a named list with the optional elements context or comment, to give some i18n_context information for this node. If set to FALSE, the attribute label will be renamed into noi18n_label.

Value

An object of class XiMpLe.node.

See Also

rk.XML.hierarchy, rk.XML.entry, rk.XML.component, rk.XML.components, and the Introduction to Writing Plugins for RKWard

Examples

test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
test.entry <- rk.XML.entry(test.component)
test.menu <- rk.XML.menu("Analysis", test.entry, id.name="analysis")
cat(pasteXML(test.menu))
# manual definition of a menu path by a list:
test.menu <- rk.XML.menu("Analysis", list("Level 1", "Level 2", test.component))

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