psImage - cCJAction
Assigns the standard image for this action
Type: Property
Access: Read/Write
Data Type: String
Parameters: None
Syntax
Property String psImage
| Access Type | Syntax |
|---|---|
| Read Access: | Get psImage to StringVariable |
| Write Access: | Set psImage to StringVariable/Value |
Description
psImage assigns the standard image to be used for this action. psImage is the relative name of an image. When the program is run it will first check to see if the image is added to the program's resource and, if found, use it. If not, it will search for the image using the programs DFPath paths.
The image type is determined by the file extension in the passed image name: .bmp, .ico, .jpg, .png, .gif are all supported..
Sample
Object oMyMenuItem is cCJMenuItem
Set psCaption to "Select Me"
Set psToolTip to "Select Me in tooltip"
Set psDescription to "Select Me in idle statusbar pane"
Set psImage to "SelectMe.ico"
Procedure OnExecute
Showln "Select Me was selected"
End_Procedure
End_Object
Normally, a single image can be used to represent all of the different item states (normal, pressed, checked, disabled and hot). The menu system will adjust the images as needed. If you find these individual adjustments to be unsatisfactory you can assign special images for the different states using psImagePressed, psImageChecked, psImageDisabled and psImageHot).
Image Mask Color
The image mask color determines how the various image states (normal, disabled, hot, etc.) are rendered. This data is provided in icon files. With bitmap files this color is determined by using the image's top left corner.
Design-time and Dynamic Images
This property is a design-time property. It determines what the image will be when the commandbar system is created. After the commandbar system is created, changing this property will not change the image.
If you wish to change an image dynamically you can use the piIconId property. This will assign an image from the commandbar system's image list to an item. In such a case, the image must be added to the image list using the cCJCommandBarSystem's AddImage method.