APIEnv_​NewNavigatorViewID

Creates a new Navigator View.

    GSErrCode ACAPI_Environment (
        APIEnv_NewNavigatorViewID,
        API_NavigatorItem*     navigatorItem,
        API_NavigatorView*     navigatorView,
        const GS::Guid*         parentAndChildGuids
    );

 

Parameters

navigatorItem
[in/out] The item used for creating the view; its guid member will be filled on output.
navigatorView
[out] The created view (unless the navigator item’s type is API_FolderNavItem).
parentAndChildGuids
This parameter is used, when one wants to create a new folder item on the view map, and in this case the navigatorView parameter can be nullptr. If you create an other type of element, then this parameter can be nullptr.
This is an array of two GS::Guids. The first guid is the guid of the node whereunder the new navitem will be placed (the “parent”). The second (the “child”) is whereafter the new item will be placed.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
You will encounter with this return value, if something was wrong with the parameters, for example the item was nullptr, orin the parentAndChild array, the first guid is not the guid of the second’s father.

For other common API errors see the API Errors document.

 

Example

This is an example for folder item creation, based on the Navigator_Test test addon.


API_NavigatorItem navItem = {};
navItem.mapId = API_PublicViewMap;
navItem.itemType = API_FolderNavItem;
CHCopyC ("This test folder is created through API.", navItem.name);

GS::Guid parentAndChild[2];
Int32 selected = DGTreeViewGetSelected (dialogID, NavTreeView, DG_TVI_ROOT);
Int32 selParent = DGTreeViewGetItem (dialogID, NavTreeView, selected, DG_TVG_PARENT);
parentAndChild[0] = APIGuid2GSGuid (NavigatorTestGlobals::Instance ().GetNavigatorItem (TruncateTo32Bit (DGTreeViewGetItemUserData (dialogID, NavTreeView, selParent))));
parentAndChild[1] = APIGuid2GSGuid (NavigatorTestGlobals::Instance ().GetNavigatorItem (TruncateTo32Bit (DGTreeViewGetItemUserData (dialogID, NavTreeView, selected))));

ACAPI_Environment (APIEnv_NewNavigatorViewID, &navItem, nullptr, &parentAndChild);

 

Remarks

This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

 

Requirements

Version: API 13 or later
Header: APIdefs_Environment.h

 

See Also

ACAPI_Environment,
API Functions