UI.MessageBox

Message boxes can be used to display modal notifications and ask for simple questions to the user. It is suggested to not use too many message boxes as they are breaking the productivity flow of the user. Whenever possible, you can use the log to output most of you messages and rely on settings to choose the appropriate behavior depending on the circumstances.

UI.MessageBox.GetSaveFileName( options )

Tacview 1.8.0

Asks the user which under which file name he/she wants to save a file.

options = { defaultFileExtension = defaultFileExtension, – excluding ‘.’, for example “csv” fileName = defaultFileNameToSave, – (OPTIONAL) default full path or file name for the file to save

fileTypeList =                                  -- List of file types supported for save (usually one item of the typical type)
{
    { extensions, description }                 -- File type(s) and description {"*.jpg;*.png", "Picture"}
}

}

Return value:
full path of the file name to save
nil if the user has canceled the operation

Example:

local options =
{
defaultFileExtension = “csv”,
fileTypeList =
{
{ “.csv” , “Comma-separated values” }
{ “
.xml” , “Extensible Markup Language” }
{ “.json;.js” , “JavaScript Object Notation” }
}
}

UI.MessageBox.GetFolderName( options )

Tacview 1.8.0

Prompts the user to select a folder and retrieve selected folder full path.

options = { folderName = defaultFolderNameToSelect, – (OPTIONAL) full path of the folder to select by default canCreateNewFolder = boolean, – (OPTIONAL) set to true to enable the user to create new folders }

Return value:
full path of the folder name
nil if the user has canceled the operation

Example:

local options =
{
folderName = “C:/Downloads/“,
canCreateNewFolder = true,
}