Moray Plugin SDK Documentation
This release of the Plugin SDK can be used by Moray V3.5 (Build 9065) and later.

Scene Interface Files Interface Menu Interface Import Interface
Export Interface Object Interface Controller Interface External Interface
Data Structures C++ Support Compiler Settings

What's New

Files Interface

The Files Interface allows a plugin to use the custom File handling capabilities that Moray offers, like maintaining Search Paths and Directory histories. It also handles saving these settings across sessions.

It is recommended that you use this interface, unless you need to use your own File Dialog template, since users will be used to the functionality the File Selector offers (Last used directory and Search Paths).


Reference List of Functions

By Function Group Alphabetically
PromptForFilename
QualifyFilename
PromptForFilename
QualifyFilename



 

PromptForFilename

The function PromptForFilename prompts the user for a filename of a certain type.

    long WINAPI fnPromptForFilename(int nType, char *pszName, int nAttribs);

Parameters

nType

Contains the type of file that should be prompted for. See Remarks.

pszName

Contains the location where the name of the file should be written to.

nAttribs

Contains flags that determine the behaviour of the File Selector that pops up. See Remarks.

Return Values

MRY_SUCCESS

if the function was successful.

MRY_ERR_NO_FILE_SELECTED

if no file was selected (Cancel was pressed).

Remarks

This function can be used to prompt the user for a file and have Moray handle the maintenance of the Search paths associated with the file type.

The nType parameter can be one of the following values:


The nAttribs parameter can be a combination of the following flags:


The pszName parameter will contain only the filename, not the path, unless the file type is MRY_FILES_MORAY_SCENE, MRY_FILES_MORAY_OBJECTS or MRY_FILES_TEXTURE_LIB. In those cases the parameter will contain the full path name. To obtain the full path name in the other cases, use the QualifyFilename function.

The pszName parameter must be initialized and should contain the default filename. If you do not want a default name, set it to a zero-length string.

See Also

QualifyFilename


Top
 

QualifyFilename

The function QualifyFilename turns a filename into a fully qualified file name, i.e. with drive and directory.

    long WINAPI fnQualifyFilename(int nType, char *pszName);

Parameters

nType

Contains the type of file that should be qualified.

pszName

Contains the name of the file to be qualified.

Return Values

MRY_SUCCESS

if the function was successful.

MRY_ERR_FILE_NOT_FOUND

if the file could not be found.

Remarks

This function will search for the filename pszName in the directories of the Search Path for this type of file. It writes the fully qualified filename back to pszName.

See PromptForFilename for a list of file types.

See Also

PromptForFilename


Top