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

TreeViewControl Example (new GUI)

Unread post by Steve Lympany »

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
Active Member
Posts: 36
Joined: 4 Mar 2000 0:01

Unread post by Kari Rastas »

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

Unread post by Yuri Ilyin »

Hi Steve.

The final version of your example is really nice.
Thank you.
regards Yuri.
Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany »

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: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany »

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 1866 times
Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany »

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 1284 times
Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany »

Updated for Vip7.1

Steve
Attachments
treeViewControl7100.zip
(32.53 KiB) Downloaded 1304 times
Post Reply