Editor API
UnigineEditor public API
Editor::AssetDialogs Class Referencefinal

This class is used to represent a standard asset dialog of the UnigineEditor that can be used for opening and saving assets. More...

#include <AssetDialogs.h>

Classes

struct  SelectedAsset
 Structure representing an asset selected in the dialog. More...
 

Public Types

enum  DialogMode { DialogMode::Modal, DialogMode::Modeless }
 Dialog mode. More...
 

Static Public Member Functions

static void browseAsset (Unigine::CallbackBase1< const SelectedAsset & > *callback, const char *window_title=nullptr, const char *filter=nullptr, const char *hint_asset_path=nullptr, DialogMode mode=DialogMode::Modal)
 Opens a dialog enabling the user to select a single asset. When the dialog opens, the specified default path and file filter shall be set displaying the corresponding elements. On selecting an asset and confirming selection by clicking OK, the specified callback function is executed. More...
 
static void browseAssetList (Unigine::CallbackBase1< const Unigine::Vector< SelectedAsset > & > *callback, const char *window_title=nullptr, const char *filter=nullptr, const char *hint_asset_path=nullptr, DialogMode mode=DialogMode::Modal)
 Opens a dialog enabling the user to select multiple assets. When the dialog opens, the specified default path and file filter shall be set displaying the corresponding elements. On selecting assets and confirming selection by clicking OK, the specified callback function is executed. More...
 
static void saveAsset (Unigine::CallbackBase1< const char * > *callback, const char *window_title=nullptr, const char *filter=nullptr, const char *dest_path=nullptr, DialogMode mode=DialogMode::Modal)
 Opens a dialog enabling the user to save an asset to the selected path. When the dialog opens, the specified default path and file filter shall be set displaying the corresponding elements. On selecting assets and confirming selection by clicking OK, the specified callback function is executed. More...
 

Detailed Description

This class is used to represent a standard asset dialog of the UnigineEditor that can be used for opening and saving assets.

Member Enumeration Documentation

◆ DialogMode

Dialog mode.

Enumerator
Modal 

Modal dialog, which requires the user to respond before continuing the program (the function returns control only when the user closes the dialog).

Modeless 

Modeless dialog, which stays on the screen and is available for use at any time but permits other user activities (the function returns control right after creating and displaying the dialog).

Member Function Documentation

◆ browseAsset()

static void Editor::AssetDialogs::browseAsset ( Unigine::CallbackBase1< const SelectedAsset & > *  callback,
const char *  window_title = nullptr,
const char *  filter = nullptr,
const char *  hint_asset_path = nullptr,
DialogMode  mode = DialogMode::Modal 
)
static

Opens a dialog enabling the user to select a single asset. When the dialog opens, the specified default path and file filter shall be set displaying the corresponding elements. On selecting an asset and confirming selection by clicking OK, the specified callback function is executed.

Parameters
callbackCallback function to be fired on selecting an asset and clicking OK. The signature of the callback function is as follows: void (const SelectedAsset &)
window_titleTitle of the dialog window. If not specified, the default title is 'Select Asset'.
filterFilter, which is used to display files of required types only. List of file extensions with leading dots and without additional separators, for example: .mesh.prop. If the filter is empty, the dialog displays assets of all types.
hint_asset_pathPath to an asset to be selected by default when the dialog opens.
modeDialog mode to be set (see DialogMode).

◆ browseAssetList()

static void Editor::AssetDialogs::browseAssetList ( Unigine::CallbackBase1< const Unigine::Vector< SelectedAsset > & > *  callback,
const char *  window_title = nullptr,
const char *  filter = nullptr,
const char *  hint_asset_path = nullptr,
DialogMode  mode = DialogMode::Modal 
)
static

Opens a dialog enabling the user to select multiple assets. When the dialog opens, the specified default path and file filter shall be set displaying the corresponding elements. On selecting assets and confirming selection by clicking OK, the specified callback function is executed.

Parameters
callbackCallback function to be fired on selecting assets and clicking OK. The signature of the callback function is as follows: void (const Unigine::Vector<SelectedAsset> &)
window_titleTitle of the dialog window. If not specified, the default title is 'Select Asset'.
filterFilter, which is used to display files of required types only. List of file extensions with leading dots and without additional separators, for example: .mesh.prop. If the filter is empty, the dialog displays assets of all types.
hint_asset_pathPath to an asset to be selected by default when the dialog opens.
modeDialog mode to be set (see DialogMode).

◆ saveAsset()

static void Editor::AssetDialogs::saveAsset ( Unigine::CallbackBase1< const char * > *  callback,
const char *  window_title = nullptr,
const char *  filter = nullptr,
const char *  dest_path = nullptr,
DialogMode  mode = DialogMode::Modal 
)
static

Opens a dialog enabling the user to save an asset to the selected path. When the dialog opens, the specified default path and file filter shall be set displaying the corresponding elements. On selecting assets and confirming selection by clicking OK, the specified callback function is executed.

Parameters
callbackCallback function to be fired on selecting an asset and clicking OK. The signature of the callback function is as follows: void (const char *)
window_titleTitle of the dialog window. If not specified, the default title is 'Save Asset'.
filterFilter, which is used to display files of required types only. List of file extensions with leading dots and without additional separators, for example: .mesh.prop. If the filter is empty, the dialog displays assets of all types.
dest_pathDestination path to be set by default, when the dialog opens.
modeDialog mode to be set (see DialogMode).