R GUI Functions
These functions can add, remove or modify widgets for a GUI step in RPGM.
Note
All step
parameters refer to the variable created with rpgm.step(file, stepid)
for pointing to the correct GUI. All id
parameters refer to the ID of the widget.
Functions
gui.add(step, id, type)
Adds a new widget in a GUI.
id
is the ID of the new widget;type
is the type of the widget. See the Widget Types documentation page.
gui.addChoice(step, id, value, text)
Adds a new choice to a select widget.
gui.addChoices(step, id, values, texts)
Adds multiples choices to a select widget.
values
and texts
can be either a list or a simple vector like c()
. values
and texts
must have the same length.
gui.clearChoices(step, id)
Clears all the choices in a select widget.
gui.disable(step, id)
Disables a widget's input.
Synonym of gui.setProperties(step, id, list(enabled=FALSE))
gui.enable(step, id)
Enables a widget's input previously disabled.
Synonym of gui.setProperties(step, id, list(enabled=TRUE))
gui.hide(step, id)
Hides a widget.
Synonym of gui.setProperties(step, id, list(visible=FALSE))
gui.hideError(step, id)
Deprecated in RPGM 3.x / Server 2.x
Hides an error message below a widget. Replaced by gui.hideMessage(step, id)
gui.hideMessage(step, id)
Hides the message below a widget.
Synonym of gui.setProperties(step, id, list(messageText=""))
gui.remove(step, id)
Removes a widget from a GUI.
gui.removeChoice(step, id, value)
Removes a specific choice in a select widget by the value of the choice.
gui.setChoiceText(step, id, value, text)
Sets the text of a select widget's choice.
value
is the value of the option to change;text
is the new text of the option.
gui.setChoiceValue(step, id, text, value)
Removed in RPGM 3.x / Server 2.x
Changes the value of a widget of type select given its text.
gui.setProperties(step, id, properties)
Sets a list of properties for a widget.
properties
is a list of property/value.
The complete list of properties is available on the Widget Properties page.
gui.setProperty(step, id, property, value)
Sets a single property for a widget.
Synonym of gui.setProperties(step, id, list(property=value))
gui.setValue(step, id, value)
Sets the value of a widget.
Synonym of gui.setProperties(step, id, list(value=value))
gui.show(step, id)
Shows a widget previously hidden.
Synonym of gui.setProperties(step, id, list(visible=TRUE))
gui.showError(step, id, error)
Deprecated in RPGM 3.x / Server 2.x
Displays an error message below a widget. Replaced by gui.showMessage(step, id, "error", message)
gui.showMessage(step, id, type, message)
Shows a message below a widget.
type
can be either"error"
,"warning"
or"success"
.
Synonym of gui.setProperties(step, id, list(messageType=type, messageText=message))
gui.showModal(title, content)
Displays a modal with a title and a content. Supports HTML.
gui.showSuccess(step, id, text)
Deprecated in RPGM 3.x / Server 2.x
Displays a success message below a widget. Replaced by gui.showMessage(step, id, "success", message)
gui.showWarning(step, id, warning)
Deprecated in RPGM 3.x / Server 2.x
Displays a warning message below a widget. Replaced by gui.showMessage(step, id, "warning", message)
gui.submit()
Added in RPGM 3.0.50 / Server 2.0.0
Forces the form to be submitted. Useful when used in a GUI without Submit button.
gui.update(step, id)
Updates a widget by re-evaluating its initial value in R.
Removed From v3
rpgm.add<WidgetName>
: all those functions were removed;rpgm.addchoice
: Old alias ofgui.addChoice
already deprecated in v2;rpgm.addfield
: Old v1 function replaced bygui.add()
;rpgm.showerror
: Old v1 function replaced bygui.setMessage()
.