home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-28 | 58.3 KB | 1,674 lines |
- /*
- Copyright (c) 1992, 1993 by Barking Spider Software, Inc. All rights reserved.
-
- Filename...: bstree.h
-
- Version....: 1.0
-
- Language...: Microsoft C/C++ 7.0
-
- Model......: Small
-
- Environment: Microsoft Windows 3.1
-
- Description: This header file describes the exported APIs supported by
- the tree control. For a description of error codes,
- notification messages, structures, etc. reference the header
- file BSCORE.H.
- Notes......:
-
- History....:
-
- Author.....: Peter J. Kaufman
-
- */
-
- /****************************************************************************/
- /* TREE CONTROL EXPORTED APIs */
- /****************************************************************************/
- /*
-
- BST_AddChildrenToParent ( )
- BST_ChangeNodeText ( )
- BST_ChangeUserData ( )
- BST_ConvertPointToSelectNotif ( )
- BST_CreateTree ( )
- BST_DeleteChildrenOfParent ( )
- BST_DeleteNode ( )
- BST_DragAcceptFiles ( )
- BST_EraseTree ( )
- BST_GetActiveNode ( )
- BST_GetFirstChildOfParent ( )
- BST_GetNextSibling ( )
- BST_GetParent ( )
- BST_GetPreviousSibling ( )
- BST_GetVersion ( )
- BST_InsertSiblingNodes ( )
- BST_SetActiveNode ( )
- BST_SetBitmap ( )
- BST_SetBitmapAndActiveBitmap ( )
- BST_SetBitmapSpace ( )
- BST_SetDeleteNodeCallBack ( )
- BST_SetFont ( )
- BST_SetIcon ( )
- BST_SetLineColor ( )
- BST_SetXSpaceBeforeText ( )
- BST_ShowActiveNode ( )
- BST_ShowLines ( )
-
- */
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_AddChildrenToParent(
- HWND hwndTree,
- LP_TREE_NODE lpParentTreeNode,
- WORD wNodeDefCount,
- LP_TREE_NODE_DEF lpTreeNodeDef);
-
- Description:
-
- This API allows the application to add one or more nodes to the tree as
- children of the given parent.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument indicates which tree control will create the new
- tree nodes. This is the window handle that was returned to the
- application after calling BST_CreateTree ( ). BST_CreateTree ( )
- creates an empty tree.
-
- LP_TREE_NODE lpParentTreeNode:
-
- This argument points to the parent tree node which will receive the
- wNodeDefCount worth of new tree node children specified by
- lpTreeNodeDef.
-
- If lpParentTreeNode is NULL then this tells the tree control that
- lpTreeNodeDef describes the root of the tree. The root has to
- be created before any other tree nodes can be added. Only one root
- node is allowed in a tree. If lpParentTreeNode is NULL and
- wNodeDefCount is greater than 1 then an error will be returned from
- BST_AddChildrenToParent ( ).
-
- If lpParentTreeNode is NOT NULL then lpParentTreeNode must be a
- valid pointer to a tree node created earlier. This tree node will
- be the parent tree node to the child tree nodes to be created.
- The child tree nodes to be created are described by the
- lpTreeNodeDef argument. The number of child tree nodes to be created
- is expressed by wNodeDefCount.
-
- Refer to the comment section of the API to understand the origins
- of the LP_TREE_NODE pointer stored in lpParentTreeNode.
-
- WORD wNodeDefCount:
-
- wNodeDefCount contains the number of nodes to be added. In other
- words, wNodeDefCount is the number of TREE_NODE_DEF array elements in
- the TREE_NODE_DEF array pointed to by lpTreeNodeDef.
-
- LP_TREE_NODE_DEF lpTreeNodeDef:
-
- lpTreeNodeDef is a pointer to an array of TREE_NODE_DEFs that describe
- each of the nodes to be added.
-
- If the given parent already has children, then the new children are
- appended to the last child of the parent. In this way, the
- application uses very little memory describing the nodes and have the
- capability for providing multitasking.
-
- Only one node may be the root node, therefore adding more than one
- child node to the parent 0L is prohibited.
-
- While adding tree nodes to the tree control, the tree control could
- receive either a memory allocation failure or realize that the total
- number of tree nodes in the tree has exceeded the maximum number of
- tree nodes allowed. If either of these conditions occur then the
- child tree nodes that were added to the tree control prior to the
- problem, are NOT removed from the tree. The application will receive
- error messages if there is a memory allocation problem or the maximum
- number of tree nodes is exceeded. The application can determine what
- child tree nodes did not make it into the tree by looking at the value
- of the lpTreeNode member of each TREE_NODE_DEF array starting from the
- beginning of the array. When a TREE_NODE_DEF's lpTreeNode member is
- found that has a value of zero, then that TREE_NODE_DEF and all
- subsequent TREE_NODE_DEFs in the TREE_NODE_DEF array were not used to
- create new child tree nodes.
-
- Comments:
-
- Where do TREE_NODE pointers come from? There are several ways to retrieve
- TREE_NODE pointers.
-
- 1) TREE_NODE pointers are supplied to the application by the tree control.
- They are returned to the application via the lpTreeNode member of the
- TREE_NODE_DEF structure, when the application successfully calls
- BST_InsertSiblingNodes ( ) or BST_AddChildrenToParent ( ), which add
- tree nodes to the given tree. The application can store these
- TREE_NODE pointers for future references.
-
- 2) The application will receive the pointer to the tree control owned
- SELECT_NOTIF structure as the result of a notification of an event.
- From the SELECT_NOTIF structure, the TREE_NODE pointer to the tree node
- involved in the event is available. Below is a list of notifications
- with the associated events:
-
- Notification Event
-
- WM_BST_SELECT_NOTIF
- - Single click left mouse button while over
- tree node.
- - Select node with up or down arrow.
- - Select node with page up or page down key.
- - Select node with home or end key.
- - Select node with Ctrl Up or Ctrl Down.
-
- WM_BST_SELECT_NOTIF_DBLCLK
- - Double click left mouse button while over
- tree node. Sends WM_BST_SELECT_NOTIF on
- first click.
- - Hit carriage return while a node is selected.
- - '+' key if the currently selected node has no
- children.
- - '-' key if the currently selected node has
- children.
-
- WM_BST_DODRAG
- - Depress the left mouse button over a tree
- node and while continuing to hold down the
- left button, move the mouse a predetermined
- distance.
-
- 3) Calling BST_GetActiveNode ( ) will return a TREE_NODE pointer of the
- currently highlighted node.
-
- 4) Calling BST_ConvertPointToSelectNotif ( ) will return a pointer to
- the tree node that lies under the coordinate supplied by the
- application.
-
- 5) BST_SetDeleteNodeCallBack ( ) allows the application to register a
- callback with the given tree control. The callback will be called
- everytime a node is deleted from the tree. Nodes can be deleted from
- the tree with three tree control export APIs or with the Windows API
- DestroyWindow ( ). The three tree control exported APIs are:
-
- BST_DeleteChildrenOfParent ( )
- BST_DeleteNode ( )
- BST_EraseTree ( )
-
- Return Codes:
-
- BST_NO_ERROR
- BST_ERR_MEMORY_ALLOC_FAILED
- BST_ERR_LEVEL_LIMIT_EXCEEDED
- BST_ERR_TOO_MANY_NODES
- BST_ERR_ONLY_ONE_ROOT_ALLOWED
- BST_ERR_INVALID_PARENT_FOR_INSERTION
- */
-
- short _export FAR PASCAL BST_AddChildrenToParent(
- HWND hwndTree,
- LP_TREE_NODE lpParentTreeNode,
- WORD wNodeDefCount,
- LP_TREE_NODE_DEF lpTreeNodeDef);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_ChangeNodeText( HWND hwndTree,
- LP_TREE_NODE lpTreeNode,
- WORD wTextLength,
- LPSTR lpszText);
-
- Description:
-
- This API allows the application to change the text of the tree node
- specified in lpTreeNode.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that contains the tree node
- that will have the text change.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node that will have it's text
- changed.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- WORD wTextLength:
-
- This argument states the number of characters for the tree control
- to display as text for the given tree node, lpTreeNode. The source
- of the node text is the lpszText argument described below.
- Normally, the application does a lstrlen ( ) on lpszText and assigns
- the result to wTextLength. But there may be cases that the string
- pointed to by lpszText is just too long and fewer characters are
- required.
-
- There is a special attribute of wTextLength in which the most
- significant bit or the sign bit acts as a flag. Depending on how
- this bit is set there are two ways to handle text in a tree node.
- In both cases, the application passes a long pointer to the text
- via the lpszText argument. The two methods are,
-
- 1) If the sign bit of wTextLength is set to 1, then the pointer
- in lpszText points to memory owned by the application and is
- guaranteed not to change (be deleted or moved). This signals the
- tree control to use the supplied string pointer to display the text and
- not worry about allocating, copying, and freeing its memory.
-
- 2) If the sign bit of wTextLength is set to 0, then the tree control
- allocates wTextLength + 1 worth of memory. The tree control then
- copies wTextLength worth of characters from the string pointed to by
- the lpszText argument to the allocated memory. This allocated memory
- is owned by the tree control, therefore the application does not have
- to manage it. When the tree node pointed to by the argument lpTreeNode
- is deleted, the tree control will free the memory pointed to by
- lpszText in the TREE_NODE.
-
- The 1) method is usually used with static databases and the 2)
- method is used with real-time systems. And of course, both methods
- can be intermixed.
-
- NOTE: If the low 15 bits of wTextLength are set to 0 then lpszText is
- set to NULL by the tree control.
-
- LPSTR lpszText:
-
- lpszText is a long pointer to a string that will be displayed
- in the tree control for the given tree node. The application must
- specify the length of string to be displayed in wTextLength.
- Please refer to the wTextLength documentation above for an
- understanding of the different methods that can be applied to the
- handling of lpszText.
-
- Comments:
-
- If a memory allocation failure occurs, then the lpszText member of
- TREE_NODE will be assigned a NULL and NO text will be displayed for the
- given tree node.
-
- If the low 15 bits of wTextLength are set to 0 then lpszText is set to
- NULL by the tree control.
-
- Return Codes:
-
- BST_NO_ERROR
- BST_ERR_MEMORY_ALLOC_FAILED
- */
-
- short _export FAR PASCAL BST_ChangeNodeText( HWND hwndTree,
- LP_TREE_NODE lpTreeNode,
- WORD wTextLength,
- LPSTR lpszText);
-
-
-
- /*---------------------------------------------------------------------------
-
- short _export FAR PASCAL BST_ChangeUserData( HWND hwndTree,
- LP_TREE_NODE lpTreeNode,
- WORD wUserDataSize,
- LPSTR lpUserData);
-
-
- Description:
-
- This API allows the application to change the user-defined data stored
- by the lpUserData member of the tree node pointed to by the argument
- lpUserData.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that contains the tree node that
- will be assigned the new user-defined data.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node that will have user-defined data
- assigned to it.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- WORD wUserDataSize:
-
- If wUserDataSize is 0 then the given pointer, lpUserData, is assigned to
- the given tree node pointed to by lpTreeNode. It will then be the
- responsibility of the application to free the memory pointed to by
- lpUserData.
-
- If wUserDataSize is not zero, it then signals the tree control to allocate
- wUserDataSize worth of memory. The tree control will then copy
- wUserDataSize bytes from the location pointed to by the given argument,
- lpUserData, in to the newly allocated memory. The tree control will
- free this allocated memory when the tree node is deleted.
-
- LPSTR lpUserData:
-
- Points to the application defined memory that the application wishes
- stored with the tree node pointed to by the argument lpTreeNode.
-
- If the wUserDataSize argument is set to 0 then the lpUserData pointer will
- be directly assigned to the lpUserData member of the tree node pointed to
- by lpTreeNode. It will be the responsibility of the application to
- free the memory pointed to by lpUserData.
-
- If wUserDataSize is non-zero, then the tree control will allocate
- wUserDataSize worth of memory, copy wUserDataSize worth of memory from the
- location pointed to by the argument lpUserData to the newly allocated
- memory, and then assign the pointer to the newly allocated memory to the
- lpUserData member of the tree node pointed to by the given argument,
- lpTreeNode.
-
- Comments:
-
- BST_SetDeleteNodeCallBack ( ) allows the application to register a
- callback with the given tree control. The callback will be called
- everytime a node is deleted from the tree. Nodes can be deleted from
- the tree with three tree control export APIs or with the Windows API
- DestroyWindow ( ). The three tree control exported APIs are:
-
- BST_DeleteChildrenOfParent ( )
- BST_DeleteNode ( )
- BST_EraseTree ( )
-
- Return Codes:
-
- BST_NO_ERROR
- BST_ERR_MEMORY_ALLOC_FAILED
- */
-
- short _export FAR PASCAL BST_ChangeUserData( HWND hwnd,
- LP_TREE_NODE lpTreeNode,
- WORD wUserDataSize,
- LPSTR lpUserData);
-
-
- /*---------------------------------------------------------------------------
- LP_SELECT_NOTIF _export FAR PASCAL BST_ConvertPointToSelectNotif(
- HWND hwndTree,
- short x,
- short y);
-
- Description:
-
- This API allows the application to request the given x, y coordinate
- to be converted into a pointer to the tree control's SELECT_NOTIF
- structure. The SELECT_NOTIF structure will contain a pointer to the
- TREE_NODE that the coordinated landed on and a wFlags member that
- describes where on the tree node the point landed. The x, y coordinate
- is relative to the client area of the tree control specified by the
- hwndTree argument.
-
- Arguments:
-
- HWND hwndTree:
-
- This is the window handle of the tree control that will evaluate the
- given x, y coordinate. hwndTree is the result of calling the exported
- API BST_CreateTree ( ).
-
- short x:
-
- X axis of the point to be converted to a pointer to the tree
- control's SELECT_NOTIF structure. The value is pixel based and
- relative to the tree control's upper left corner of the client area.
-
- short y:
-
- Y axis of the point to be converted to a pointer to the tree
- control's SELECT_NOTIF structure. The value is pixel based and
- relative to the tree control's upper left corner of the client area.
-
- Comments:
-
- Normally, this API will be used in drag and drop operations. To process
- the drop notification message from the File Manager, which is
- WM_DROPFILES, the application will need BST_ConvertPointToSelectNotif ( )
- to determine what tree node the files were dropped on. Just as well,
- if the application decides to allow the dragging of a tree node, the
- application will need to determine what the mouse cursor shape should be
- when the cursor is over other tree control nodes. Since the application
- captures the mouse and monitors the WM_MOUSEMOVE messages, it can get the
- window handle of the window that the mouse is over, determine the x, y
- point in the client area where the mouse is located, and call
- BST_ConvertPointToSelectNotif ( ) to retrieve the TREE_NODE pointer via
- the SELECT_NOTIF structure. Of course, OLE 2.0 will require the
- utilization of this API.
-
- REMEMBER: The memory pointed to by SELECT_NOTIF pointer belongs to the
- tree control and is read only. Do not write to it or free the memory
- or the tree control's integrity will be violated.
-
- Return Codes:
-
- NULL will be returned if the coordinate is not over a tree node.
-
- If the x, y coordinate landed on a tree node, then the return value will
- be the LP_SELECT_NOTIF pointer which will contain the hit flags and a
- pointer to the tree node that the x, y coordinate landed on.
-
- */
-
- LP_SELECT_NOTIF _export FAR PASCAL BST_ConvertPointToSelectNotif (
- HWND hwndTree,
- short x,
- short y);
-
-
-
- /*---------------------------------------------------------------------------
- HWND _export FAR PASCAL BST_CreateTree( HANDLE hInstance,
- HWND hwndApp,
- int x, int y,
- int nWidth, int nHeight,
- DWORD dwStyle,
- DWORD dwExStyle);
-
- Description:
-
- Creates an empty tree. BST_CreateTree ( ) ORs the style bits specified
- in dwStyle to the tree control's required styles and calls the Windows
- API, CreateWindowEx ( ). In effect, BST_CreateTree calls ( )
- CreateWindowEx ( ) as:
-
- CreateWindowEx ( dwExStyle,
- "BST_Tree",
- "",
- dwStyle | dwTreeControlStyles,
- x,
- y,
- nWidth,
- nHeight,
- hwndApp,
- NULL,
- hInstance,
- NULL);
-
- Once the tree is created then nodes can be added by calling the exported
- APIs:
-
- BST_AddChildrenToParent ( )
- BST_InsertSiblingNodes ( ).
-
- Arguments:
-
- HANDLE hInstance:
-
- Instance associated with the creation of the tree control window.
-
- HWND hwndApp:
-
- Window handle of the parent window that is creating the tree control.
-
- int x:
-
- X location of the upper left corner of the tree control in client
- area coordinates of the parent window.
-
- int y:
-
- Y location of the upper left corner of the tree control in client
- area coordinates of the parent window.
-
- int nWidth:
-
- Width of the tree control in device (pixel) units.
-
- int nHeight:
-
- Height of the tree control in device (pixel) units.
-
- DWORD dwStyle:
-
- Application requested CreateWindowEx ( ) styles.
-
- DWORD dwExStyle:
-
- Application requested CreateWindowEx ( ) extended styles.
-
- Comments:
-
- The successful return value from this call, which is a window handle,
- will be used as the tree control identifier for applying the
- tree control exported APIs. Most of the tree control APIs require
- the tree control window handle.
-
- Return Codes:
-
- If successful, BST_CreateTree ( ) will return the window handle of the
- newly created tree control. If failure, then a NULL will be returned.
- */
-
- HWND _export FAR PASCAL BST_CreateTree( HANDLE hInstance,
- HWND hwndApp,
- int x, int y,
- int nWidth, int nHeight,
- DWORD dwStyle,
- DWORD dwExStyle);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_DeleteChildrenOfParent(
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
- Description:
-
- Deletes all of the child tree nodes of the given parent tree node
- specified in lpTreeNode.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that will destroy the child
- tree nodes of the given parent tree node. This is the window handle
- that was returned to the application after it called
- BST_CreateTree ( ). BST_CreateTree ( ) creates an empty tree.
-
- LP_TREE_NODE lpTreeNode:
-
- lpTreeNode points to a tree node in the given tree in which it's
- children, if it has any, will be destroyed.
-
- After this call is made by the application, all tree node pointers
- associated with the destroyed tree nodes will be invalid.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- When a tree node is deleted, it's pointer, is no longer
- valid. The tree control frees the deleted tree node's memory. If a
- notification of a tree node's deletion is desired, then the application
- can use the tree control exported API, BST_SetDeleteNodeCallBack ( ), to
- register a callback function that the tree control will call just before
- deletion of the node. If the application has assigned a pointer
- in the lpUserData member of the tree node, and this pointer points to
- dynamically allocated memory then it is the responsibility of the
- application to free this memory.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_DeleteChildrenOfParent (HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_DeleteNode( HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
- Description:
-
- Delete all of the child tree nodes of the parent specified in lpTreeNode
- and then delete the parent (lpTreeNode) from the tree.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that will destroy the child
- tree nodes of the given parent tree node and then destroy the parent
- tree node. This is the window handle that was returned to the
- application after calling BST_CreateTree ( ). BST_CreateTree ( )
- creates an empty tree.
-
- LP_TREE_NODE lpTreeNode:
-
- lpTreeNode points to a tree node in the given tree which will be
- deleted. If this tree node has any children, then these children
- will be destroyed as well.
-
- After this call is made by the application, all tree node pointers
- associated with the destroyed tree nodes will be invalid.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- When a tree node is deleted, it's pointer, is no longer valid. The tree
- control frees the deleted tree node's memory. If a notification of a
- tree node's deletion is desired, then the application can use the tree
- control exported API, BST_SetDeleteNodeCallBack ( ), to register a
- callback function that the tree control will call just before deletion of
- the node. If the application has assigned a pointer to dynamically
- allocated memory in the lpUserData member of the tree node, it is the
- responsibility of the application to free this memory.
-
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_DeleteNode( HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
-
-
- /*---------------------------------------------------------------------------
- void _export FAR PASCAL BST_DragAcceptFiles( HWND hwndTree, BOOL bAccept);
-
- Description:
-
- Registers the tree control to accept dropped files.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that will accept the message,
- WM_DROPFILES.
-
- BOOL bAccept:
-
- If set to TRUE then the given tree control will accept the
- WM_DROPFILES message.
-
- Comments:
-
- The Windows File Manager (WINFILE.EXE) will send the WM_DROPFILES message
- to the window that registers when files are dropped onto it.
-
- Return Codes:
-
- None
-
- */
-
- void _export FAR PASCAL BST_DragAcceptFiles ( HWND hwndTree, BOOL bAccept);
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_EraseTree( HWND hwndTree);
-
- Description:
-
- Remove all of the tree nodes in the specified tree control but do not
- destroy the tree control.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that will destroy all of it's
- children including the root node. This tree control handle can still
- be used in any of the APIs such as BST_AddChildrenToParent ( ). It
- does not invalidate the tree control window handle. Remember, the
- tree needs a root.
-
- Comments:
-
- When a tree node is deleted, it's pointer, is no longer valid. The tree
- control frees the deleted tree node's memory. If a notification of a
- tree node's deletion is desired, then the application can use the tree
- control exported API, BST_SetDeleteNodeCallBack ( ), to register a
- callback function that the tree control will call just before deletion of
- the node. If the application has assigned a pointer to dynamically
- allocated memory in the lpUserData member of the tree node, it is the
- responsibility of the application to free this memory.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_EraseTree( HWND hwndTree);
-
-
-
-
- /*---------------------------------------------------------------------------
-
- LP_TREE_NODE _export FAR PASCAL BST_GetFirstChildOfParent (
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
- Description:
-
- This API returns the pointer to the tree node that satisfies these two
- conditions:
-
- 1) The tree node must reside immediately after the given tree node
- lpTreeNode.
- 2) The tree node must be the child of the given tree node lpTreeNode.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which the first child of
- the given tree node will be searched for.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node in which it's first child will be
- searched for.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- If for any reason the tree node pointed to by the returned LP_TREE_NODE
- is removed, the pointer to this tree node will be invalid.
-
- Return Codes:
-
- A NULL pointer will be returned if no child exists for the given node
- else the LP_TREE_NODE pointer to the first child of the given node
- will be returned.
- */
-
- LP_TREE_NODE _export FAR PASCAL BST_GetFirstChildOfParent (
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
-
- /*---------------------------------------------------------------------------
- LP_TREE_NODE _export FAR PASCAL BST_GetActiveNode( HWND hwndTree);
-
- Description:
-
- Returns the pointer to the active/highlighted node of the given tree.
- If there are no nodes in the tree, the return value will be NULL.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that contains the active node.
-
- Comments:
-
- The active node is the currently highlighted node, visible or hidden.
- If the deletion of a highlighted node occurs, then the next sibling
- becomes the next active node. If there is no next sibling, then the
- previous node to the deleted node becomes the active/highlighted node.
-
- Return Codes:
-
- The pointer to the active/highlighted node is returned unless there
- are no tree nodes in the tree.
- */
-
- LP_TREE_NODE _export FAR PASCAL BST_GetActiveNode( HWND hwndTree);
-
-
-
- /*---------------------------------------------------------------------------
-
- LP_TREE_NODE _export FAR PASCAL BST_GetNextSibling (
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
- Description:
-
- This API returns the pointer to the tree node that satisfies these two
- conditions:
-
- 1) The tree node must reside immediately after the given tree node
- lpTreeNode.
- 2) The tree node must have the same parent as the given tree node
- lpTreeNode.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which the next sibling
- will be searched for.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node in which it's next sibling
- will be searched for.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- If for any reason the tree node pointed to by the returned LP_TREE_NODE
- is removed, the pointer to this tree node will be invalid.
-
- Return Codes:
-
- A NULL pointer will be returned if no next sibling exists for
- the given node else the LP_TREE_NODE pointer to the next sibling
- will be returned.
- */
-
- LP_TREE_NODE _export FAR PASCAL BST_GetNextSibling (
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
-
- /*---------------------------------------------------------------------------
-
- LP_TREE_NODE _export FAR PASCAL BST_GetParent( HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
- Description:
-
- This API returns the pointer to the tree node that is the parent tree
- node of the given tree node.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which the parent of the
- given tree node will be returned.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node in which it's parent will be
- returned.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- If for any reason the tree node pointed to by the returned LP_TREE_NODE
- is removed, the pointer to this tree node will be invalid.
-
- Return Codes:
-
- A NULL pointer will be returned if the given tree node is the root node,
- else the LP_TREE_NODE pointer to the parent will be returned.
- */
-
-
- LP_TREE_NODE _export FAR PASCAL BST_GetParent( HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
-
- /*---------------------------------------------------------------------------
- LP_TREE_NODE _export FAR PASCAL BST_GetPreviousSibling (
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
- Description:
-
- This API returns the pointer to the tree node that satisfies these two
- conditions:
-
- 1) The tree node must reside immediately before the given tree node
- lpTreeNode.
- 2) The tree node must have the same parent as the given tree node
- lpTreeNode.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which the previous sibling
- will be searched for.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node in which it's previous sibling
- will be searched for.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- If for any reason the tree node pointed to by the returned LP_TREE_NODE
- is removed, the pointer to this tree node will be invalid.
-
- Return Codes:
-
- A NULL pointer will be returned if no previous sibling exists for
- the given node else the LP_TREE_NODE pointer to the previous sibling
- will be returned.
- */
-
-
- LP_TREE_NODE _export FAR PASCAL BST_GetPreviousSibling (
- HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
- /*---------------------------------------------------------------------------
- WORD _export FAR PASCAL BST_GetVersion( void );
-
- Description:
-
- Returns the version number of the tree control. The returned word
- contains the the version number. The high order byte of the word
- contains the minor version and the low order byte of the word
- contains the major version number.
-
- Arguments:
-
- void:
-
- Only one tree control DLL can be loaded at a time so any instance
- of the tree control can reflect the version.
-
- Comments:
-
- To decipher the returned WORD, use the following piece of code:
- wMinorVersion = wVersion >> 8;
- wMajorVersion = wVersion & 0x00FF;
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- WORD _export FAR PASCAL BST_GetVersion ( void );
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_InsertSiblingNodes(
- HWND hwndTree,
- LP_TREE_NODE lpSiblingTreeNode,
- BOOL bBeforeSibling,
- WORD wNodeDefCount,
- LP_TREE_NODE_DEF lpTreeNodeDef);
-
- Description:
-
- This API allows the application to insert one or more nodes into the
- tree as siblings to the given tree node.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that will create the new
- sibling tree nodes. This is the window handle that was returned to
- the application by calling BST_CreateTree ( ). BST_CreateTree ( )
- creates an empty tree.
-
- LP_TREE_NODE lpSiblingTreeNode:
-
- This argument points to the sibling tree node which will act as a
- reference point for the insertion of the new tree nodes described by
- the TREE_NODE_DEF array pointed to by lpTreeNodeDef. Sibling nodes will
- be inserted before or after the node pointed to by lpSiblingTreeNode
- depending on the value of the argument bBeforeSibling.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- BOOL bBeforeSibling:
-
- bBeforeSibling is a flag that signals the tree control to insert the
- newly created nodes before or after the sibling tree node pointed to by
- lpSiblingTreeNode. If bBeforeSibling is set to TRUE then the tree
- nodes will be inserted before the sibling tree node pointed to by
- lpSiblingTreeNode. If bBeforeSibling is set to FALSE then the newly
- created nodes will be inserted after the sibling tree node pointed to
- by lpSiblingTreeNode.
-
- WORD wNodeDefCount:
-
- wNodeDefCount contains the number of nodes to be inserted. In other
- words, wNodeDefCount is the number of TREE_NODE_DEF elements in the
- TREE_NODE_DEF array pointed to by lpTreeNodeDef.
-
- LP_TREE_NODE_DEF lpTreeNodeDef:
-
- This is a pointer to a list of TREE_NODE_DEFs that describe each of
- the nodes to be inserted.
-
- Comments:
-
- When BST_InsertSiblingNodes is called, the tree control allocates
- room for wNodeDefCount worth of nodes in the tree before or after
- lpSiblingTreeNode. Insertion before or after lpSiblingTreeNode is
- determined by the argument bBeforeSibling. The tree control then
- creates wNodeDefCount worth of new tree nodes. It then serially
- traverses the lpTreeNodeDef array, initializing the newly created tree
- nodes, placing the pointers to the newly created tree nodes into
- the lpTreeNode member of the TREE_NODE_DEF structure pointed to by
- lpTreeNodeDef. Then the tree control returns to the application where
- the application can retrieve the tree node pointers stored in the
- lpTreeNode members of the TREE_NODE_DEF structs. The application can
- use these tree node pointers in future references.
-
- Inserting nodes with a sibling of 0L is prohibited and the root node
- cannot have siblings since only one root node is allowed.
-
- Return Codes:
-
- BST_NO_ERROR
- BST_ERR_MEMORY_ALLOC_FAILED
- BST_ERR_LEVEL_LIMIT_EXCEEDED
- BST_ERR_TOO_MANY_NODES
- BST_ERR_ONLY_ONE_ROOT_ALLOWED
- BST_ERR_INVALID_PARENT_FOR_INSERTION
- */
-
- short _export FAR PASCAL BST_InsertSiblingNodes (
- HWND hwndTree,
- LP_TREE_NODE lpSiblingTreeNode,
- BOOL bBeforeSibling,
- WORD wNodeDefCount,
- LP_TREE_NODE_DEF lpTreeNodeDef);
-
-
- /*---------------------------------------------------------------------------
-
- short _export FAR PASCAL BST_SetActiveNode( HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
- Description:
-
- This API makes the tree node pointed to by the given argument, lpTreeNode,
- the active node in the given tree.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which the given tree node
- will be made active. Only one active node is allowed in each tree.
-
- LP_TREE_NODE lpTreeNode:
-
- This argument points to the tree node which will be made active.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- Comments:
-
- When the given tree node is made active, the previously active window
- becomes inactive. Only one active node is allowed in each tree.
-
- If the active node is not visible, in the client area of the tree control,
- then the active tree node will be made visible.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetActiveNode( HWND hwndTree,
- LP_TREE_NODE lpTreeNode);
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetBitmap( HWND hwndTree,
- short nBitmap,
- LP_TREE_NODE lpTreeNode,
- HBITMAP hBitmap);
- Description:
-
- Assigns a bitmap handle to a specified tree node for the specified
- bitmap space. Erases, but not deletes, the old bitmap or icon if it
- exists and then draws the new one.
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree is the tree control in which the tree node will receive the
- bitmap handle.
-
- short nBitmap:
-
- nBitmap is the index into the bitmap/icon array of the tree node in
- which the given bitmap handle will be stored. This index is zero
- based and the maximum index is MAX_BITMAPS - 1.
-
- LP_TREE_NODE lpTreeNode:
-
- lpTreeNode is the pointer to the tree node that will be assigned the
- given bitmap handle.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- HBITMAP hBitmap:
-
- hBitmap is the handle to the bitmap which will be drawn in the
- specified bitmap space for the given tree node. It will be stored in
- the tree node's hBitmap[] array in the member indexed by nBitmap.
-
- Bitmap spaces are the regions before the tree node text where the
- bitmaps/icons are painted. The left most bitmap space corresponds
- with the first array member of the tree node's hBitmap[] array.
- The second left most bitmap space corresponds with the second array
- member of the tree node's hBitmap[] array, and so on.
- The hBitmap[] array stores the tree node's bitmap/icon handles but the
- bitmap spaces are defined globally for all tree nodes. This keeps
- column alignment which looks good and makes hit testing consistent.
-
- Reference the tree control exported API, BST_SetBitmapSapce ( ) to
- learn the process of defining a bitmap space.
-
- Comments:
-
- Bitmap/icon handles are NOT the property of the tree control. The tree
- control treats the bitmap/icon handle as read only. It will use the
- handle to draw the bitmap/icon associated with the tree node. If the
- tree node already has a bitmap/icon handle stored in the specified bitmap
- position then the old handle is simply overwritten. It is the
- responsibility of the application to manage creation and destruction of
- bitmaps/icons. If the application deletes/destroys bitmaps/icons before
- the tree nodes are destroyed, then the tree control will possibly
- reference invalid bitmap/icon handles.
-
- For more information regarding bitmaps/icons and tree nodes, refer to the
- TREE_NODE structure documentation.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetBitmap ( HWND hwndTree,
- short nBitmap,
- LP_TREE_NODE lpTreeNode,
- HBITMAP hBitmap);
-
-
-
- /* ---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetBitmapAndActiveBitmap(
- HWND hwnd,
- short nBitmap,
- LP_TREE_NODE lpTreeNode,
- HBITMAP hBitmap,
- HBITMAP hActiveBitmap);
- Description:
-
- Assigns two bitmap handles to a specified tree node for the specified
- bitmap space. Erases, but not deletes, the old bitmap if defined
- and draws the new bitmap. The hBitmap handle will be used to draw the
- bitmap if the tree node is not active else the hActiveBitmap handle
- will be used to draw the bitmap if the tree node is active.
-
- This API provides a way to provide a background masked bitmap
- to match the highlight color used in showing tree node selection.
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree is the tree control in which the tree node will receive the
- bitmaps.
-
- short nBitmap:
-
- nBitmap is the index into the hBitmap[] array and the hActiveBitmap[]
- array of the specified tree node, lpTreeNode, in which the new bitmaps
- will replace the old bitmaps if they are defined. This index is zero
- based and the maximum index is MAX_BITMAPS - 1;
-
- LP_TREE_NODE lpTreeNode:
-
- This is the pointer to the tree node that will be assigned the bitmaps.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- HBITMAP hBitmap:
-
- hBitmap is the handle to the bitmap in which the above tree node
- will draw in the specified bitmap space when the node is not selected.
- This handle will be store in the tree node's hBitmap[] array.
-
- HBITMAP hActiveBitmap:
-
- hActiveBitmap is the handle to the bitmap in which the above
- tree node will draw in the specified bitmap space when the node is
- active. This handle will be store in the tree node's
- hActiveBitmap[] array.
-
- Comments:
-
- Bitmap handles are NOT the property of the tree control. The tree
- control treats the bitmap as read only. It will use the handle to draw
- the bitmap of each tree node. When a tree node is assigned a new bitmap
- handle, the old handle is simply overwritten. It is the application's
- responsibility to manage creation and destruction of bitmaps. If the
- application destroys the bitmaps before the tree control, then there
- will be trouble in paradise.
-
- For more information regarding bitmaps and tree nodes, refer to the
- TREE_NODE structure documentation.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetBitmapAndActiveBitmap( HWND hwndTree,
- short nBitmap,
- LP_TREE_NODE lpTreeNode,
- HBITMAP hBitmap,
- HBITMAP hActiveBitmap);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetBitmapSpace( HWND hwndTree,
- short nBitmap,
- short nWidth,
- short nHeight,
- BOOL bCenterBitmap);
-
- Description:
-
- Define the tree control's maximum width and height (in pixels) of the
- bitmap space, identified by the argument nBitmap, for all nodes in the
- tree. This API will reserve space before the beginning of the node's
- text for the drawing of the bitmap identified by nBitmap. If the
- bitmap/icon handle associated with bitmap space is NULL, the empty bitmap
- space will still be represented. If the next item after the empty bitmap
- space is the tree node text, then the tree control shifts the text left
- until it is butted against a non empty bitmap space or the lines.
-
- Bitmap spaces offer the application the ability to fine tune each bitmap
- position and to define each bitmap hit test area. Hit testing is not
- performed on the bitmap but on the bitmap space.
-
- The dimensions of a bitmap space are defined globally for all tree nodes.
- The reason for this is to keep column alignment of the bitmaps. This
- is visually pleasing and offers consistency with hit testing.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which to reserve the
- bitmap space. This space will be used to draw a bitmap. This space
- is before the start of the node's text, if it has text.
-
- short nBitmap:
-
- Identifies the bitmap space. This is a zero based index into a
- MAX_BITMAPS size array where each member of the array is a structure.
- This structure has two members which hold the width and height of the
- bitmap space. The width and height are defined in device coordinates
- (pixels).
-
- short nWidth:
-
- nWidth is the width, in pixels, of the reserved bitmap space.
-
- short nHeight:
-
- nHeight is the height, in pixels, of the reserved bitmap space.
-
- BOOL bCentered:
-
- If set to TRUE then center the bitmap/icon in the bitmap space.
-
- Comments:
-
- The bitmap/icon will be painted in the reserved space centered
- between the top and bottom boundaries. If bCentered is set to TRUE then
- the bitmap/icon will be centered between the left and right boundaries.
- If bCentered is set to FALSE then the bitmap/icon will be left justified
- in the bitmap space. If the bitmap is larger than the
- width and/or the height, then the bitmap will be clipped. If the icon
- is larger than the bitmap space there will be no clipping since the
- Windows API, DrawIcon(), does not provide it. Therefore, if an
- icon is going to be associated with a bitmap space, make the width and
- height of the bitmap space at least as wide and tall as the values
- returned from GetSystemMetrics (SM_CXICON) and
- GetSystemMetrics (SM_CXICON).
-
- If either nHeight or nWidth is zero, then there is no bitmap space.
-
- Remember, that the bitmap space definitions, 0 thru MAX_BITMAPS-1, are
- global to all tree nodes in the given tree control.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetBitmapSpace ( HWND hwndTree,
- short nBitmap,
- short nWidth,
- short nHeight,
- BOOL bCenterBitmap);
-
-
-
- /*---------------------------------------------------------------------------
- typedef BOOL (_export FAR PASCAL * FP_DELETE_TREE_NODE_CB) ( HWND,
- LP_TREE_NODE);
-
- short _export FAR PASCAL BST_SetDeleteNodeCallBack (
- HWND hwndTree,
- FP_DELETE_TREE_NODE_CB fpDeleteNodeCB);
-
- Description:
-
- This API allows the application to register a callback with the given
- tree control. The callback will be called everytime a node is deleted
- from the tree. Nodes can be deleted from the tree with three tree
- control export APIs or with the Windows API DestroyWindow ( ). The three
- tree control exported APIs are:
-
- BST_DeleteChildrenOfParent ( )
- BST_DeleteNode ( )
- BST_EraseTree ( )
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree identifies the tree control in which to register the callback
- with.
-
- FP_DELETE_TREE_NODE_CB fpDeleteNodeCB:
-
- The address of the callback. This will be called everytime a tree
- node deletion occurs.
-
- Comments:
-
- Know how to define callbacks before using this feature!
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- typedef BOOL (_export FAR PASCAL * FP_DELETE_TREE_NODE_CB) ( HWND,
- LP_TREE_NODE);
-
- short _export FAR PASCAL BST_SetDeleteNodeCallBack (
- HWND hwndTree,
- FP_DELETE_TREE_NODE_CB fpDeleteNodeCB);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetFont( HWND hwndTree, HFONT hFont);
-
- Description:
-
- Apply a given font to the drawing of the text for all the tree nodes of
- the given tree control.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control that will apply the given
- font to the text of every tree node.
-
- HFONT hFont:
-
- hFont is a handle to a font that was created by the application.
-
- Comments:
-
- Once the tree control receives the font handle, it becomes the property
- of the tree control and it is the responsibility of the tree control to
- delete the font. The font will be deleted if a new font is sent to the
- tree control by the application or if the tree control receives a
- WM_DESTROY message. The system font is the default font.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetFont ( HWND hwndTree, HFONT hFont);
-
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetIcon ( HWND hwndTree,
- short nIcon,
- LP_TREE_NODE lpTreeNode,
- HICON hIcon);
-
- Description:
-
- Assigns an icon handle to a specified tree node for the specified
- bitmap space. Erases, but not deletes, the old icon or bitmap and draws
- the given icon.
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree is the tree control in which the tree node will
- receive the icon handle.
-
- short nIcon:
-
- nIcon is the index into the bitmap array of the node in which the
- new handle will replace the old handle if the old handle exists.
- This index is zero based and the maximum index is MAX_BITMAPS - 1;
-
- LP_TREE_NODE lpTreeNode:
-
- This is the pointer to the tree node that will be assigned the icon.
-
- Refer to the Comments section of the documentation for the API
- BST_AddChildrenToParent ( ) for an understanding how the TREE_NODE
- pointer is made available to the application.
-
- HICON hIcon:
-
- hIcon is the handle to the icon which will be drawn in the specified
- bitmap space for the given tree node. It will be stored in the tree
- node's hBitmap[] array in the member indexed by nIcon.
-
- Bitmap spaces are the regions before the tree node text where the
- bitmaps/icons are painted. The left most bitmap space corresponds
- with the first array member of the tree node's hBitmap[] array.
- The second left most bitmap space corresponds with the second array
- member of the tree node's hBitmap[] array, and so on.
- The hBitmap[] array stores the tree node's bitmap/icon handles but the
- bitmap spaces are defined globally for all tree nodes. This keeps
- column alignment which looks good and makes hit testing tolerable.
-
- Reference the tree control exported API, BST_SetBitmapSapce ( ) to
- learn the process of defining a bitmap space.
-
- Comments:
-
- Bitmap/icon handles are NOT the property of the tree control. The tree
- control treats the bitmap/icon handle as read only. It will use the
- handle to draw the bitmap/icon associated with the tree node. If the
- tree node already has a bitmap/icon handle stored in the specified bitmap
- position then the old handle is simply overwritten. It is the
- responsibility of the application to manage creation and destruction of
- bitmaps/icons. If the application deletes/destroys bitmaps/icons before
- the tree nodes are destroyed, then the tree control will possibly
- reference invalid bitmap/icon handles.
-
- For more information regarding bitmaps/icons and tree nodes, refer to the
- TREE_NODE structure documentation.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
-
- short _export FAR PASCAL BST_SetIcon( HWND hwndTree,
- short nIcon,
- LP_TREE_NODE lpTreeNode,
- HICON hIcon);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetLineColor( HWND hwndTree,
- WORD wLineNumber,
- COLORREF clrref);
-
- Description:
-
- Places a RGB color into the line color array which, in turn, is used to
- paint the lines that connect the tree nodes. There are MAX_LINE_COLORS
- different colors.
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree is the tree control in which the line color will be assigned.
-
- WORD wLineNumber:
-
- wLineNumber is the line color index number which is 0 based and has
- an upper limit of MAX_LINE_COLORS - 1.
-
- COLORREF clrref:
-
- RGB color of the line.
-
- Comments:
-
- Levels of the tree control start at 0 and have a maximum limit of
- MAX_LEVELS - 1. To determine what color a line is painted, the tree
- control divides the level by MAX_LINE_COLORS and uses the remainder as
- the index into the line color array.
-
- If any of the line colors match the window background color, then the
- tree control will automatically select another color to avoid the
- conflict.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetLineColor ( HWND hwndTree,
- WORD wLineNumber,
- COLORREF clrref);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_SetXSpaceBeforeText( HWND hwndTree,
- short nWidth);
-
- Description:
-
- Allows the application to adjust the space between the last bitmap
- (if any) and the first character of the text string.
-
- Arguments:
-
- HWND hwndTree:
-
- This argument specifies the tree control in which to reserve space
- before the first character of the node's text string.
-
- short nWidth:
-
- nWidth is the width of the reserved space before the text. This is
- expressed in pixels.
-
- Comments:
-
- There is no default space between the rightmost bitmap space and the
- first character of the text.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_SetXSpaceBeforeText ( HWND hwndTree,
- short nWidth);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_ShowActiveNode( HWND hwndTree);
-
- Description:
-
- Place the active node and all its children (that will fit) into the
- client area of the tree control.
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree is the tree control in which to display the active node.
-
- Comments:
-
- This API allows the application to force a tree node into view.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_ShowActiveNode ( HWND hwndTree);
-
-
-
- /*---------------------------------------------------------------------------
- short _export FAR PASCAL BST_ShowLines( HWND hwndTree, BOOL bShowLines);
-
- Description:
-
- By default, the line drawing is on, but the line drawing can be
- controlled by specifying TRUE to turn on the line drawing on or FALSE to
- to turn the line drawing off.
-
- Arguments:
-
- HWND hwndTree:
-
- hwndTree is the tree control in which the display of lines is on
- or off.
-
- BOOL bShowLines:
-
- TRUE to turn line drawing on, FALSE to turn line drawing off.
-
- Comments:
-
- BST_ShowLines may be called at any time during the life of the tree
- control. A complete repaint of the tree window will be performed.
-
- Return Codes:
-
- BST_NO_ERROR
- */
-
- short _export FAR PASCAL BST_ShowLines ( HWND hwndTree, BOOL bShowLines);
-
- /*----------------------------------EOF-------------------------------------*/
-