TreeViewControl Example (new GUI)

Share Tips, Code Samples, etc. with the Visual Prolog community.
Steve Lympany
VIP Member
Posts: 695
Joined: 31 Mar 2001 23:01

TreeViewControl Example (new GUI)

Unread post by Steve Lympany » 6 Jun 2005 12:58

Hello,
Here is an example project using gui\treeViewControl.
It's a reasonable starting point for anyone wishing to use treeViewControl. Most (if not all) the tree operations have been implemented - moving items around with both keyboard actions as well as drag and drop with the mouse, inserting brothers and sons, deleting, copy and pasting, and undo.
The implementation is in a form - the treeViewControl is attached to a custom control in the form. With the new GUI, of course, the code can be easily be transferred to a dialog.
Steve

PS. Zip attachment updated on 7th June. "Enter" key now terminates tree text editing

<<Thomas Linder Puls: Attachment deleted (see below)>>

Kari Rastas
VIP Member
Posts: 83
Joined: 4 Mar 2000 0:01

Unread post by Kari Rastas » 8 Jun 2005 13:37


Yuri Ilyin
Posts: 9
Joined: 3 May 2000 23:01

Unread post by Yuri Ilyin » 8 Jun 2005 14:20

Hi Steve.

The final version of your example is really nice.
Thank you.
regards Yuri.

Steve Lympany
VIP Member
Posts: 695
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 21 Jun 2005 15:55

Hi,
Here is an update for the treeViewControl example (not the control itself). It fixes a couple of bugs.

1) multiple copy bug
2) makes all items unselected when the tree file is saved.

Steve

<<Thomas Linder Puls: Attachment deleted (see below)>>

Steve Lympany
VIP Member
Posts: 695
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 24 Jun 2005 11:36

Hi,
Here is another update. This project has a dialog with 2 adjacent custom controls. The left one has the normal treeViewControl, the right one is a simple control which just lists the tree node texts, vertically positioned to be in line with the tree nodes.

This could be of use (as a starting point) for listing related data from another database, or for drawing links to the tree nodes.
cheers
Steve
Attachments
treeViewControlExample.zip
TreeViewControl with adjacent data
(35.23 KiB) Downloaded 1565 times

Steve Lympany
VIP Member
Posts: 695
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 24 Feb 2007 11:48

Updated for Vip7003

There are a couple of changes required in the pfc treeviewcontrol, and ideally in vpi (but I wouldn't (and didn't) make the vpi ones). When you compile, you will find there are errors and will need to change integer to keymodifier (I used uncheckedconvert). But it's simple enough. You will have to change the file properties to allow them to be edited.

Steve
Attachments
treeViewControl7003.zip
Manipulating data in treeviewControl
(35.29 KiB) Downloaded 975 times

Steve Lympany
VIP Member
Posts: 695
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 27 Jul 2007 11:09

Updated for Vip7.1

Steve
Attachments
treeViewControl7100.zip
(32.53 KiB) Downloaded 997 times

Post Reply