In VLF-WIN the Framework services manager allows command handlers or filters to retrieve the reference to a VLF icon.
If using a reference to an icon multiple times, it is better to use the avFindIcon method once in the initialization routine, and store the reference in a dynamic variable defined at the component level. (See example)
The reference to a VF_ icon is retrieved using the avFindIcon method.
Method avFindIcon Parameters
Name |
Usage |
Named |
Mandatory. The name of the icon to be retrieved. |
Reference |
Mandatory. Returned as a reference to an object of class PRIM_ICON. |
Example of using the avFindIcon method
Set a list item's icon to the Visual LANSA Framework icon named VF_IC386
* Component definitions
DEFINE_COM CLASS(#PRIM_ICON) NAME(#ICON_NORM) REFERENCE(*DYNAMIC)
...
* Initialization routine
invoke #avSystem.avFindIcon Named(VF_IC486) Reference(#ICON_NORM)
...
* Use the reference
set #ltvw_1.CurrentItem Image(#ICON_NORM)