Pen Object Library: 2.4 Working with the Ink DB: Navigating the Folder Tree

Up: GEOS SDK TechDocs | Up | Prev: 2.3 Titles and Keywords | Next: 2.5 Managing Notes and Folders
InkDBGetDisplayInfo(), InkDBSetDisplayInfo(), InkDBGetHeadFolder(), InkGetParentFolder(), InkFolderGetContents(), InkFolderGetNumChildren(), InkFolderDisplayChildInList(), InkFolderGetChildInfo(), InkFolderGetChildNumber(), InkNoteGetNumPages()

Assuming the application allows the existence of more than one folder, it must allow some way to move around within the folder tree. If the application allows the user to change the structure of the folder tree, then it will need UI which allows the user to navigate an arbitrary tree. There are routines to find out and change which page is being displayed. For those applications which will need to get information about the folder tree, there are routines to get information about the folder tree.

To find the application's current location within the DB, call InkDBGetDisplayInfo() . This routine returns the current folder ID, the note ID if any is selected, and the page number within the note. To go to a different location, call InkDBSetDisplayInfo() . To use this routine, the application must pass a folder ID, along with a valid note ID and page number if a note is to be selected.

Chances are the user will be maneuvering within the folder tree. To get the ID of the root folder, use InkDBGetHeadFolder() . To find the parent folder of the passed parent or note, call InkGetParentFolder() . InkFolderGetContents() returns two chunk arrays, one containing the double word identifiers of all the folder's subfolders, the other containing the identifiers of the folder's child notes. InkFolderGetNumChildren() returns the number of subfolders and notes within a folder.

To display a note or folder's name in a GenDynamicList, use InkFolderDisplayChildInList() . This routine comes in handy when constructing UI for navigating the folder tree. To copy the icon and folder or note name of a folder or note into the visual moniker of an entry in a list, call InkNoteCopyMoniker() .

To get information about a folder's child, call InkFolderGetChildInfo() . This routine returns a bit specifying whether the child is a folder or note, along with the child's ID number. The InkFolderGetChildNumber() routine returns the passed child's place number within the folder.


Up: GEOS SDK TechDocs | Up | Prev: 2.3 Titles and Keywords | Next: 2.5 Managing Notes and Folders