Interface IDialogComponent
Interface for creating and interacting with modal dialogs.
Inherited Members
Namespace: OpenTK.Platform
Assembly: OpenTK.Platform.dll
Syntax
public interface IDialogComponent : IPalComponent
Properties
CanTargetFolders
If the value of this property is true SelectDirectory will work. Otherwise this flag will be ignored.
Declaration
bool CanTargetFolders { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
Methods
ShowMessageBox(WindowHandle, string, string, MessageBoxType, IconHandle?)
Shows a modal message box.
Declaration
MessageBoxButton ShowMessageBox(WindowHandle parent, string title, string content, MessageBoxType messageBoxType, IconHandle? customIcon = null)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | parent | The parent window for which this dialog is modal. |
string | title | The title of the dialog box. |
string | content | The content text of the dialog box. This is the prompt to the user, explain what they should do. |
MessageBoxType | messageBoxType | The type of message box. Determines button layout and default icon. |
IconHandle | customIcon | An optional custom icon to use instead of the default one. |
Returns
Type | Description |
---|---|
MessageBoxButton | The pressed message box button. |
Remarks
This function runs a modal event loop and will only return once the dialog has been dissmissed by pressing any of it's buttons.
See Also
ShowOpenDialog(WindowHandle, string, string, DialogFileFilter[]?, OpenDialogOptions)
Shows a modal "open file/folder" dialog.
Declaration
List<string>? ShowOpenDialog(WindowHandle parent, string title, string directory, DialogFileFilter[]? allowedExtensions, OpenDialogOptions options)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | parent | The parent window handle for which this dialog will be modal. |
string | title | The title of the dialog. |
string | directory | The start directory of the file dialog. |
DialogFileFilter[] | allowedExtensions | A list of file filters that filter valid files to open. See DialogFileFilter for more info. |
OpenDialogOptions | options | Additional options for the file dialog (e.g. AllowMultiSelect for allowing multiple files to be selected.) |
Returns
Type | Description |
---|---|
List<string> | A list of selected files or null if no files where selected. If AllowMultiSelect is not specified the list will only contain a single element. |
Remarks
This function runs a modal event loop and will only return once the dialog has been dissmissed by pressing any of it's buttons.
See Also
ShowSaveDialog(WindowHandle, string, string, DialogFileFilter[]?, SaveDialogOptions)
Shows a modal "save file" dialog.
Declaration
string? ShowSaveDialog(WindowHandle parent, string title, string directory, DialogFileFilter[]? allowedExtensions, SaveDialogOptions options)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | parent | The parent window handle for which this dialog will be modal. |
string | title | The title of the dialog. |
string | directory | The starting directory of the file dialog. |
DialogFileFilter[] | allowedExtensions | A list of file filters that filter valid file extensions to save as. See DialogFileFilter for more info. |
SaveDialogOptions | options | Additional options for the file dialog. |
Returns
Type | Description |
---|---|
string | The path to the selected save file, or null if no file was selected. |
Remarks
This function runs a modal event loop and will only return once the dialog has been dissmissed by pressing any of it's buttons.