Tree.property

Description

Settings for a TreeView DataWindow.

Applies to

TreeView DataWindows

Syntax

PowerBuilder dot notation:

dw_control.Object.DataWindow.Tree.property

Describe and Modify argument:

"DataWindow.Tree.property { = value } “

Parameter

Description

property

A property that controls the appearance or behavior of the TreeView DataWindow. Properties and their settings are listed in the table below.

value

(exp) A string value for the file name of the tree node icon in the detail band.

Value can be a quoted DataWindow expression.

Property for Tree

Value

DefaultExpandToLevel

A long value that is the default level of expansion for the TreeView DataWindow. For example, if the default level is 2, only data with a level less than or equal to 2 is expanded by default.The value must represent a valid level.

Painter: Expand To Level By Default drop-down list on the General page in the Properties view. The list displays the levels that have been created for the DataWindow.

Indent

A long value in the units specified for the DataWindow that defines the position of the state icon. The state icon is a plus (+) or minus (-) sign that indicates whether the tree node is in a collapsed or expanded state. The icon’s indent indicates the level of the node in the tree. The X position of the state icon is the X position of its parent plus value.

Painter: Select or enter a value in the Indent Value box on the General page.

SelectNodeByMouse

A boolean value that indicates whether you can select a tree node by clicking the node with the mouse.

Values are:

  • Yes – You can select a tree node with a mouse-click (default).

  • No – You cannot select a tree node with a mouse-click.

Painter: Node By Mouse check box.

ShowConnectLines

A boolean value that indicates whether lines connecting parents and children display in the DataWindow object. This property is not supported by the Web DataWindow. If you want to show lines connecting rows in the detail band to their parent, you must also set ShowLeafNodeConnectLines.

Values are:

  • Yes – Display connecting lines (default).

  • No – Do not display connecting lines.

Painter: Show Lines check box.

ShowLeafNodeConnectLines

A boolean value that indicates whether lines connecting rows in the detail band to their parent display in the DataWindow object. This property is disabled if Show Lines box is not set. This property is not supported by the Web DataWindow.

Values are:

  • Yes – Display connecting lines (default).

  • No – Do not display connecting lines.

Painter: Connect Leaf Nodes check box.

ShowTreeNodeIcon

A boolean value that indicates whether tree node icons for level and detail bands display. If this property is not set, the Expanded and Collapsed Tree Node Icon File properties on the General properties page for each TreeView level are disabled.

Values are:

  • No – Do not display tree node icons (default).

  • Yes – Display tree node icons.

Painter: Use Tree Node Icon check box.

StateIconAlignMode

A long value that indicates how the state icon is aligned vertically with respect to the TreeView level band.

Values are:

  • 0 – Middle (default).

  • 1 – Top.

  • 2 – Bottom.

Painter: State Icon Align Mode drop-down list.

Usage


In the painter

Select the control and set values in the Properties view, General tab.

Examples

Example 1

The following code sets and gets the long value that determines how many levels of the TreeView are expanded by default:

long ll_expandlevel
dw1.Object.datawindow.tree.DefaultExpandToLevel = 1
ll_expandlevel = &
   dw1.Object.DataWindow.Tree.DefaultExpandToLevel

Example 2

The following code gets and sets the Indent value:

indentVal = dw1.Object.DataWindow.Tree.indent
dw1.Object.DataWindow.Tree.indent = 80

Example 3

The following examples manipulate the SelectNodeByMouse property:

if cbx_selectnodebymouse.checked then 			   ls_selectnodebymouse='yes' 
else
   ls_selectnodebymouse='no'
end if
ls_ret=dw1.modify("datawindow.tree.selectnodebymouse='"+ls_selectnodebymouse+"'")


if len(ls_ret)>0 then Messagebox("",ls_ret)
end if

Example 4

ls_selectnodebymouse=dw1.Describe("datawindow.tree.
selectnodebymouse")
if lower(ls_selectnodebymouse)='no' then
   cbx_selectnodebymouse.checked=false
else
   cbx_selectnodebymouse.checked=true
end if

Example 5

dw1.modify("datawindow.tree.selectnodebymouse='yes'")
dw1.Describe("datawindow.tree.selectnodebymouse")

Example 6

The following examples manipulate the show connecting lines properties:

boolean lb_ShowLines, lb_ShowLeafLines
lb_ShowLines =  &
   dw1.Object.DataWindow.Tree.ShowConnectLines
dw1.Object.DataWindow.Tree.ShowConnectLines='yes'

lb_ShowLeafLines = dw1.Object.DataWindow.Tree.
ShowLeafNodeConnectLines

dw1.Object.DataWindow.Tree.ShowLeafNodeConnectLines =&
   'yes'

Example 7

The following example gets the current value of the StateIconAlignMode property and sets it to be aligned at the top:

ls_StateIconAlignMode = dw1.Object.DataWindow.Tree.StateIconAlignMode

//Align Top dw1.Object.DataWindow.Tree.StateIconAlignMode = 1