Description
In BBj 5.00 and higher, this method sets the image displayed in a BBjStandardGrid cell.
Syntax
Return Value |
Method |
void |
setCellImage(int row, int column, BBjImage image!) |
void |
setCellImage(BBjVector cells, BBjImage image!) |
Parameters
Parameter |
Description |
row |
Row of cell for which image is set. |
column |
Column of cell for which image is set. |
cells |
BBjVector of BBjGridCells. |
image! |
BBjImage to display in the cell(s). |
Return Value
None.
Remarks
This method does not affect cells of type GRID_CELL_TEXT. To add an
image to a cell of type GRID_CELL_TEXT, pass an HTML string to setCellText().
Example
This example uses the Visual PRO/5 logo to set the cell image of a single cell and uses the BBj logo to set the cell image of a BBjVector of BBjGridCells.
rem 'set cell image in a BBjStandardGrid object
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=400
HEIGHT=500
TITLE$="BBjStandardGrid"
rem 'Set the current context
mySysGui!.setContext(0)
rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)
rem 'Add a grid on the window
myGrid! = myWindow!.addGrid(101, 10, 10, 300, 400, $8060$, 4, 2)
rem 'Set the grid properties
myGrid!.setDefaultColumnWidth(150)
myGrid!.setRowHeight(90)
rem 'Create Images using BBjImage Manager
Pro5url$ = "https://basis.cloud/wp-content/uploads/2023/10/vpro5logo-1.jpg"
BBjurl$ = "https://basis.cloud/wp-content/uploads/2023/10/BBjlogo.jpg"
myImageManager! = mySysGui!.getImageManager()
myPro5Image! = myImageManager!.loadImageFromURL(Pro5url$)
myBBjImage! = myImageManager!.loadImageFromURL(BBjurl$)
rem 'Set the image of a single cell
myGrid!.setCellImage(0,0,myPro5Image!)
rem 'Set the image of multiple cells
cells! = mySysGui!.makeVector()
cells!.addItem(myGrid!.getCell(2, 0))
cells!.addItem(myGrid!.getCell(2, 1))
cells!.addItem(myGrid!.getCell(3, 0))
cells!.addItem(myGrid!.getCell(3, 1))
myGrid!.setCellImage(cells!,myBBjImage!)
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
|
See Also
BBjAPI
BBjSysGui
BBjControl
BBjWindow
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.