Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Managing TreeView items – PB Docs 125 – PowerBuilder Library

Managing TreeView items – PB Docs 125

Managing TreeView items

An item in a TreeView is a TreeViewItem structure. The preceding
section described how to set the item’s properties in the
structure and then insert it into the TreeView.

This code declares a TreeViewItem structure and sets several
properties:

For information about Picture properties,
see “Managing TreeView pictures”.

When you insert an item, the inserting function returns a
handle to that item. The TreeViewItem structure is copied to the
TreeView control, and you no longer have access to the item’s
properties:

Procedure for items: get, change, and set

If you want to change the properties of an item in the TreeView,
you:

  1. Get the
    item, which assigns it to a TreeViewItem structure.

  2. Make the changes, by setting
    TreeViewItem properties.

  3. Set the item, which copies
    it back into the TreeView.

When you work with items that have been inserted in the TreeView,
you work with item handles. Most TreeView events pass one or two
handles as arguments. The handles identify the items the user is
interacting with.

This code for the Clicked event uses the handle of the clicked
item to copy it into a TreeViewItem structure whose property values
you can change:

note.png Important

Remember to call the SetItem function after
you change an item’s property value. Otherwise, nothing
happens in the TreeView.

Items and the hierarchy

You can use item handles with the FindItem function
to navigate the TreeView and uncover its structure. The item’s
properties tell you what its level is, but not which item is its
parent. The FindItem function does:

You can use FindItem to find the children
of an item or to navigate through visible items regardless of level.

For more information, see the FindItem function
in the PowerScript Reference.

Enabling TreeView functionality in scripts

By setting TreeView properties, you can enable or disable
user actions like deleting or renaming items without writing any
scripts. You can also enable these actions by calling functions.
You can:

  • Delete items

  • Rename items

  • Move items using drag and drop

  • Sort items


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x