"setColumnWidthMode"

This function allows to change the width mode of a column.

Synopsis

shape.setColumnWidthMode(int column, int mode);

Parameters

Parameter Description
shape Name of the object
column Column whose width mode is to be changed.
mode

Mode to be set:

TREE_WIDTH_MANUAL = sets the width mode to "manual"

TREE_WIDTH_MAXIMUM = the column uses the maximum available space.

TREE_WIDTH_FIXED = the column has a fixed size

TREE_WIDTH_STRETCH = the column uses the space needed for the contained text content

Description

This function allows to change the width-mode of a column.

The attribute "addColumn" creates a column with "maximum" as width mode. This means that a column is adapted to accommodate the widest entry. The function "setColumnWidthMode" allows changing the width mode to the required setting.

Example

The following example sets the width mode of the first column to "manual" and of the second column to "maximum"

main()
{
  TREE1.addColumn("NAME");
  TREE1.addColumn("SURNAME");
  TREE1.appendItem("","WHOLE_NAME","WHOLE_NAME");
  //Add the first item
  TREE1.appendItem("WHOLE_NAME","MARIA","MARIA");
  //Add the second item
  TREE1.setColumnWidthMode(0, TREE_WIDTH_MANUAL);
  TREE1.setColumnWidthMode(1, TREE_WIDTH_MAXIMUM);
}

Assignment

Tree widget