In some cases, it may not be possible to anticipate all the bitmaps that need to be displayed in advance and attach to the column with oCol:AddBitmap() method. We may have to decide the image at the time of runtime.
From FWH2101, bBmpData can either return a number which is an index of the list of bitmaps already loaded or return any other image source.
The image source can be name of any image file, resource, web ref, image buffer, symbol or shape.
The revised fwh\samples\xbrwdisk.prg uses this enhancement to display the icons of the files. If the file is an image file like bmp,jpg,png,gif,ico, etc the image is displayed as icon. If the file is exe, the icon of the exe and in other cases, the icon of the associated program is displayed.
This is how the bBmpData is programmed:
- Code: Select all Expand view
oBrw:bBmpData := ;
{ || If( Right( oBrw:oTreeItem:cPrompt, 1 ) == ":", 4, ;
If( "D" $ oBrw:oTreeItem:Cargo[ 5 ], ;
If( oBrw:oTreeItem:lOpened, 1, 2 ), ;
oBrw:oTreeItem:Cargo[ 6 ] ; // file name with full path.
) ) ;
}