
- Robert Hunter and Jerry Garcia
Compiler Dialog Methods
| CompilerMessageDialog() | Displays OK/Cancel or Yes/No/Cancel message dialog to user during the compile process |
| CompilerTextEditDialog() | Displays a text edit message dialog to user during the compile process |
| CompilerFileDialog() | Displays a file selection dialog to user during the compile process |
| CompilerFolderDialog() | Displays a folder/directory selection dialog to user during the compile process |
| CompilerDialogCancelled() | Returns true if the last compile-time dialog was cancelled by the user |
See Also
Primitive Framework, Compiler System Methods, Compiler I/O Methods
public method<int> compiler CompilerMessageDialog(string Prompt, string DialogTitle, int IconType = Dialog.IconInfo, bool UseYes/No = false, bool UseCancel = true)
Parameters
Prompt
Text prompt to display to the user
DialogTitle
Title for the modal dialog
IconType
Type of icon (info, warning, error)
UseYesNo
Use the Yes/No/Cancel form of the dialog
UseCancel
Display a Cancel button if true
Return Value
Indicates how dialog was closed by user (OK, Cancel, etc.)
Description
This compiler method displays a modal message dialog and waits for the user to respond. The prompt to display to the user is specified, along with the title of the dialog. The "UseYesNo" flag indicates whether to show an OK/Cancel dialog (default) or a Yes/No/Cancel dialog. Regardless of the type of dialog, the "UseCancel" flag dictates whether the Cancel button will be displayed.
The icon type can be Dialog.IconInfo, Dialog.InfoWarning or Dialog.IconError.
The return type indicates which button was used to close the dialog, and can be Dialog.OK, Dialog.Yes, Dialog.No or Dialog.Cancel. If the ESC key is pressed within the dialog, the Dialog.Cancel value will be returned.
Compiler Method
public method<string> compiler CompilerTextEditDialog(string Prompt, string InitValue, string DialogTitle, bool AllowBlanks = true, bool UseCancel = true)
Parameters
Prompt
Text prompt to display to the user
InitValue
Initial value for the edit string
DialogTitle
Title for the modal dialog
AllowBlanks
Allow leading and trailing blanks if true
UseCancel
Display a Cancel button
Return Value
The text string entered by the user
Description
This compiler method displays a modal text edit dialog and waits for the user to enter the data and to respond. The prompt to display to the user is specified, along with the inital value of the text string and the title of the dialog. The "AllowBlanks" flag indicates whether to retain leading and trailing blanks, and the "UseCancel" flag dictates whether the Cancel button will be displayed.
The text string entered by the user is returned by the method. If "Cancel" was pressed by the user, the return string will be reset to the InitValue string.
Compiler Method
public method<string> compiler CompilerFileDialog(string InitFile, string FileFilters, string DialogTitle, bool OpenFile = true, bool UseCancel = true)
Parameters
InitFile
Initial file name to be displayed in the dialog
FileFilters
List of file filters
DialogTitle
Title for the modal dialog
OpenFile
Display a "File Open" dialog if true, and "File Save" if false.
UseCancel
Display a Cancel button
Return Value
The file name selected by the user
Description
This compiler method displays a modal file selection dialog and waits for the user to select a file. The prompt to display to the user is specified, along with the inital file name and the title of the dialog. The "OpenFile" flag indicates whether to it is a "File Open" dialog (true) or a "File Save" dialog (false), and the "UseCancel" flag dictates whether the Cancel button will be displayed.
The "File Filters" string is a tab delimited string which contains a set of description/filters for each type of file to support. An example filter string which provides two filters ("*.aztec" and "*.*"):
Filter = "Aztec Source Files" + string.HT + "*.aztec" + string.HT + "All Files" + string.HT + "*.*"
The file name selected by the user is returned by the method. If "Cancel" was pressed by the user, the return string will be reset to the InitFile string.
Compiler Method
public method<string> compiler CompilerFolderDialog(string InitFolder, string DialogTitle, bool UseCancel = true)
Parameters
InitFolder
Initial folder/directory name to be displayed in the dialog
DialogTitle
Title for the modal dialog
UseCancel
Display a Cancel button
Return Value
The folder/directory name selected by the user
Description
This compiler method displays a modal folder selection dialog and waits for the user to select a folder/directory. The prompt to display to the user is specified, along with the inital folder name and the title of the dialog. The "UseCancel" flag dictates whether the Cancel button will be displayed.
The folder/directory name selected by the user is returned by the method. If "Cancel" was pressed by the user, the return string will be reset to the InitFolder string.
Compiler Method
public method<bool> compiler CompilerDialogCancelled()
Parameters
None
Return Value
Returns true if last dialog was cancelled
Description
This compiler method returns true if the last compiler dialog was cancelled by the user and false if the last compiler dialog was not cancelled.
Compiler Method