Syntax
Uci.ShowDialog( UCI_Name, DialogTable )
Arguments
UCI_Name : String. The name of the target UCI for which to display the dialog.
DialogTable : A table consisting of the following elements
Title = "UCI dialog titlebar string",
Message = "Dialog message string",
Buttons = { "Button_String", "Button_String", "Button_String", "etc." }
The button list is a table consisting of strings – one string per desired response button.
Handler = EventHandler_Function
The EventHandler Function receives an integer index of which button was pressed. The EventHandler argument is zero-based, so add 1 to the integer to match a Lua table entry. See example.
Example
In this example, the ShowDialog control and event handler activates the dialog. The UCIDialogHandler event handler function calls the WhichButton control to provide feedback of which button was pushed, defined by a list of strings (ButtonText).
Copy
ButtonText = {
"Button 1 was pushed",
"Button 2 was pushed",
"Button 3 was pushed",
}
function UCIDialogHandler(choiceInt)
print(choiceInt,ButtonText[choiceInt+1])
Controls.WhichButton.String = ButtonText[choiceInt+1]
end
function ShowDialog()
Uci.ShowDialog(
"Main UCI",
{
Title = "UCI Dialog Titlebar",
Message = "Which button would you like to push?",
Buttons = {
"Button 1",
"Button 2",
"Button 3",
},
Handler = UCIDialogHandler,
}
)
end
Controls.ShowDialog.EventHandler = ShowDialog