This function creates a dialog box to ask the user to select an item from a list and provides a link to the relevant help file in the GAT program. It includes options to add a check box or text box if desired.
Figure: Dialog to enter several values
inputGATvariable(
title = "GAT window",
instruction = "Select one.",
help = "There is no help.",
helppage = NULL,
helptitle = NULL,
step = 0,
backopt = TRUE,
checkopt = "Check this box.",
checkbox = FALSE,
valuebox = FALSE,
value = 0,
check = FALSE,
valueopt = "Enter a number:",
mylist = letters,
myvar = NULL
)
A text string that denotes the dialog title.
A text string stating the instructions to the user.
A text string containing the help message.
A text string that contains the function name for the relevant function (if any) in the help dialog.
A text string that denotes the help dialog title.
Integer step in the GAT program, for help reference.
Boolean denoting whether to include the back button.
The text that should accompany the checkbox. If checkbox is FALSE, this is ignored.
A boolean that denotes whether or not to include a checkbox in the dialog.
A boolean that denotes whether or not to include a valuebox in the dialog.
A number or string that denotes the default value for the text box.
Boolean denoting the status of the checkbox. If TRUE, the checkbox starts checked.
The text that should accompany the valuebox. If valuebox is FALSE, this is ignored.
A character vector of variable names for the list.
Variable selected, if pre-defined.
if (interactive()) {
inputGATvariable(
title = "My favorite letter", checkbox = TRUE, valuebox = TRUE,
instruction = "Please select your favorite letter.",
checkopt = "Check this box \nif you love all letters.",
valueopt = "Enter the number of letters \nyou love."
)
}
#> $myvar
#> [1] "cancel"
#>
#> $check
#> [1] FALSE
#>
#> $threshold
#> [1] 0
#>