BBjImageManager::addImageList

Description

In BBj 6.00 and higher, this method registers a BBjImage object as an image list, making it available to the sysgui.

Syntax

Return Value

Method

int

addImageList(int imageWidth, BBjImage image!)

Parameters

Variable

Description

imageWidth

The width of an individual image in the image list.

image

A BBjImage as returned by one of the loadImageFromXXX() methods on BBjImageManager.

Return Value

Returns a unique integer that represents the image list ID.

Remarks

This is the object method equivalent to the IMAGELIST Mnemonic. This method will return an integer that can then be passed into the methods or mnemonics that take an image list id, such as BBjTabCtrl::setImageListID(), or BBjGrid::setColumnHeaderCellIcon(). Methods that refer to an image list id and an image list index will show an image that represents a "slice" of the image passed into addImageList(), where the imageWidth parameter specifies the width of each slice.

Example

open(sg_chan)"X0"
api! = BBJAPI()
sg! = api!.getSysGui()
win! = sg!.addWindow(1, 100, 100, 400, 300, "Test", $00010083$)
win!.setCallback(api!.ON_CLOSE, "DO_EXIT_CALLBACK")
imgr! = sg!.getImageManager()
image! = imgr!.loadImageFromFile("17imglst.bmp")
individualImageWidth = 24
imageListID = imgr!.addImageList(individualImageWidth, image!)
tabDesc$ = $$
FOR i = 1 TO 3
    imageListIndex = i
    ctrlID = -1
    tabDesc$ = tabDesc$ + BIN(imageListIndex, 2)
    tabDesc$ = tabDesc$ + BIN(ctrlID, 2)
    tabDesc$ = tabDesc$ + "Tab " + STR(i) + $00$
NEXT I
tab! = win!.addTabCtrl(101, 10, 10, 380, 280, $$, $$, tabDesc$, imageListID)

process_events

DO_EXIT_CALLBACK:
release

See Also

BBjAPI

BBjSysGui

BBjImageManager

BBjImage

IMAGELIST Mnemonic

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