BBjTree::setToolTipText

Description

In BBj 9.0 and higher, sets the tooltip text of a node in the BBjTree control.

Syntax

Return Value

Method

void

setToolTipText(int ID, string text)

Parameters

Variable

Description

ID

Specifies the ID of the node to set tooltip for.

test

Tooltip text to be displayed when the mouse is positioned over the node.

Return Value

None.

Remarks

None.

Example

REM Set the tooltip text of a node in a tree control

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()

REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"

REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()

REM Set addWindow param values
X=10
Y=10
WIDTH=200
HEIGHT=200
TITLE$="BBj Window"

REM Set the current context
mySysGui!.setContext(0)

REM Create a window that is initially invisible
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$00000012$)

REM Create the tree control on the window
myTree!=myWindow!.addTree(101,0,0,WIDTH,HEIGHT)

REM Set default tooltip text
myTree!.setToolTipText("Tooltip text when not positioned over a node.")

REM Create root node of tree
ROOT_ID=0
myTree!.setRoot(ROOT_ID,"Musical Tree")
myTree!.setToolTipText(ROOT_ID,"<html>Tooltip text for root node "+str(root_id)+"<br>Musical Tree</html>")
PARENT_ID = ROOT_ID

REM Create array to hold ARTIST and songs
DIM MUSIC$[2,4]
MUSIC$[0,0]="The Beatles"
MUSIC$[0,1]="Hey Jude",MUSIC$[0,2]="Let It Be",MUSIC$[0,3]="Twist and Shout",MUSIC$[0,4]="Yesterday"
MUSIC$[1,0]="Paul Simon"
MUSIC$[1,1]="Bridge Over Troubled Waters",MUSIC$[1,2]="Hearts and Bones",MUSIC$[1,3]="Kathy's Song",MUSIC$[1,4]="The Sound of Silence"
MUSIC$[2,0]="Willie Nelson"
MUSIC$[2,1]="Always On My Mind",MUSIC$[2,2]="Getting Over You",MUSIC$[2,3]="Old Fords and Natural Stone",MUSIC$[2,4]="This Morning"

REM Add nodes to tree
FOR ARTIST=0 TO 2
NODE_ID=NODE_ID+1
REM Add the artists as expandable nodes on the tree control
myTree!.addExpandableNode(NODE_ID,PARENT_ID,MUSIC$[ARTIST,0])
myTree!.setToolTipText(NODE_ID,"<html>Tooltip text for branch node "+str(node_id)+"<br>"+MUSIC$[ARTIST,0]+"</html>")
SONG_PARENT_ID=NODE_ID
FOR SONG=1 TO 4
NODE_ID=NODE_ID+1
REM Add the songs as child nodes of the Artists on the tree control
myTree!.addNode(NODE_ID,SONG_PARENT_ID,MUSIC$[ARTIST,SONG])
myTree!.setToolTipText(NODE_ID,"<html>Tooltip text for leaf node "+str(node_id)+"<br>"+MUSIC$[ARTIST,SONG]+"</html>")
NEXT SONG
NEXT ARTIST

REM Show the window
myWindow!.setVisible(mySysGui!.TRUE)

REM Get the tooltip text of a node in the tree control
TOOLTIP_TEXT$ = myTree!.getToolTipText(NODE_ID)

REM Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN

See Also

BBjAPI

BBjSysGui

BBjControl

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.