LensStudio:Ui.IDialogs
ClassInterface for file and message dialogs.
Index
Methods
Example
// IDialogs provides file and folder selection dialogs via gui.dialogs.
const gui = this.pluginSystem.findInterface(IGui.interfaceId) as IGui;
if (Editor.isNull(gui)) {
console.log('IGui not available');
return;
}
const dialogs: IDialogs = gui.dialogs;
// Open a file selection dialog
const params = {} as Dialogs.Params;
params.caption = 'Select an Image';
params.filter = 'Images (*.png *.jpg *.jpeg)';
params.options = Dialogs.Options.Usual;
const defaultPath = new Editor.Path('');
const filePath = dialogs.selectFileToOpen(params, defaultPath);
console.log('Selected file:', filePath.toString());
Extends
Methods
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
selectFilesToOpen()
selectFilesToOpen(
params,defaultPath):Path[]
Open a file selection dialog allowing multiple selections and return an array of selected file paths.
Parameters
Returns
Path[]
selectFileToOpen()
selectFileToOpen(
params,defaultPath):Path
Open a file selection dialog and return the selected file path.
Parameters
Returns
selectFileToSave()
selectFileToSave(
params,defaultPath):Path
Open a file save dialog and return the selected file path.
Parameters
Returns
selectFolderToOpen()
selectFolderToOpen(
params,defaultPath):Path
Returns selected path, or an empty path if the dialog was cancelled.
Parameters
Returns
selectFolderToSave()
selectFolderToSave(
params,defaultPath):Path
Open a folder selection dialog for saving and return the selected folder path.