"setIconAdjusted"

Sets an icon for a line in the tree widget. Identical to the property "setIcon" but this function adjusts the size of the image to the available space.

Synopsis

shape.setIconAdjusted(string id, int column, string fileName);

Parameter

Parameter Description
shape Name of the object
id ID of the element
column Number of the column
fileName Name of the file (image) that should be shown. Specify the name of the image relative to the pictures directory e.g. "wizard.png" or "Indicators/image1.gif" or the absolute path. The image will be searched for in all proj_path/wincc_oa_path levels. See chapter Graphical design of panels for information on the supported graphic formats.

Description

Sets an icon for a line in the tree widget and adjusts the size of the image to the available space.

Example

Following example adds dummy entries to an empty tree widget and adds for comparison icons using the setIcon as well as the setIconAdjusted function.

main()
{
  //Add a column and dummy entries to the tree
  TREE1.addColumn("Entries");
  TREE1.appendItem("","ADJ","Adjusted Icon");
  TREE1.appendItem("","REG","Regular Icon");
  TREE1.appendItem("","NO","No Icon");
  //Set the icons
  TREE1.setIconAdjusted("ADJ",0,"login.png");
  TREE1.setIcon("REG",0,"login.png");
}
Figure 1. Comparison setIcon/setIconAdjusted

Assignment

Tree Widget