BBjGrid::setToolTipText

Description

In BBj 9.00 and higher, this method sets the tooltip text (also known as short cue in BBx) for the BBjGrid or for a specific grid column or cell.

Syntax

Return Value Method
void setToolTipText(string text)
void setToolTipText(int col, string text)
void setToolTipText(int row, int col, string text)

Parameters

Parameter Description
text Tooltip text to be displayed when the mouse is positioned over the control.
col The column of a cell-specific or column-specific tooltip.
row The row of a cell-specific or column-specific tooltip.

Return Value

None.

Example

rem ' BBjGrid::setToolTipText

sysgui = unt
open (sysgui)"X0"

bbjapi! = BBjAPI()
sysgui! = bbjapi!.getSysGui()
window! = sysgui!.addWindow(100,100,300,200,"Grid Tooltips",$00010003$)
window!.setCallback(bbjapi!.ON_CLOSE,"eoj")

rows=10,cols=10
grid! = window!.addGrid(101,102,103,10,10,280,180,$91ce$,rows,cols)
grid!.setRowHeight(25)
grid!.setRowHeaderWidth(25)
grid!.setDefaultColumnWidth(40)
grid!.setHorizontalScrollable(1)
grid!.setVerticalScrollable(1)
grid!.setToolTipText("Grid tooltip")
text$ = grid!.getToolTipText()
print "Tool tip text for row="+str(row)+",col="+str(col)+" = "+text$

for row=0 to rows-1
    for col = 0 to cols-1
        text$=str(row)+","+str(col)
        grid!.setCellText(row,col,text$)
        switch mod(col,3)
            case 0
                grid!.setToolTipText(row,col,"Grid cell tooltip: row="+str(row)+",col="+str(col))
                text$ = grid!.getToolTipText(row,col)
                print "Tool tip text for row="+str(row)+",col="+str(col)+" = "+text$
                break
            case 1
                grid!.setToolTipText(col,"Grid column tooltip: col="+str(col))
                text$ = grid!.getToolTipText(col)
                print "Tool tip text for col="+str(col)+" = "+text$
                break
        swend
    next col
next row

header! = grid!.getRowHeader()
header!.setToolTipText("Grid row header tooltip")
for row=0 to rows-1
    text$=str(row)
    header!.setCellText(row,text$)
    switch mod(row,2)
        case 0
            header!.setToolTipText(row,"Grid row header tooltip: row="+str(row))
            text$ = header!.getToolTipText(row)
            print "Row header tool tip text for row="+str(row)+" = "+text$
            break
    swend
next row

header! = grid!.getColumnHeader()
header!.setToolTipText("Grid column header tooltip")
for col=0 to cols-1
    text$=str(col)
    header!.setCellText(col,text$)
    switch mod(col,2)
        case 0
            header!.setToolTipText(col,"Grid column header tooltip: col="+str(col))
            text$ = header!.getToolTipText(col)
            print "Column header tool tip text for col="+str(col)+" = "+text$
            break
    swend
next col

grid!.focus()

process_events

eoj:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

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