RPGM 2.0 Docs

GUI R functions

This set of functions allows to control dynamically the widgets in a GUI step.

gui.addButton(step, pos, id, label, value, onPress)

Adds a new Button widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the text of the Button
  • onPress is a string of R code which will be executed when the user presses the button

See also the manual page for the Graphical interfaces for further details.

gui.addCheckbox(step, pos, id, label, value, req, cond, onChange)

Adds a new Checkbox widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value should be set to TRUE if the checkbox must be checked and FALSE for unchecked
  • req should be set to TRUE if the Checkbox must be checked before submitting the GUI
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user checks or unchecks the Checkbox

See also the manual page for the Graphical interfaces for further details.

gui.addCombobox(step, pos, id, label, value, choices_values, choices_texts, cond, onChange)

Adds a new Combobox widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the unique ID of the default selected value in the Combobox
  • _choicesvalues is a list of the choice’s IDs in the Combobox
  • _choicestexts is a list of the choice’s texts in the Combobox. This list MUST have the same length than _choicesvalues
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user change the value of the Combobox

See also the manual page for the Graphical interfaces for further details.

gui.addDate(step, pos, id, label, value, req, cond, onChange)

Adds a new Date widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default text in the Date
  • req should be set to TRUE if the Date must be filled before submitting the GUI
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the date of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addDoubleFloat(step, pos, id, label, value, value2, req, min, max, cond, onChange)

Adds a new Double Float widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default float number in the widget
  • value2 is the default float number in the second widget
  • req should be set to TRUE if the values must be filled before submitting the GUI
  • min is the minimum value possible for the widget
  • max is the maximum value possible for the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s values
  • onChange is a string of R code which will be executed when the user modifies the numbers of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addDoubleNumeric(step, pos, id, label, value, value2, req, min, max, cond, onChange)

Adds a new Double Numeric widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default integer number in the widget
  • value2 is the default integer number in the second widget
  • req should be set to TRUE if the values must be filled before submitting the GUI
  • min is the minimum value possible for the widget
  • max is the maximum value possible for the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s values
  • onChange is a string of R code which will be executed when the user modifies the numbers of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addFile(step, pos, id, label, value, req, cond, onChange)

Adds a new File selection widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default text in the File widget
  • req should be set to TRUE if the widget must be filled before submitting the GUI
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the path of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addFolder(step, pos, id, label, value, req, cond, onChange)

Adds a new Folder selection widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default text in the Folder widget
  • req should be set to TRUE if the widget must be filled before submitting the GUI
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the path of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addFloat(step, pos, id, label, value, req, min, max, cond, onChange)

Adds a new Float widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default integer number in the widget
  • req should be set to TRUE if the value must be filled before submitting the GUI
  • min is the minimum value possible for the widget
  • max is the maximum value possible for the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the number of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addImage(step, pos, id, label, value, fullWidth)

Adds a new Image widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the path of the image to display
  • fullWidth: if set to TRUE, it will hide the label and will expand the image to the maximum width available

See also the manual page for the Graphical interfaces for further details.

gui.addLabel(step, pos, id, label, value, fullWidth, margin, color, size, font)

Adds a new Label widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the text of the label
  • fullWidth: if set to TRUE, it will hide the small label on the left and will expand the text to the maximum width available
  • margin is a number of empty pixels on top of the label for creating a vertical space. Use 0 to remove the space and
    create a “help text” below the previous widget. Default is 8 pixels
  • color is the color of the text in the format #RRGGBB. Red is #FF0000. Black is #000000
  • size is the size of the text
  • font is the font family of the text. See in the Editor’s GUI Editor for available fonts

See also the manual page for the Graphical interfaces for further details.

gui.addNumeric(step, pos, id, label, value, req, min, max, cond, onChange)

Adds a new Numeric widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default integer number in the widget
  • req should be set to TRUE if the value must be filled before submitting the GUI
  • min is the minimum value possible for the widget
  • max is the maximum value possible for the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the number of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addRadio(step, pos, id, label, value, choices_values, choices_texts, cond, onChange)

Adds a new Radio widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the unique ID of the default selected value in the Radio
  • _choicesvalues is a list of the choice’s IDs in the Radio
  • _choicestexts is a list of the choice’s texts in the Radio. This list MUST have the same length than _choicesvalues
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user change the value of the Radio

See also the manual page for the Graphical interfaces for further details.

gui.addSelect(step, pos, id, label, value, choices_values, choices_texts, cond, onChange)

Adds a new Select widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the unique ID of the default selected value in the Select
  • _choicesvalues is a list of the choice’s IDs in the Select
  • _choicestexts is a list of the choice’s texts in the Select. This list MUST have the same length than _choicesvalues
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user change the value of the Select

See also the manual page for the Graphical interfaces for further details.

gui.addSlider(step, pos, id, label, value, min, max, st, cond, onChange)

Adds a new Slider widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default integer number in the widget
  • req should be set to TRUE if the value must be filled before submitting the GUI
  • min is the minimum value possible for the widget
  • max is the maximum value possible for the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the number of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addText(step, pos, id, label, value, req, max, cond, onChange)

Adds a new Text widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default text in the Text
  • req should be set to TRUE if the Text must be filled before submitting the GUI
  • max is an number for limiting the maximum number of characters the user can type in the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the text of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addTextarea(step, pos, id, label, value, req, max, cond, onChange)

Adds a new Textarea widget in a GUI.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • position is the position of the new widget. 0 is for placing the element in the first position
  • id is the unique identifier for the new widget
  • label is the text of the label in front of the widget
  • value is the default text in the Textarea
  • req should be set to TRUE if the Textarea must be filled before submitting the GUI
  • max is an number for limiting the maximum number of characters the user can type in the widget
  • cond is a string of R code returning TRUE or FALSE for the validation of the widget’s value
  • onChange is a string of R code which will be executed when the user modifies the text of the widget

See also the manual page for the Graphical interfaces for further details.

gui.addChoice(step, id, value, text)

Add a choice to a Comboxbox, Radio or Select widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • value is the value of the new choice
  • text is the text displayed of the new choice

The new option is added to the end of the field.
See also the manual page for the Graphical interfaces for further details.

gui.addChoices(step, id, choices_values, choices_texts)

Add multiples choices to a Comboxbox, Radio or Select widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • value is a list of values to add
  • text is a list of the texts to display, and corresponding to the value list

See also the manual page for the Graphical interfaces for further details.

gui.setChoiceValue(step, id, text, value)

Modify the value of an existing choice

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • text is a string of the text for which the value will change
  • value is the new value of the choice

See also the manual page for the Graphical interfaces for further details.

gui.setChoiceText(step, id, value, text)

Modify the text of an existing choice

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • value is the value of the choice for which the text will change
  • text is the new textof the value

See also the manual page for the Graphical interfaces for further details.

gui.removeChoice(step, id, value)

Removes a choice from an existing Combobox, Radio or Select widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • value is the value of the choice to delete

See also the manual page for the Graphical interfaces for further details.

gui.clearChoices(step, id)

Removes all choices from an existing Combobox, Radio or Select widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

See also the manual page for the Graphical interfaces for further details.

gui.setValue(step, id, value)

Sets the value of an existing widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • value is the new value of the widget. For widgets like Double Numeric, a list can be passed.

See also the manual page for the Graphical interfaces for further details.

gui.enable(step, id)

Added in 2.0.2

Enable a widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

gui.disable(step, id)

Added in 2.0.2

Disable a widget by greying it so that the user can’t change its value.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

As of 2.0.2, note that each time the user will enter in a GUI, all the widgets will be enabled. So this function is only useful in
dynamic changes.

gui.show(step, id)

Show a widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

gui.hide(step, id)

Hide a widget.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

gui.showSuccess(step, id, message = “”)

Added in 2.0.2

Show a message in green color below an existing widget

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • error: the text of the message

gui.showWarning(step, id, message = “Loading…”)

Added in 2.0.2

Show a message in orange below an existing widget

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • error: the text of the message

gui.showError(step, id, error)

Show an error below an existing widget

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget
  • error: the text of the error message

gui.hideError(step, id)

Deprecated since 2.0.2

Hide an error message for a widget. Deprecated in 2.0.2 as gui.hideMessage should be used instead.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

gui.hideMessage(step, id)

Added in 2.0.2

Hide a message (error, success or warning) for a widget

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget

gui.remove(step, id)

Completely delete a widget from a GUI. The widget will no longer exists.

  • step is a step object created by rpgm.step() or can be set to "this" for onChange and other dynamical changes
  • id is the unique identifier of the widget