Functions
User Preferences

Functions

int mdlUserPrefs_deleteStartUpInfo (UInt32 rscType, WCharCP taskNameP)
 Deletes the startup information resource from the user preferences file. More...
 
int mdlUserPrefs_loadStartUpInfo (WCharP fileNameP, int *argcP, WCharCP **argvP, UInt32 rscType, WCharCP taskNameP)
 Loads an application's startup resource information from MicroStation user preference file. More...
 
int mdlUserPrefs_saveStartUpInfo (WCharCP fileP, int argc, WCharCP argv[], int rscType, WCharCP taskNameP)
 Saves a startup information resource in the user preferences file for later use by MicroStation. More...
 
void mdlUserPrefs_getFileName (DefaultFileInfo *defFileInfoP, RscFileHandle userPrefH, UInt32 resourceId)
 Gets the file search parameters last used in the MicroStation File Open or File Create dialog. More...
 
void mdlUserPrefs_save (UserPrefs *upP)
 Saves the user's preferences to disk. More...
 
void mdlUserPrefs_saveFileName (DefaultFileInfo *defFileInfoP, RscFileHandle userPrefH, UInt32 resourceId)
 Saves file search parameters for use in the MicroStation File Open and File Create dialogs. More...
 
int mdlUserPrefs_updateLineStyleNameHistory ()
 Moves the active linestyle name to the top of the history list of linestyle names. More...
 
StringListP mdlUserPrefs_getLineStyleNameHistory ()
 Gets a list of the line style names currently in the line style history. More...
 

Detailed Description

Function Documentation

int mdlUserPrefs_deleteStartUpInfo ( UInt32  rscType,
WCharCP  taskNameP 
)

Deletes the startup information resource from the user preferences file.

Parameters
[in]rscTypethe type of startup information resource to be deleted from user preferences. RTYPE_DgnAppStartUp is currently the only MicroStation recognized resource.
[in]taskNamePthe application to which the resource applies. This is used as an alias for locating the specific resource information.
Returns
SUCCESS upon successful completion or a non-zero value indicating the reason for failure.
See also
mdlUserPrefs_saveStartUpInfo mdlUserPrefs_loadStartUpInfo
void mdlUserPrefs_getFileName ( DefaultFileInfo defFileInfoP,
RscFileHandle  userPrefH,
UInt32  resourceId 
)

Gets the file search parameters last used in the MicroStation File Open or File Create dialog.

MicroStation automatically saves this information each time the user uses one of these two dialogs. Each file type (design file, reference file, etc.) has its own set of file search criteria.

Parameters
[out]defFileInfoPthe file location information. tDefaultFileInfo is defined in deffiles.h. The fileName and fileFilter structure members are usually of most interest.
[in]userPrefHhandle to the user preferences file. Obtain this handle using mdlDialog_userPrefFileOpen.
[in]resourceIdId of the file info to retrieve.
See also
mdlUserPrefs_saveFileName mdlDialog_userPrefFileOpen mdlUserPrefs_getFileNameW
StringListP mdlUserPrefs_getLineStyleNameHistory ( )

Gets a list of the line style names currently in the line style history.

Returns
A pointer to the StringList that contains the line style name history.
Remarks
The caller should free the StringList returned using mdlStringList_destroy
int mdlUserPrefs_loadStartUpInfo ( WCharP  fileNameP,
int *  argcP,
WCharCP **  argvP,
UInt32  rscType,
WCharCP  taskNameP 
)

Loads an application's startup resource information from MicroStation user preference file.

This information can be used to load the application into memory.

Parameters
[out]fileNamePthe application file. This name can be used to load the application into memory.
[out]argcPthe number of argument retrieved
[out]argvPthe retrieved arguments
[in]rscTypethe type of startup information resource to be loaded. RTYPE_DgnAppStartUp is currently the only MicroStation recognized resource.
[in]taskNamePthe application to which the resource applies. Used as an alias for locating the specific resource information.
Remarks
argcP and argvP are the command line parameters to be passed to the application at startup.
Returns
SUCCESS if the startup information could be loaded into memory or a non-zero value indicating the reason for failure.
See also
mdlUserPrefs_saveStartUpInfo mdlUserPrefs_deleteStartUpInfo
void mdlUserPrefs_save ( UserPrefs upP)

Saves the user's preferences to disk.

The function also updates internal MicroStation variables to reflect the changes.

Parameters
[in]upPIf not NULL, copy and save, else just save.
Remarks
The mdlUserPrefs_get function should not be used. MicroStation loads all user preferences during startup, and they are available to programmers in the MicroStation built-in variable userPrefsP. MDL programmers can modify what userPrefsP points to and then save the information using mdlUserPrefs_save.
void mdlUserPrefs_saveFileName ( DefaultFileInfo defFileInfoP,
RscFileHandle  userPrefH,
UInt32  resourceId 
)

Saves file search parameters for use in the MicroStation File Open and File Create dialogs.

Filling in a default file name and/or file filter helps the user to find files using these dialogs. MicroStation automatically saves this information each time the user uses a file open dialog This function is provided to allow an application to override the automatically saved information. Each file type (design file, reference file, etc.) gets its own set of file search criteria.

Parameters
[in]defFileInfoPa DefaultFileInfo structure containing the search criteria. The calling application allocates a variable of this type, initializes it to zeroes, and then sets the fileName and fileFilter members prior to calling this function.
[in]userPrefHHandle to the user preferences file where the file search information is saved. Obtain this handle using the mdlDialog_userPrefFileOpen function. Passing NULLRSC in this argument causes the current user preferences file to be used. MicroStation will open the file, write to it and close it.
[in]resourceIdType of file for which the information is saved. All standard MicroStation file types are defined in the file deffiles.h. An application can define its own file types simply by using positive numbers for the ids. Each resource with a positive file ID is qualified with the calling application's name so you don't need to worry about one applications file ID numbers conflicting with any other application's IDs.
See also
mdlUserPrefs_getFileName mdlDialog_userPrefFileOpen
int mdlUserPrefs_saveStartUpInfo ( WCharCP  fileP,
int  argc,
WCharCP  argv[],
int  rscType,
WCharCP  taskNameP 
)

Saves a startup information resource in the user preferences file for later use by MicroStation.

If startup resources of type RTYPE_DgnAppStartUp are found in the user preferences file upon entering design file graphics, the applications indicated are loaded as design file applications (DGNAPPS) by MicroStation.

Parameters
[in]filePthe name of the application file.
[in]argcthe number of command line parameters to be passed to the application at startup.
[in]argvcommand line parameters to be passed to the application at startup.
[in]rscTyperscType is defines the type of startup information resource to be loaded from user preferences. RTYPE_DgnAppStartUp is currently the only MicroStation recognized resource.
[in]taskNamePThe name of the task for which the resource applies. This is used as an alias for the specific resource information.
Returns
SUCCESS if the information was saved successfully or a non-zero value indicating the reason for failure.
See also
mdlUserPrefs_saveStartUpInfo mdlUserPrefs_deleteStartUpInfo
int mdlUserPrefs_updateLineStyleNameHistory ( )

Moves the active linestyle name to the top of the history list of linestyle names.

Returns
SUCCESS if the operation was completed successfully, otherwise ERROR.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.