Conditions to determine which image an item will display.
Usage
Set_Property(OLECtrlEntID, "OLE.ImageConditions", StringValue)
Values
StringValue can be any string meeting the following format requirements:
Syntax: @FM delimited list of conditions
Default: ""
Remarks
The ImageConditions property allows you to automate which global image an item will display. You provide an ordered list of specially formatted condition statements telling the control what state the item must be in to show a particular image. When the SRP Tree Control is about to display an item, it evaluates each condition in order and, if one of them is true, displays the associated image.
Each field has two values: Image Key and Condition. The Image Key value identifies a global image loaded via the Images property. The Condition value is the condition in which the global image is to be used. Each field in this property as a like case statement. So, the property might look something like this:
Conditions<1> = "Parent":@VM:"HasChildren" Conditions<2> = "Leaf" :@VM:"Not(HasChildren)" Conditions<3> = "Other" :@VM:"1"
However, you can visualize the property to mean this:
Begin Case Case HasChildren ShowParentImage() Case Not(HasChildren) ShowLeafImage() Case 1 ShowOtherImage() End Case
This property is overridden by the ItemImage property. In other words, the conditions are only evaluated as long as the ItemImage property is empty.
For more information on using conditions, see the Conditions tutorial in the Using SRP OLE Tree section.
Example
// Load global images for a tree that groups boys and girls into teams Images = "" Images<1> = "Boy":@VM:"BMPS\BOY.BMP" Images<2> = "Girl":@VM:"BMPS\GIRL.BMP" Images<3> = "Blue":@VM:"BMPS\BLUE.PNG" Images<4> = "Red":@VM:"BMPS\RED.PNG" Images<5> = "Gray":@VM:"BMPS\GRAY.PNG" Set_Property(@Window:".OLE_TREE", "OLE.Images", Images) // Use the ItemClass element to determine which image belongs to which item Conditions = "" Conditions<1> = "Boy":@VM:"Class = 'Boy'" Conditions<2> = "Girl":@VM:"Class = 'Girl'" Conditions<3> = "Blue":@VM:"Class = 'BlueTeam'" Conditions<4> = "Red":@VM:"Class = 'RedTeam'" Conditions<5> = "Gray":@VM:"Class = 'Unassigned'" Set_Property(@Window:".OLE_TREE", "OLE.ImageConditions", Conditions)