PML Customisation
User Guide
Gadgets and their Attributes
:
Gadgets that Support Pixmaps
: AddPixmap Method
AddPixmap Method
The AddPixmap method is the best way of setting or changing a gadget's associated pixmaps.
Adding an ICON from a resource file
AddPixmap(!resource is STRING)
Where !resource is the name of an icon in a resource file. The string in !resource must have the format Resource>Name>Size, for example
!this.snap.addPixmap('AvevaSharedIcons>ID_LINE>16')
Adding a PNG image
AddPixmap( !pixmap is STRING )
!pixmap is a string holding the file pathname of the required .png file.
AddPixmap( !pixmap1 is STRING, !pixmap2 is STRING )
!pixmap1 corresponds to the Un-selected state of the gadget, and pixmap2 corresponds to the Selected state. Specifying !pixmap1 as the null string ' ', will leave the current Selected pixmap unchanged.
PARAGRAPH gadgets only have one pixmap which is represented by the .VAL member, and so can be directly set or changed using
!this.myPara.val = '<pixmap-pathname>
.
Notes:
1.
The PML function !!PML.GetPathname ('<myPixmap>.png') returns the required pixmap pathname for pixmaps held in the standard AVEVA E3Dâ„¢ Appware pixmap directories.
2.
It is recommended that when you define the gadget you set its size to encompass the largest pixmap which you will later add. Failure to do this may give rise to unexpected behaviour.
3.
Historically you could add a third pixmap which was used when the gadget was de-activated. This practice is no longer necessary as the gadget pixmapped is automatically greyed-out on de-activation.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.