Creates a new Navigator View.
GSErrCode ACAPI_Navigator ( APINavigator_NewNavigatorViewID, API_NavigatorItem* navigatorItem, API_NavigatorView* navigatorView, const GS::Guid* parent, const GS::Guid* previousSibling );
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
). - parent
- previousSibling
- These parameters are used, when one wants to create a new folder item on the view map, and in this case the
navigatorView
parameter can benullptr
. If you create an other type of element, then this parameter can benullptr
.
The first guid is the guid of the node whereunder the new navitem will be placed (the “parent”). The second (the “previous sibling”) 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
wasnullptr
, orin theparentAndChild
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; GS::UCopy (L("This test folder is created through API."), navItem.uName); Int32 selected = DGTreeViewGetSelected (dialogID, NavTreeView, DG_TVI_ROOT); Int32 selParent = DGTreeViewGetItem (dialogID, NavTreeView, selected, DG_TVG_PARENT); GS::Guid parent = APIGuid2GSGuid (NavigatorTestGlobals::Instance ().GetNavigatorItem (TruncateTo32Bit (DGTreeViewGetItemUserData (dialogID, NavTreeView, selParent)))); GS::Guid prevSibling = APIGuid2GSGuid (NavigatorTestGlobals::Instance ().GetNavigatorItem (TruncateTo32Bit (DGTreeViewGetItemUserData (dialogID, NavTreeView, selected)))); ACAPI_Navigator (APINavigator_NewNavigatorViewID, &navItem, nullptr, &parent, &prevSibling);
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_Navigator.h