How to Add an Overlay Condition to a Tree View

Previous Next

See Also

To add an overlay condition to a tree view:

1. Use the Windows Designer catalog to open the window or dialog that contains the tree view.
2. Open the Property Inspector and select the tree view node for which you want to display an overlay image.
3. On the Visual tab page, first set the Image property.

This is obligatory for displaying overlay images. An example of an icon that is not visible is:

transpar.ico

4. On the Behavior tab page, set the Overlay Condition property to determine if and when the icon specified by the Image property should have a second image superimposed on it.

The general form of an overlay condition is:

SELECT '' FROM ... WHERE ...

You can use variables to refer to columns selected in the SQL Query property of this tree view node. For example:

SELECT   ''

FROM     emp

WHERE :EMP_NAME != 'John'

This will display an overlay image for all employees except John.

5. Set the Overlay Image property. The overlay image will now be displayed if the overlay condition is met, or if no overlay condition is specified.

NOTE:

You can define more than one overlay image per tree view node. When a column in the SQL Query of a tree view node has an alias TREE_IMAGE_OVERLAY, the value will be transferred to an image and used as overlay image superimposed on the image. The image properties are still available but a definition of an overlay image in the SELECT list overrules the Overlay Image property.

SELECT <value>, 'OverlayImage.ico' "TREE_IMAGE_OVERLAY" FROM <table>

When the columns of the overlay condition are added to the end of the SELECT list of the Query SQL, an overlay image becomes update-notify aware. Therefore:

Query SQL:

SELECT ONE_LINER FROM MY_TABLE

Overlay Condition:

SELECT '' FROM MY_TABLE WHERE ID>10

should change to the following to become an update-notify aware overlay image (even though the overlay condition does not change):

Query SQL:

SELECT ONE_LINER,ID FROM MY_TABLE

Overlay Condition:

SELECT '' FROM MY_TABLE WHERE ID>10