BBjGridCell::setFont

Description

In BBj 19.0 and higher, this method sets the font within a BBjGridCell.

Syntax

Return Value

Method

void

setFont(BBjFont p_font)

Parameters

Variable

Description

font

BBjFont value.

Return Value

None.

Example

gui! = BBjAPI().openSysGui("X0")
wnd! = gui!.addWindow(gui!.getAvailableContext(),100,50,500,400,"Grid Test")
grd! = wnd!.addGrid(wnd!.getAvailableControlID(),32,24,252,133)
grd!.setEnhancedSelectionModelEnabled(1)
grd!.setNumColumns(2)
grd!.setRowHeight(30)
grd!.setFitToGrid(BBjGrid.AUTO_RESIZE_NEXT_COLUMN)
vec! = new BBjVector()
vec!.addItem("1")
vec!.addItem("Item 1")
vec!.addItem("2")
vec!.addItem("Item 2")
vec!.addItem("3")
vec!.addItem("Item 3")
grd!.setNumRows(3)
grd!.setCellText(vec!)
myFont! = gui!.makeFont("arial",10,BBjFont.FONT_STRIKEOUT)
font!=gui!.makeFont("Times New Roman",12,BBjFont.FONT_BOLD)
grd!.setCellFont(0,0,font!)
cellvec! = new BBjVector()
cell1! = grd!.makeCell(0,1)
cell1!.setFont(font!)
cell1!.setText("Hello")
cell2! = grd!.makeCell(1,1)
cell2!.setText("Goodbye")
cell3! = grd!.makeCell(2,0)
cell3!.setText("Peace")
cellvec!.add(cell1!)
cellvec!.add(cell2!)
cellvec!.add(cell3!)
grd!.setCells(cellVec!)
print grd!.getSelectedCells()
print cell1!.getFont()
print grd!.getCellFont(0,1)
test! = grd!.getCell(0,1)
print test!.getFont()
wnd!.setCallback(wnd!.ON_CLOSE,"close")
process_events

close:
release

See Also

BBjAPI

BBjGrid

BBjGridCell

BBjGridData

BBjFont

BBj Object Diagram for an illustration of the relationship between BBjObjects.